]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Enable explicit reloc for extreme TLS GD/LD with -mexplicit-relocs=auto.
authorLulu Cheng <chenglulu@loongson.cn>
Fri, 26 Jan 2024 02:46:51 +0000 (10:46 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Fri, 2 Feb 2024 01:16:15 +0000 (09:16 +0800)
commit5fbd80223e15520038b81f6cce8d3d30d93b3502
treecf0bfa40548eda672b4ab9a38a365ec3603aca42
parentfa972949d0f45696f95fe098232083ef37cccea1
LoongArch: Enable explicit reloc for extreme TLS GD/LD with -mexplicit-relocs=auto.

Binutils does not support relaxation using four instructions to obtain
symbol addresses

gcc/ChangeLog:

* config/loongarch/loongarch.cc (loongarch_explicit_relocs_p):
When the code model of the symbol is extreme and -mexplicit-relocs=auto,
the macro instruction loading symbol address is not applicable.
(loongarch_call_tls_get_addr): Adjust code.
(loongarch_legitimize_tls_address): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/explicit-relocs-extreme-auto-tls-ld-gd.c: New test.
* gcc.target/loongarch/explicit-relocs-medium-auto-tls-ld-gd.c: New test.
gcc/config/loongarch/loongarch.cc
gcc/testsuite/gcc.target/loongarch/explicit-relocs-extreme-auto-tls-ld-gd.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/explicit-relocs-medium-auto-tls-ld-gd.c [new file with mode: 0644]