George Rimar via llvm-dev
2017-Oct-02 12:23 UTC
[llvm-dev] Should we switch to --hash-style=both by default in LLD ?
Hi ! During linking LLD and other linkers builds a static hash table for dynamic symbols, so that in runtime dynamic linker can use this table and find symbols faster. --hash-style=style linker option is used to select the hash type: "Set the type of linker's hash table(s). style can be either "sysv" for classic ELF ".hash" section, "gnu" for new style GNU ".gnu.hash" section or "both" for both the classic ELF ".hash" and new style GNU ".gnu.hash" hash tables. The default is "sysv"." GNU_HASH format is a better version of hash table (https://sourceware.org/ml/binutils/2006-10/msg00377.html). We have --hash-style=sysv currently set by default in LLD. Though recently (see https://bugs.llvm.org//show_bug.cgi?id=34712) GNU linkers switched to use ".gnu.hash" section format in addition to normally used classic ".hash". So they defaults --hash-style to "both" and this looks to be released with binutils 2.30. 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
Romain GEISSLER via llvm-dev
2017-Oct-02 12:29 UTC
[llvm-dev] Should we switch to --hash-style=both by default in LLD ?
> 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, IncHi, 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
George Rimar via llvm-dev
2017-Oct-02 12:35 UTC
[llvm-dev] Should we switch to --hash-style=both by default in LLD ?
>> 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, >RomainFair 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.
Rafael Avila de Espindola via llvm-dev
2017-Oct-02 23:15 UTC
[llvm-dev] Should we switch to --hash-style=both by default in LLD ?
I don't think there is much value in being different from the gnu linkers in here since the common case is to have the compiler driver pass an explicit option. So +1 to changing the default to "both". Cheers, Rafael George Rimar <grimar at accesssoftek.com> writes:> Hi ! > > During linking LLD and other linkers builds a static hash table for dynamic symbols, > so that in runtime dynamic linker can use this table and find symbols faster. > > --hash-style=style linker option is used to select the hash type: > "Set the type of linker's hash table(s). style can be either "sysv" for classic ELF ".hash" section, > "gnu" for new style GNU ".gnu.hash" section or "both" for both the classic ELF ".hash" and new > style GNU ".gnu.hash" hash tables. The default is "sysv"." > > GNU_HASH format is a better version of hash table (https://sourceware.org/ml/binutils/2006-10/msg00377.html). > > We have --hash-style=sysv currently set by default in LLD. > Though recently (see https://bugs.llvm.org//show_bug.cgi?id=34712) GNU linkers switched to use > ".gnu.hash" section format in addition to normally used classic ".hash". > So they defaults --hash-style to "both" and this looks to be released with binutils 2.30. > > 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
Rui Ueyama via llvm-dev
2017-Oct-02 23:22 UTC
[llvm-dev] Should we switch to --hash-style=both by default in LLD ?
On Mon, Oct 2, 2017 at 4:15 PM, Rafael Avila de Espindola < rafael.espindola at gmail.com> wrote:> I don't think there is much value in being different from the gnu > linkers in here since the common case is to have the compiler driver > pass an explicit option. > > So +1 to changing the default to "both". >... except for MIPS, as the way how we need to sort .gnu.hash section contents is not compatible with a MIPS ABI requirement. Cheers,> Rafael > > George Rimar <grimar at accesssoftek.com> writes: > > > Hi ! > > > > During linking LLD and other linkers builds a static hash table for > dynamic symbols, > > so that in runtime dynamic linker can use this table and find symbols > faster. > > > > --hash-style=style linker option is used to select the hash type: > > "Set the type of linker's hash table(s). style can be either "sysv" for > classic ELF ".hash" section, > > "gnu" for new style GNU ".gnu.hash" section or "both" for both the > classic ELF ".hash" and new > > style GNU ".gnu.hash" hash tables. The default is "sysv"." > > > > GNU_HASH format is a better version of hash table ( > https://sourceware.org/ml/binutils/2006-10/msg00377.html). > > > > We have --hash-style=sysv currently set by default in LLD. > > Though recently (see https://bugs.llvm.org//show_bug.cgi?id=34712) GNU > linkers switched to use > > ".gnu.hash" section format in addition to normally used classic ".hash". > > So they defaults --hash-style to "both" and this looks to be released > with binutils 2.30. > > > > 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171002/2d29cf2f/attachment.html>
Reasonably Related Threads
- Should we switch to --hash-style=both by default in LLD ?
- Should we switch to --hash-style=both by default in LLD ?
- [RFC] - Deduplication of debug information in linkers (LLD).
- [LLD/ELF] - Should we implement .note.gnu.property and/or Intel CET in LLD ?
- [EXTERNAL] Re: preferred way to return expected values