diff options
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-addr.c | 5 | ||||
-rw-r--r-- | elf/dl-lookup.c | 10 | ||||
-rw-r--r-- | elf/elf.h | 5 |
3 files changed, 13 insertions, 7 deletions
diff --git a/elf/dl-addr.c b/elf/dl-addr.c index 9d285d7..3f2297a 100644 --- a/elf/dl-addr.c +++ b/elf/dl-addr.c @@ -42,7 +42,7 @@ determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info, ElfW(Word) strtabsize = match->l_info[DT_STRSZ]->d_un.d_val; const ElfW(Sym) *matchsym = NULL; - if (match->l_info[ADDRIDX (DT_GNU_HASH)] != NULL) + if (match->l_info[ELF_MACHINE_GNU_HASH_ADDRIDX] != NULL) { /* We look at all symbol table entries referenced by the hash table. */ @@ -57,6 +57,7 @@ determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info, { /* The hash table never references local symbols so we can omit that test here. */ + symndx = ELF_MACHINE_HASH_SYMIDX (match, hasharr); if ((symtab[symndx].st_shndx != SHN_UNDEF || symtab[symndx].st_value != 0) && symtab[symndx].st_shndx != SHN_ABS @@ -65,8 +66,6 @@ determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info, matchsym, addr) && symtab[symndx].st_name < strtabsize) matchsym = (ElfW(Sym) *) &symtab[symndx]; - - ++symndx; } while ((*hasharr++ & 1u) == 0); } diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index eb23cca..f9d6c36 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -403,7 +403,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash, do if (((*hasharr ^ new_hash) >> 1) == 0) { - symidx = hasharr - map->l_gnu_chain_zero; + symidx = ELF_MACHINE_HASH_SYMIDX (map, hasharr); sym = check_match (undef_name, ref, version, flags, type_class, &symtab[symidx], symidx, strtab, map, &versioned_sym, @@ -909,10 +909,10 @@ _dl_setup_hash (struct link_map *map) { Elf_Symndx *hash; - if (__glibc_likely (map->l_info[ADDRIDX (DT_GNU_HASH)] != NULL)) + if (__glibc_likely (map->l_info[ELF_MACHINE_GNU_HASH_ADDRIDX] != NULL)) { Elf32_Word *hash32 - = (void *) D_PTR (map, l_info[ADDRIDX (DT_GNU_HASH)]); + = (void *) D_PTR (map, l_info[ELF_MACHINE_GNU_HASH_ADDRIDX]); map->l_nbuckets = *hash32++; Elf32_Word symbias = *hash32++; Elf32_Word bitmask_nwords = *hash32++; @@ -927,6 +927,10 @@ _dl_setup_hash (struct link_map *map) map->l_gnu_buckets = hash32; hash32 += map->l_nbuckets; map->l_gnu_chain_zero = hash32 - symbias; + + /* Initialize MIPS xhash translation table. */ + ELF_MACHINE_XHASH_SETUP (hash32, symbias, map); + return; } @@ -1715,6 +1715,7 @@ typedef struct #define SHT_MIPS_EH_REGION 0x70000027 #define SHT_MIPS_XLATE_OLD 0x70000028 #define SHT_MIPS_PDR_EXCEPTION 0x70000029 +#define SHT_MIPS_XHASH 0x7000002b /* Legal values for sh_flags field of Elf32_Shdr. */ @@ -1962,7 +1963,9 @@ typedef struct in a PIE as it stores a relative offset from the address of the tag rather than an absolute address. */ #define DT_MIPS_RLD_MAP_REL 0x70000035 -#define DT_MIPS_NUM 0x36 +/* GNU-style hash table with xlat. */ +#define DT_MIPS_XHASH 0x70000036 +#define DT_MIPS_NUM 0x37 /* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */ |