This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch] make default linker --hash-style configurable option


On Tue, May 10, 2011 at 7:02 AM, Ian Lance Taylor <iant@google.com> wrote:
> Richard Guenther <richard.guenther@gmail.com> writes:

>> I wonder why this is a GCC specific patch and not a linker patch. ?Why
>> not change the linker(s) to accept such configure option that changes its
>> default behavior?
>
> It is traditionally gcc which tells the linker what to do. ?E.g., Fedora
> has patched gcc to pass --hash-style=gnu to the linker.

I think 'traditionally' is the key here.

The same argument applies to e.g. --build-id. We already have GCC
supply that, but we could have changed the default in
binutils/{ld,gold}.

Also, the argument is discoverable (by observing 'gcc -v' output).
Changing the default in {ld,gold} makes it hard(er) to understand why
e.g. binaries linked from the same object files using two different
versions of GCC are different.

>> Otherwise if people link with ld they suddenly get different hash-style.
>> That looks wrong to me.
>
> That turns out not to be the case.

I think Richard meant "if people link directly with either ld or gold
(i.e. bypassing 'gcc' driver) get different hash-style". That's kind
of expected though -- if you want to get the same output you get from
'gcc', you need to examine 'gcc -v' very carefully. And, as Jakub
noted, linking directly with 'ld' is discouraged.

Thanks,
-- 
Paul Pluzhnikov


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