]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Disable explicit reloc for TLS LD/GD with -mexplicit-relocs=auto
authorXi Ruoyao <xry111@xry111.site>
Mon, 22 Jan 2024 10:07:42 +0000 (18:07 +0800)
committerXi Ruoyao <xry111@xry111.site>
Tue, 23 Jan 2024 08:01:59 +0000 (16:01 +0800)
commitf12317306ee714aed0ca7ed01cafa520296b4c4c
tree189833cea00449a684fe52e7eb98791c9e94b893
parent23ebb09ed2e88c1f292d4232c1fd2974cc5c79e6
LoongArch: Disable explicit reloc for TLS LD/GD with -mexplicit-relocs=auto

Binutils 2.42 supports TLS LD/GD relaxation which requires the assembler
macro.

gcc/ChangeLog:

* config/loongarch/loongarch.cc (loongarch_explicit_relocs_p):
If la_opt_explicit_relocs is EXPLICIT_RELOCS_AUTO, return false
for SYMBOL_TLS_LDM and SYMBOL_TLS_GD.
(loongarch_call_tls_get_addr): Do not split symbols of
SYMBOL_TLS_LDM or SYMBOL_TLS_GD if la_opt_explicit_relocs is
EXPLICIT_RELOCS_AUTO.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/explicit-relocs-auto-tls-ld-gd.c: Check
for la.tls.ld and la.tls.gd.
gcc/config/loongarch/loongarch.cc
gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-tls-ld-gd.c