]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Improve R_AARCH64_TLSDESC relocation.
authormmel <mmel@FreeBSD.org>
Sat, 15 Dec 2018 10:38:07 +0000 (10:38 +0000)
committermmel <mmel@FreeBSD.org>
Sat, 15 Dec 2018 10:38:07 +0000 (10:38 +0000)
commit4a03477e31e3541437e9700bfb50728454ebfe27
treec11599d43044ba540ed40e34c5d71afc2fb606b5
parentb838d6700ed4c08fecc748d189ee50496eea4fa5
Improve R_AARCH64_TLSDESC relocation.
The original code did not support dynamically loaded libraries and used
suboptimal access to TLS variables.
New implementation removes lazy resolving of TLS relocation - due to flaw
in TLSDESC design is impossible to switch resolver function at runtime
without expensive locking.

Due to this, 3 specialized resolvers are implemented:
 - load time resolver for TLS relocation from libraries loaded with main
   executable (thus with known TLS offset).
 - resolver for undefined thread weak symbols.
 - slower lazy resolver for dynamically loaded libraries with fast path for
   already resolved symbols.

PR: 228892, 232149, 233204, 232311
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18417
12 files changed:
libexec/rtld-elf/aarch64/reloc.c
libexec/rtld-elf/aarch64/rtld_start.S
libexec/rtld-elf/amd64/reloc.c
libexec/rtld-elf/arm/reloc.c
libexec/rtld-elf/i386/reloc.c
libexec/rtld-elf/mips/reloc.c
libexec/rtld-elf/powerpc/reloc.c
libexec/rtld-elf/powerpc64/reloc.c
libexec/rtld-elf/riscv/reloc.c
libexec/rtld-elf/rtld.c
libexec/rtld-elf/rtld.h
libexec/rtld-elf/sparc64/reloc.c