glibc/sysdeps
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
..
aarch64 Remove atomic_compare_and_exchange_bool_rel. 2016-06-24 23:04:40 +03:00
alpha Remove atomic_compare_and_exchange_bool_rel. 2016-06-24 23:04:40 +03:00
arm Remove atomic_compare_and_exchange_bool_rel. 2016-06-24 23:04:40 +03:00
generic Treat STV_HIDDEN and STV_INTERNAL symbols as STB_LOCAL 2016-07-01 23:48:52 +01:00
gnu Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
hppa hppa: fix loading of global pointer in _start [BZ #20277] 2016-06-30 11:37:08 -04:00
i386 i686/multiarch: Regenerate ulps 2016-06-30 00:31:11 +02:00
ia64 elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h> 2016-06-20 14:31:40 +02:00
ieee754 Add nextup and nextdown math functions 2016-06-16 21:37:45 +05:30
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h> 2016-06-20 14:31:40 +02:00
mach elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h> 2016-06-20 14:31:40 +02:00
microblaze Remove atomic_compare_and_exchange_bool_rel. 2016-06-24 23:04:40 +03:00
mips MIPS: run tst-mode-switch-{1,2,3}.c using test-skeleton.c 2016-06-27 23:57:40 +02:00
nacl Add nextup and nextdown math functions 2016-06-16 21:37:45 +05:30
nios2 elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h> 2016-06-20 14:31:40 +02:00
nptl Increase fork signal safety for single-threaded processes [BZ #19703] 2016-05-12 15:26:55 +02:00
posix getaddrinfo: Convert from extend_alloca to struct scratch_buffer 2016-05-12 14:07:56 +02:00
powerpc powerpc: Add a POWER8-optimized version of sinf() 2016-06-30 16:08:49 -03:00
pthread Revert "aio: fix newp->running data race" 2016-05-04 15:52:30 +02:00
s390 elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h> 2016-06-20 14:31:40 +02:00
sh elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h> 2016-06-20 14:31:40 +02:00
sparc SPARC: fix nearbyint on sNaN input 2016-07-01 16:36:41 +02:00
tile Remove atomic_compare_and_exchange_bool_rel. 2016-06-24 23:04:40 +03:00
unix SPARC64: update localplt.data 2016-07-01 11:09:38 +02:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
x86 Fixed wrong vector sincos/sincosf ABI to have it compatible with 2016-07-01 14:15:38 +03:00
x86_64 Require binutils 2.24 to build x86-64 glibc [BZ #20139] 2016-07-01 06:03:05 -07:00