ld -r frustration
Ian Lance Taylor
ian@wasabisystems.com
Tue Jul 27 15:46:00 GMT 2004
Alan Modra <amodra@bigpond.net.au> writes:
> That's not the ideal solution, especially considering that tools
> like libtool use "ld -r" to work around command line limits when
> linking huge numbers of object files. What we really need is a
> "ld -r" that doesn't do any merging of sections, or a final link
> stage that can undo the effects of "ld -r". The latter would need
> quite a bit of work, and probably not be very robust. I'm leaning
> towards the idea of making "ld -r" behave like "ar cr" on PowerPC64.
Note that some people use ld -r, and then objcopy -K to only keep
certain symbols. This is a simple form of symbol hiding.
Note that on operating systems like VxWorks, all programs are linked
using ld -r, and the resulting .o file is loaded onto the board.
I don't think you can make this change unconditionally.
Can you do something along the lines of ld -r --split-by-reloc? That
was intended to solve a related problem.
Ian
More information about the Binutils
mailing list