On Tue, May 10, 2011 at 4:24 PM, Paul Pluzhnikov <ppluzhni...@google.com> wrote: > On Tue, May 10, 2011 at 7:02 AM, Ian Lance Taylor <i...@google.com> wrote: >> Richard Guenther <richard.guent...@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}.
I think we patched binutils for hash-style (we use =both) and gcc for build-id. Richard. > 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 >