glibc/sysdeps/generic
Maciej W. Rozycki b6084a958f Treat STV_HIDDEN and STV_INTERNAL symbols as STB_LOCAL
In a reference to PR ld/19908 make ld.so respect symbol export classes
aka visibility and treat STV_HIDDEN and STV_INTERNAL symbols as local,
preventing such symbols from preempting exported symbols.

According to the ELF gABI[1] neither STV_HIDDEN nor STV_INTERNAL symbols
are supposed to be present in linked binaries:

"A hidden symbol contained in a relocatable object must be either
removed or converted to STB_LOCAL binding by the link-editor when the
relocatable object is included in an executable file or shared object."

"An internal symbol contained in a relocatable object must be either
removed or converted to STB_LOCAL binding by the link-editor when the
relocatable object is included in an executable file or shared object."

however some GNU binutils versions produce such symbols in some cases.
PR ld/19908 is one and we also have this note in scripts/abilist.awk:

so clearly there is linked code out there which contains such symbols
which is prone to symbol table misinterpretation, and it'll be more
productive if we handle this gracefully, under the Robustness Principle:
"be liberal in what you accept, and conservative in what you produce",
especially as this is a simple (STV_HIDDEN|STV_INTERNAL) => STB_LOCAL
mapping.

References:

[1] "System V Application Binary Interface - DRAFT - 24 April 2001",
    The Santa Cruz Operation, Inc., "Symbol Table",
    <http://www.sco.com/developers/gabi/2001-04-24/ch4.symtab.html>

	* sysdeps/generic/ldsodefs.h
	(dl_symbol_visibility_binds_local_p): New inline function.
	* elf/dl-addr.c (determine_info): Treat hidden and internal
	symbols as local.
	* elf/dl-lookup.c (do_lookup_x): Likewise.
	* elf/dl-reloc.c (RESOLVE_MAP): Likewise.
2016-07-01 23:48:52 +01:00
..
net
netinet
nfs
sys
_G_config.h
_itoa.h
a.out.h
abort-instr.h
aio_misc.h
allocalim.h
asm-syntax.h
atomic-machine.h
c++-types.data
confstr.h
device-nrs.h
dirstream.h
dl-cache.h
dl-dtprocnum.h
dl-dtv.h
dl-fcntl.h
dl-fileid.h
dl-fptr.h
dl-hash.h
dl-irel.h
dl-librecon.h
dl-lookupcfg.h
dl-machine.h
dl-mman.h
dl-osinfo.h
dl-procinfo.c
dl-procinfo.h
dl-sysdep.h
dl-tls.h
dl-unistd.h
dwarf2.h
elide.h
eloop-threshold.h
entry.h
errqueue.h
exit-thread.h
fd_to_filename.h
fips-private.h
fix-fp-int-convert-overflow.h
fix-int-fp-convert-zero.h
fork.h
fpu_control.h
frame.h
framestate.c
gcc-compat.h
gccframe.h
get-rounding-mode.h
gmp-mparam.h
hp-timing-common.h
hp-timing.h
ifreq.h
ifunc-sel.h
intr-msg.h
inttypes.h
ld.abilist
ldconfig.h
ldsodefs.h
libanl.abilist
libBrokenLocale.abilist
libc-lock.h
libc-mmap.h
libc-tsd.h
libc.abilist
libcidn.abilist
libcrypt.abilist
libdl.abilist
libm-test-ulps
libm.abilist
libnsl.abilist
libnss_compat.abilist
libnss_db.abilist
libnss_dns.abilist
libnss_files.abilist
libnss_hesiod.abilist
libnss_nis.abilist
libnss_nisplus.abilist
libpthread.abilist
libresolv.abilist
librt.abilist
libutil.abilist
linkmap.h
local-setxid.h
localplt.data
machine-gmon.h
machine-lock.h
machine-sp.h
Makefile
malloc-machine.h
malloc-sysdep.h
math_ldbl_opt.h
math_ldbl.h
math_private.h
math-tests-arch.h
math-tests.h
memcopy.h
memusage.h
not-cancel.h
nscd-types.h
pagecopy.h
paths.h
profil-counter.h
pty-private.h
register-dump.h
rtld-lowlevel.h
safe-fatal.h
sigcontextinfo.h
siglist.h
sigset-cvt-mask.h
stackguard-macros.h
stackinfo.h
stdint.h
stdio-lock.h
string_private.h
symbol-hacks.h
sysdep-cancel.h
sysdep.h
thread_state.h
tininess.h
tls-macros.h
tls.h
tst-audit.h
tst-stack-align.h
unsecvars.h
unwind-dw2-fde-glibc.c
unwind-dw2-fde.c
unwind-dw2-fde.h
unwind-dw2.c
unwind-pe.c
unwind-pe.h
unwind-resume.h
unwind.h
utmp-equal.h