This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]