aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-lookup.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-02-05 14:58:39 -0800
committerH.J. Lu <hjl.tools@gmail.com>2018-02-05 14:58:57 -0800
commit6a5cac49b6eeb60abc891f9e28908da733766630 (patch)
tree19a0e8045c6c664667860a8e1e269e7b5f536e22 /elf/dl-lookup.c
parentb44e0dfbacecd0f84ebfa942e6d6c0153981680e (diff)
downloadglibc-6a5cac49b6eeb60abc891f9e28908da733766630.zip
glibc-6a5cac49b6eeb60abc891f9e28908da733766630.tar.gz
glibc-6a5cac49b6eeb60abc891f9e28908da733766630.tar.bz2
Use ADDRIDX with DT_GNU_HASH
The only differences in ld.so are line numbers for asserts. Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> * elf/dl-addr.c (determine_info): Use ADDRIDX with DT_GNU_HASH. * elf/dl-lookup.c (_dl_setup_hash): Likewise. * elf/get-dynamic-info.h (elf_get_dynamic_info): Likewise.
Diffstat (limited to 'elf/dl-lookup.c')
-rw-r--r--elf/dl-lookup.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 41dced0..401bc87 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -936,14 +936,10 @@ _dl_setup_hash (struct link_map *map)
{
Elf_Symndx *hash;
- if (__glibc_likely (map->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
- + DT_THISPROCNUM + DT_VERSIONTAGNUM
- + DT_EXTRANUM + DT_VALNUM] != NULL))
+ if (__glibc_likely (map->l_info[ADDRIDX (DT_GNU_HASH)] != NULL))
{
Elf32_Word *hash32
- = (void *) D_PTR (map, l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
- + DT_THISPROCNUM + DT_VERSIONTAGNUM
- + DT_EXTRANUM + DT_VALNUM]);
+ = (void *) D_PTR (map, l_info[ADDRIDX (DT_GNU_HASH)]);
map->l_nbuckets = *hash32++;
Elf32_Word symbias = *hash32++;
Elf32_Word bitmask_nwords = *hash32++;