There are extensions to x86-64 psABI: https://groups.google.com/forum/#!topic/x86-64-abi/de5_KnLHxtI and i386 psABI: https://groups.google.com/forum/#!topic/ia32-abi/awsRSvJOJfs 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 to access global and local thread loal variables in shared library. We check if 32-bit x86 assembler and linker work with call *___tls_get_addr@GOT(%reg) as 32-bit and 64-bit assembler and linker are enabled togther. In 32-bit, 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_GOTBASE_REGS, along with a new constraint, Yb, are added. They are used to improve register allocation for 32-bit 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_GOTBASE_REGS. (REG_CLASS_NAMES): Likewise. (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. From-SVN: r237765
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| asan-dg.exp | Loading commit data... | |
| atomic-dg.exp | Loading commit data... | |
| c-compat.exp | Loading commit data... | |
| c-torture.exp | Loading commit data... | |
| cilk-plus-dg.exp | Loading commit data... | |
| clearcap.exp | Loading commit data... | |
| compat.exp | Loading commit data... | |
| copy-file.exp | Loading commit data... | |
| dejapatches.exp | Loading commit data... | |
| dg-pch.exp | Loading commit data... | |
| file-format.exp | Loading commit data... | |
| fortran-modules.exp | Loading commit data... | |
| fortran-torture.exp | Loading commit data... | |
| g++-dg.exp | Loading commit data... | |
| g++.exp | Loading commit data... | |
| gcc-defs.exp | Loading commit data... | |
| gcc-dg.exp | Loading commit data... | |
| gcc-gdb-test.exp | Loading commit data... | |
| gcc-simulate-thread.exp | Loading commit data... | |
| gcc.exp | Loading commit data... | |
| gcov.exp | Loading commit data... | |
| gfortran-dg.exp | Loading commit data... | |
| gfortran.exp | Loading commit data... | |
| gnat-dg.exp | Loading commit data... | |
| gnat.exp | Loading commit data... | |
| go-dg.exp | Loading commit data... | |
| go-torture.exp | Loading commit data... | |
| go.exp | Loading commit data... | |
| lto.exp | Loading commit data... | |
| mike-g++.exp | Loading commit data... | |
| mike-gcc.exp | Loading commit data... | |
| mpx-dg.exp | Loading commit data... | |
| multiline.exp | Loading commit data... | |
| obj-c++-dg.exp | Loading commit data... | |
| obj-c++.exp | Loading commit data... | |
| objc-dg.exp | Loading commit data... | |
| objc-torture.exp | Loading commit data... | |
| objc.exp | Loading commit data... | |
| options.exp | Loading commit data... | |
| plugin-support.exp | Loading commit data... | |
| profopt.exp | Loading commit data... | |
| prune.exp | Loading commit data... | |
| scanasm.exp | Loading commit data... | |
| scandump.exp | Loading commit data... | |
| scanipa.exp | Loading commit data... | |
| scanrtl.exp | Loading commit data... | |
| scantree.exp | Loading commit data... | |
| target-libpath.exp | Loading commit data... | |
| target-supports-dg.exp | Loading commit data... | |
| target-supports.exp | Loading commit data... | |
| target-utils.exp | Loading commit data... | |
| timeout-dg.exp | Loading commit data... | |
| timeout.exp | Loading commit data... | |
| torture-options.exp | Loading commit data... | |
| tsan-dg.exp | Loading commit data... | |
| ubsan-dg.exp | Loading commit data... | |
| wrapper.exp | Loading commit data... |