Reid Kleckner via llvm-dev
2017-Oct-02 16:28 UTC
[llvm-dev] Should we switch to --hash-style=both by default in LLD ?
+1 for both table formats. Then we're compatible by default no matter what. If somebody cares about .o file size, they can explicitly specify their --hash-style. On Mon, Oct 2, 2017 at 5:35 AM, George Rimar via llvm-dev < llvm-dev at lists.llvm.org> wrote:> >> Le 2 oct. 2017 à 14:23, George Rimar <grimar at accesssoftek.com> a écrit > : > >> > >> I think we can switch LLD either to "both" or probably to "gnu" by > default as well. > >> Initial version of patch that changes default to "both" is here: D38407 > >> > >> Any thoughts ? > >> > >> Best regards, > >> George | Developer | Access Softek, Inc > > > >Hi, > > > >I initially wanted to switch the default to "gnu" as well in GNU linkers. > However it was argued that this would generate ELF fiels that do not follow > the ELF ABI. See here >https://sourceware.org/ml/ > binutils/2017-07/msg00160.html Thus it has been chosen to use "both" > rather than "gnu". > > > >Cheers, > >Romain > > Fair enough, argument that we should not emit ELF files that aren't ABI > compliant by default looks reasonable. > Use of "both" looks ideal for me then. > > George. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171002/69c3e6f5/attachment.html>
Rui Ueyama via llvm-dev
2017-Oct-02 16:37 UTC
[llvm-dev] Should we switch to --hash-style=both by default in LLD ?
Changing default to "both" is probably fine, but what does that change actually mean in practice? I believe clang already passes --hash-style=both to the linker by default. On Mon, Oct 2, 2017 at 9:28 AM, Reid Kleckner via llvm-dev < llvm-dev at lists.llvm.org> wrote:> +1 for both table formats. Then we're compatible by default no matter > what. If somebody cares about .o file size, they can explicitly specify > their --hash-style. > > On Mon, Oct 2, 2017 at 5:35 AM, George Rimar via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> >> Le 2 oct. 2017 à 14:23, George Rimar <grimar at accesssoftek.com> a >> écrit : >> >> >> >> I think we can switch LLD either to "both" or probably to "gnu" by >> default as well. >> >> Initial version of patch that changes default to "both" is here: D38407 >> >> >> >> Any thoughts ? >> >> >> >> Best regards, >> >> George | Developer | Access Softek, Inc >> > >> >Hi, >> > >> >I initially wanted to switch the default to "gnu" as well in GNU >> linkers. However it was argued that this would generate ELF fiels that do >> not follow the ELF ABI. See here >https://sourceware.org/ml/bin >> utils/2017-07/msg00160.html Thus it has been chosen to use "both" rather >> than "gnu". >> > >> >Cheers, >> >Romain >> >> Fair enough, argument that we should not emit ELF files that aren't ABI >> compliant by default looks reasonable. >> Use of "both" looks ideal for me then. >> >> George. >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171002/a1db66c5/attachment.html>
Romain GEISSLER via llvm-dev
2017-Oct-02 22:00 UTC
[llvm-dev] [EXT] Should we switch to --hash-style=both by default in LLD ?
Le 2 oct. 2017 à 18:37, Rui Ueyama <ruiu at google.com<mailto:ruiu at google.com>> a écrit : Changing default to "both" is probably fine, but what does that change actually mean in practice? I believe clang already passes --hash-style=both to the linker by default. Not exactly. The current Linux driver (I haven't checked other ELF-based systems) reads this (https://github.com/llvm-mirror/clang/blob/master/lib/Driver/ToolChains/Linux.cpp#L228) // Do not use 'gnu' hash style for Mips targets because .gnu.hash // and the MIPS ABI require .dynsym to be sorted in different ways. // .gnu.hash needs symbols to be grouped by hash code whereas the MIPS // ABI requires a mapping between the GOT and the symbol table. // Android loader does not support .gnu.hash. // Hexagon linker/loader does not support .gnu.hash if (!IsMips && !IsAndroid && !IsHexagon) { if (Distro.IsRedhat() || Distro.IsOpenSUSE() || (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick)) ExtraOpts.push_back("--hash-style=gnu"); if (Distro.IsDebian() || Distro.IsOpenSUSE() || Distro == Distro::UbuntuLucid || Distro == Distro::UbuntuJaunty || Distro == Distro::UbuntuKarmic) ExtraOpts.push_back("--hash-style=both"); } Given that several libc implementation supports this in the Linux ecosystem (glibc, musl, uClibc, most likely others) I think lld should provide good defaults by default, instead of relying on what some distro maintainer have hardcoded for their own distro in clang. Cheers, ROmain -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171002/5989bb0d/attachment-0001.html>