===================================================================
@@ -88,6 +88,8 @@ determine_info (const ElfW(Addr) addr, s
for (; (void *) symtab < (void *) symtabend; ++symtab)
if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
|| ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
+ && ELFW (ST_VISIBILITY) (symtab->st_other) != STV_HIDDEN
+ && ELFW (ST_VISIBILITY) (symtab->st_other) != STV_INTERNAL
&& ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
&& (symtab->st_shndx != SHN_UNDEF
|| symtab->st_value != 0)
===================================================================
@@ -516,6 +516,12 @@ do_lookup_x (const char *undef_name, uin
#endif
}
+ /* Hidden and internal symbols are local, ignore them. */
+ unsigned char visibility = ELFW (ST_VISIBILITY) (sym->st_other);
+ if (__glibc_unlikely (visibility == STV_HIDDEN
+ || visibility == STV_INTERNAL))
+ goto skip;
+
switch (ELFW(ST_BIND) (sym->st_info))
{
case STB_WEAK:
===================================================================
@@ -233,7 +233,9 @@ _dl_relocate_object (struct link_map *l,
/* 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 \
+ && ELFW (ST_VISIBILITY) ((*ref)->st_other) != STV_HIDDEN \
+ && ELFW (ST_VISIBILITY) ((*ref)->st_other) != STV_INTERNAL) \
? ((__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 (), \