aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-addr.c1
-rw-r--r--elf/dl-lookup.c4
-rw-r--r--elf/dl-reloc.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index 291ff55816..1b16a58ced 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -88,6 +88,7 @@ determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info,
for (; (void *) symtab < (void *) symtabend; ++symtab)
if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
|| ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
+ && __glibc_likely (!dl_symbol_visibility_binds_local_p (symtab))
&& ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
&& (symtab->st_shndx != SHN_UNDEF
|| symtab->st_value != 0)
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 6d299c1097..52c994e16c 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -516,6 +516,10 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
#endif
}
+ /* Hidden and internal symbols are local, ignore them. */
+ if (__glibc_unlikely (dl_symbol_visibility_binds_local_p (sym)))
+ goto skip;
+
switch (ELFW(ST_BIND) (sym->st_info))
{
case STB_WEAK:
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 14709f960d..42bddc1e2c 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -233,7 +233,8 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
/* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */
#define RESOLVE_MAP(ref, version, r_type) \
- (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \
+ ((ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \
+ && __glibc_likely (!dl_symbol_visibility_binds_local_p (*ref))) \
? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \
&& elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \
? (bump_num_cache_relocations (), \