diff options
author | Florian Weimer <fweimer@redhat.com> | 2019-11-04 18:08:50 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2019-11-11 14:18:36 +0100 |
commit | 0fa7402cbb4c88ab230eb4447f3fc2a182b17ae7 (patch) | |
tree | 8dcb0e9290f954d8aab8fea45a969904258a1b17 /include | |
parent | 0e5a24f5a968c0f791ea5e6625ad41a27c82cce6 (diff) | |
download | glibc-0fa7402cbb4c88ab230eb4447f3fc2a182b17ae7.tar glibc-0fa7402cbb4c88ab230eb4447f3fc2a182b17ae7.tar.gz glibc-0fa7402cbb4c88ab230eb4447f3fc2a182b17ae7.tar.bz2 glibc-0fa7402cbb4c88ab230eb4447f3fc2a182b17ae7.zip |
elf: Optimize symbol binding by pre-computing divisions
The division for the hash table lookup shows up in profiles. We can
use a standard compiler optimization technique to speed up the hash
table lookup. The speedup is most pronounced when a symbol lookup
succeeds early in the scope array, otherwise the bitmap check
dominates the profiles.
Change-Id: I898b7c711979447d4756b3f7b567c49a8d33187b
Diffstat (limited to 'include')
-rw-r--r-- | include/link.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/link.h b/include/link.h index 1184201f91..b09aa81bb4 100644 --- a/include/link.h +++ b/include/link.h @@ -153,6 +153,8 @@ struct link_map /* Symbol hash table. */ Elf_Symndx l_nbuckets; + uint32_t l_nbuckets_multiplier; + int l_nbuckets_multiplier_shift; Elf32_Word l_gnu_bitmask_idxbits; Elf32_Word l_gnu_shift; const ElfW(Addr) *l_gnu_bitmask; |