This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld -r behavior
- From: Michael Hennebry <hennebry at web dot cs dot ndsu dot NoDak dot edu>
- To: Jan Beulich <jbeulich at novell dot com>
- Cc: Alan Modra <amodra at bigpond dot net dot au>, <binutils at sourceware dot org>
- Date: Fri, 14 Sep 2007 11:00:03 -0500 (CDT)
- Subject: Re: ld -r behavior
On Fri, 14 Sep 2007, Jan Beulich wrote:
> >>> Alan Modra <amodra@bigpond.net.au> 14.09.07 03:21 >>>
> >On Thu, Sep 13, 2007 at 04:23:57PM +0100, Jan Beulich wrote:
> >> Is there a way to make ld resolve relocations referencing local absolute symbols
> >> when doing a relocatable link?
> >
> >Not without writing a lot of code for every backend.
Could something like this be conveniently automated:
Run the assembler on fred.S .
Run the linker without -r, with --warn-unresolve-symbols and --print-map .
Parse the map to pick out the values of desired
symbols and generate an assembler file:
symbol1=value1
...
symbol666=value666
.include "fred.S"
Run the assembler on the new file.
> That is what I was afraid of. And it is my understanding that no other of the
> utility programs in binutils can do this either, meaning that past the assembler
> stage there's nothing one can do to eliminate these pointless relocations.
--
Mike hennebry@web.cs.ndsu.NoDak.edu
"Horse guts never lie." -- Cherek Bear-Shoulders