This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFA/RFC: Enable both gold and ld in a single toolchain
On Wed, Mar 17, 2010 at 12:00 AM, Nick Clifton <nickc@redhat.com> wrote:
> 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.
>
I see. Thanks.
--
H.J.