Grouping in linker sections

Ian Lance Taylor iant@google.com
Wed Oct 14 13:22:00 GMT 2009


obair <nabble@rehill.info> writes:

> Alan Modra wrote:
>> 
>> Link in two stages.  First one is ld -r to pick out the objects you
>> need.  Second one uses a linker script to place the ld -r output
>> where you want it.
>> 
>> -- 
>> Alan Modra
>> Australia Development Lab, IBM
>> 
>> 
>
> Thanks for the response.
> I think the problem with two-stage linking is that the objects that are
> required to be linked in the first stage are not self contained; they call
> functions in the second-stage objects (those whose location does not
> matter).  The paths to these "outside" calls are not followed during the
> critical time before the re-read occurs, however.

I don't understand the objection.  ld -r permits unresolved
relocations, so the fact that the first-stage objects are not
self-contained does not seem relevant.

Ian



More information about the Binutils mailing list