This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld -r frustration
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sources dot redhat dot com
- Date: 27 Jul 2004 11:46:33 -0400
- Subject: Re: ld -r frustration
- References: <20040727151103.GB15182@bubble.modra.org>
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