glibc/sysdeps
Fangrui Song e555954e02 Revert "[AArch64][BZ #17711] Fix extern protected data handling"
This reverts commit 0910702c4d.

Say both a.so and b.so define protected data symbol `var` and the executable
copy relocates var.  ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA has strange
semantics: a.so accesses the copy in the executable while b.so accesses its
own.  This behavior requires that (a) the compiler emits GOT-generating
relocations (b) the linker produces GLOB_DAT instead of RELATIVE.

Without the ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA code, b.so's GLOB_DAT
will bind to the executable (normal behavior).

For aarch64 it makes sense to restore the original behavior and don't
pay the ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA cost.  The behavior is very
unlikely used by anyone.

* Clang code generator treats STV_PROTECTED the same way as STV_HIDDEN:
  no GOT-generating relocation in the first place.
* gold and lld reject copy relocation on a STV_PROTECTED symbol.
* Nowadays -fpie/-fpic modes are popular.  GCC/Clang's codegen uses
  GOT-generating relocation when accessing an default visibility
  external symbol which avoids copy relocation.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2022-05-23 13:37:05 -07:00
..
aarch64 Revert "[AArch64][BZ #17711] Fix extern protected data handling" 2022-05-23 13:37:05 -07:00
alpha rtld: Remove DL_ARGV_NOT_RELRO and make _dl_skip_args const 2022-05-17 10:14:03 +01:00
arc rtld: Remove DL_ARGV_NOT_RELRO and make _dl_skip_args const 2022-05-17 10:14:03 +01:00
arm rtld: Remove DL_ARGV_NOT_RELRO and make _dl_skip_args const 2022-05-17 10:14:03 +01:00
csky rtld: Remove DL_ARGV_NOT_RELRO and make _dl_skip_args const 2022-05-17 10:14:03 +01:00
generic elf: Optimize _dl_new_hash in dl-new-hash.h 2022-05-23 10:38:40 -05:00
gnu Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
hppa elf: Replace PI_STATIC_AND_HIDDEN with opposite HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 2022-04-26 09:26:22 -07:00
htl htl: Fix initializing the key lock 2022-02-14 19:29:02 +01:00
hurd hurd: Fix pthread_kill on exiting/ted thread 2022-01-15 15:11:54 +01:00
i386 i386: Regenerate ulps 2022-04-26 10:52:41 -04:00
ia64 rtld: Remove DL_ARGV_NOT_RELRO and make _dl_skip_args const 2022-05-17 10:14:03 +01:00
ieee754 math: Use builtin for ldbl-96 copysign 2022-04-07 14:54:14 -03:00
m68k m68k: Use an autoconf template to produce `preconfigure' 2022-05-13 17:07:23 +01:00
mach linux: Add P_PIDFD 2022-05-17 10:34:36 -03:00
microblaze elf: Replace PI_STATIC_AND_HIDDEN with opposite HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 2022-04-26 09:26:22 -07:00
mips MIPS: Use an autoconf template to produce `preconfigure' 2022-05-13 17:07:23 +01:00
nios2 rtld: Remove DL_ARGV_NOT_RELRO and make _dl_skip_args const 2022-05-17 10:14:03 +01:00
nptl nptl: Add backoff mechanism to spinlock loop 2022-05-09 14:38:40 -07:00
or1k elf: Replace PI_STATIC_AND_HIDDEN with opposite HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 2022-04-26 09:26:22 -07:00
posix gmon: Remove unused sprofil.c functions 2022-03-23 14:29:25 -03:00
powerpc powerpc32: Remove unused HAVE_PPC_SECURE_PLT 2022-05-02 08:55:36 -07:00
pthread nptl: Handle spurious EINTR when thread cancellation is disabled (BZ#29029) 2022-04-14 12:48:31 -03:00
riscv RISC-V: Use an autoconf template to produce `preconfigure' 2022-05-13 17:07:23 +01:00
s390 S390: Enable static PIE 2022-05-18 14:31:26 +02:00
sh elf: Replace PI_STATIC_AND_HIDDEN with opposite HIDDEN_VAR_NEEDS_DYNAMIC_RELOC 2022-04-26 09:26:22 -07:00
sparc rtld: Remove DL_ARGV_NOT_RELRO and make _dl_skip_args const 2022-05-17 10:14:03 +01:00
unix linux: Add tst-pidfd.c 2022-05-17 10:36:59 -03:00
wordsize-32 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
wordsize-64 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
x86 elf: Optimize _dl_new_hash in dl-new-hash.h 2022-05-23 10:38:40 -05:00
x86_64 x86_64: Remove bzero optimization 2022-05-16 09:36:06 -03:00