path: root/ldso
diff options
authorRich Felker <>2016-11-11 12:30:24 -0500
committerRich Felker <>2016-11-11 12:46:06 -0500
commitb418ea1b66d0d5a08640d4edf3b65d4619c6ef7f (patch)
treef4b2a1cc89e1c5fce77fd13cd0821eb2178c1f25 /ldso
parent4078a5c31fa67987051c2180db7a07702534032f (diff)
generalize ELF hash table types not to assume 32-bit entries
alpha and s390x gratuitously use 64-bit entries (wasting 2x space and cache utilization) despite the values always being 32-bit. based on patch by Bobby Bingham, with changes suggested by Alexander Monakov to use the public Elf_Symndx type from link.h (and make it properly variable by arch) rather than adding new internal infrastructure for handling the type.
Diffstat (limited to 'ldso')
1 files changed, 2 insertions, 2 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index acb73bc2..ad49cac2 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -54,7 +54,7 @@ struct dso {
size_t phentsize;
int refcnt;
Sym *syms;
- uint32_t *hashtab;
+ Elf_Symndx *hashtab;
uint32_t *ghashtab;
int16_t *versym;
char *strings;
@@ -206,7 +206,7 @@ static Sym *sysv_lookup(const char *s, uint32_t h, struct dso *dso)
size_t i;
Sym *syms = dso->syms;
- uint32_t *hashtab = dso->hashtab;
+ Elf_Symndx *hashtab = dso->hashtab;
char *strings = dso->strings;
for (i=hashtab[2+h%hashtab[0]]; i; i=hashtab[2+hashtab[0]+i]) {
if ((!dso->versym || dso->versym[i] >= 0)