RFA/RFC: Enable both gold and ld in a single toolchain

Nick Clifton nickc@redhat.com
Wed Mar 17 08:15:00 GMT 2010


Hi H.J.

>> exec-tool will still need to be updated.  It is still invoked (as
>> "collect-ld") and it still needs to be able to understand the
>> -use-gold/-use-ld options.

> Aren't they passed to collect2 directly with "${1+"$@"}"?

No it works the other way around:

   gcc invokes collect2.
   collect2 invokes collect-ld.  (In a built but not installed toolchain)
   collect-ld invokes ld-new.

Thus the decision as to which linker executable to use is made by the 
collect-ld script, not the collect2 binary.

In the case of installed toolchain the sequence is different.  Here gcc 
invokes collect2 which then invokes the linker directly.  Hence collect2 
must also know about the -use-gold -use-ld switches.

Cheers
   Nick




More information about the Binutils mailing list