summaryrefslogtreecommitdiff
path: root/gcc/ada/s-expuns.ads
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-06-10 14:24:53 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-06-23 14:14:30 -0700
commitc7f33ddcb02f812fba400ce27afc9f34abb76e71 (patch)
tree0396e7208c685f6a324a5bb199d02409d7e97273 /gcc/ada/s-expuns.ads
parentd2e78ed5e8aa7b0cef5c56d4727360a9581c4cb7 (diff)
downloadgcc-hjl/no-plt/master.tar.gz
Call tls_get_addr via GOT for GNU TLS if possiblehjl/no-plt/master
There are extensions to x86-64 and i386 psABIs to call tls_get_addr via GOT. X86 assembler and linker in binutils 2.27 implemented call *__tls_get_addr@GOTPCREL(%rip) in 64-bit and call *___tls_get_addr@GOT(%reg) in 32-bit. We check if 32-bit x86 assembler and linker work with call *___tls_get_addr@GOT(%reg) as changes for x86-64 assembler and linker were made before 32-bit x86 assembler and linker. Since any integer register except EAX, which is used to pass parameter to ___tls_get_addr, and ESP, can be used as GOT base, a new register class, TLS_REGS, along with a new constraint, Yb, are added, improve register allocation for dynamic TLS patterns. gcc/ * configure.ac (calling ___tls_get_addr via GOT): New assembler/linker check. (HAVE_AS_IX86_TLS_GET_ADDR_GOT): New. Defined to 1 if 32-bit assembler and linker supports calling ___tls_get_addr via GOT. Otherise, defined to 0. * config.in: Regenerated. * configure: Likewise. * config/i386/constraints.md (Yb): New constraint. * config/i386/i386.h (reg_class): Add TLS_REGS. (REG_CLASS_NAMES): Add TLS_REGS. (REG_CLASS_CONTENTS): Likewise. * config/i386/i386.md (*tls_global_dynamic_32_gnu): Replace the b constraint with the Yb constraint. Call ___tls_get_addr via GOT for GNU TLS with -fno-plt if HAVE_AS_IX86_TLS_GET_ADDR_GOT is 1. (*tls_local_dynamic_base_32_gnu): Likewise. (*tls_global_dynamic_64_<mode>): Call _tls_get_addr via GOT for GNU TLS with -fno-plt if HAVE_AS_IX86_TLS_GET_ADDR_GOT is 1. (*tls_local_dynamic_base_64_<mode>): Likewise. gcc/testsuite/ * gcc.target/i386/noplt-gd-1.c: New test. * gcc.target/i386/noplt-gd-2.c: Likewise. * gcc.target/i386/noplt-gd-3.c: Likewise. * gcc.target/i386/noplt-ld-1.c: Likewise. * gcc.target/i386/noplt-ld-2.c: Likewise. * gcc.target/i386/noplt-ld-3.c: Likewise. * lib/target-supports.exp (check_effective_target_tls_get_addr_via_got): New.
Diffstat (limited to 'gcc/ada/s-expuns.ads')
0 files changed, 0 insertions, 0 deletions