Opened 11 months ago
Closed 11 months ago
#5401 closed enhancement (fixed)
Binutils: Add --enable-default-hash-style=gnu for configure
Reported by: | Xi Ruoyao | Owned by: | Xi Ruoyao |
---|---|---|---|
Priority: | normal | Milestone: | 12.1 |
Component: | Book | Version: | git |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by )
Shared objects and dynamically linked executables contain hash tables for ld.so to look up symbols in them. By default two hash tables are generated, one is classic ELF style (in the .hash section), another is GNU style (in the .gnu.hash section).
Since the GNU-style hash table can be looked up faster than a classic one, on a modern system where ld.so supports .gnu.hash, the .hash section is actually unused at all so we can configure Binutils with --enable-default-hash-style=gnu
so it (ld.bfd and ld.gold) won't generate .hash by default and save build time & disk space.
Note that Glibc >= 2.36 is already built with .hash disabled by default, thus anything other than ld.so depending on .hash (note that gABI disallows such an abuse of .hash anyway) should be already broken on LFS (for example "a notorious non-cooperative binary package").
Change History (3)
comment:1 by , 11 months ago
Description: | modified (diff) |
---|---|
Summary: | GCC: Add --with-linker-hash-style=gnu for configure → Binutils: Add --enable-default-hash-style=gnu for configure |
comment:2 by , 11 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I'm doing the last LFS update in 2023 :)
comment:3 by , 11 months ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
It seems more logical to change it for Binutils and most other distros use this way.