RFC: [PATCH] PR ld/18028: 32-bit ld runs out of memory when linking 32-bit clang with debug info

Alan Modra amodra@gmail.com
Sat Feb 28 04:36:00 GMT 2015


On Fri, Feb 27, 2015 at 11:42:39AM -0800, H.J. Lu wrote:
> When link_info.keep_memory is TRUE, linker caches the relocation
> information and symbol tables of input files in memory.  On 32-bit
> hosts, linker runs out of 32-bit virtual memory on input files with many
> relocations.  This patch defaults link_info.keep_memory to TRUE only if
> pointer size > 4 and adds a --keep-memory linker option. FIXME: linker
> may run out of physical memory on 64-bit hosts with 4GB ram.
> 
> Any comments?

This is not a good idea.  You are slowing down 32-bit host linkers for
the sake of the very few projects that need --no-keep-memory.  Better
to modify project makefiles as needed.

Also, --no-keep-memory will exercise code paths that aren't generally
used.  I'd be pleasantly surprised if this doesn't expose bugs in some
target dependent code.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list