about summary refs log tree commit diff
path: root/elf/dl-lookup.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-01-18 13:53:11 +0100
committerFlorian Weimer <fweimer@redhat.com>2022-01-18 14:40:21 +0100
commitc90363403b57b3b7919061851cb3e6d9c85e784a (patch)
treeb54bae71eeaa3e01574aeb2f0ec45a1d3251b362 /elf/dl-lookup.c
parentf8b765bec44e6c464a7eabf80e58c6851ca15ac3 (diff)
downloadglibc-c90363403b57b3b7919061851cb3e6d9c85e784a.tar.gz
glibc-c90363403b57b3b7919061851cb3e6d9c85e784a.tar.xz
glibc-c90363403b57b3b7919061851cb3e6d9c85e784a.zip
elf: Move _dl_setup_hash to its own file
And compile it with the early CFLAGS.  _dl_setup_hash is called
very early for the ld.so link map, so it should be compiled
differently.

Reviewed-by: Stefan Liebler <stli@linux.ibm.com>
Tested-by: Stefan Liebler <stli@linux.ibm.com>
Diffstat (limited to 'elf/dl-lookup.c')
-rw-r--r--elf/dl-lookup.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index f43ae150b7..cbf46fda62 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -953,51 +953,6 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
 }
 
 
-/* Cache the location of MAP's hash table.  */
-
-void
-_dl_setup_hash (struct link_map *map)
-{
-  Elf_Symndx *hash;
-
-  if (__glibc_likely (map->l_info[ELF_MACHINE_GNU_HASH_ADDRIDX] != NULL))
-    {
-      Elf32_Word *hash32
-	= (void *) D_PTR (map, l_info[ELF_MACHINE_GNU_HASH_ADDRIDX]);
-      map->l_nbuckets = *hash32++;
-      Elf32_Word symbias = *hash32++;
-      Elf32_Word bitmask_nwords = *hash32++;
-      /* Must be a power of two.  */
-      assert ((bitmask_nwords & (bitmask_nwords - 1)) == 0);
-      map->l_gnu_bitmask_idxbits = bitmask_nwords - 1;
-      map->l_gnu_shift = *hash32++;
-
-      map->l_gnu_bitmask = (ElfW(Addr) *) hash32;
-      hash32 += __ELF_NATIVE_CLASS / 32 * bitmask_nwords;
-
-      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;
-    }
-
-  if (!map->l_info[DT_HASH])
-    return;
-  hash = (void *) D_PTR (map, l_info[DT_HASH]);
-
-  map->l_nbuckets = *hash++;
-  /* Skip nchain.  */
-  hash++;
-  map->l_buckets = hash;
-  hash += map->l_nbuckets;
-  map->l_chain = hash;
-}
-
-
 static void
 _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
 		    const ElfW(Sym) **ref, struct sym_val *value,