id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
5240	help GNU ld to use less memory when linking libraries compiled with -split-objs.	int-e	igloo	"This is a well-known problem, but I didn't find a previous report here, probably because it is mainly a GNU ld issue. The problem is that with -split-objs, linking, say, ghc, takes a trememndous amount of memory.

Part of this problem will be fixed in ld:
  http://sourceware.org/bugzilla/show_bug.cgi?id=12682

In this bug report, Nick Clifton suggests to use '--hash-size=31' and possibly '--reduce-memory-overhead' when invoking ld. Since ghc is invoking gcc for linking, that would mean passing '-Xlinker --hash-size=31' and perhaps '-Xlinker --reduce-memory-overhead' to gcc.

Can we do that? Care needs to be taken if people use the -pgmL option, and we should make sure that gcc is actually using GNU ld.

In my experiments (linking ghc), --hash-size=31 helps, reducing memory usage by about a factor of 1/2; --reduce-memory-overhead without --hash-size=31 also helps (saving about 1/3), but has no noticable effect in connection with --hash-size=31. Based on that I'd suggest to only use --hash-size=31."	feature request	closed	high	7.4.1	Compiler	7.0.3	fixed			Unknown/Multiple	Unknown/Multiple	None/Unknown	Unknown				
