]> git.ipfire.org Git - thirdparty/gcc.git/commit
x86-64: Check R_X86_64_CODE_6_GOTTPOFF support
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 4 Feb 2024 15:46:35 +0000 (07:46 -0800)
committerH.J. Lu <(no_default)>
Fri, 23 Feb 2024 14:00:20 +0000 (06:00 -0800)
commit7f2cf0c45f4ba7df4277cde4b1b7493cfc49a89d
treefaeb706e7f45004131339e8fe42c1d669fd9f880
parent9266d9fce2ca8ec704b932e8af7ab04432772c44
x86-64: Check R_X86_64_CODE_6_GOTTPOFF support

If assembler and linker supports

add %reg1, name@gottpoff(%rip), %reg2

with R_X86_64_CODE_6_GOTTPOFF, we can generate it instead of

mov name@gottpoff(%rip), %reg2
add %reg1, %reg2

gcc/

* configure.ac (HAVE_AS_R_X86_64_CODE_6_GOTTPOFF): Defined as 1
if R_X86_64_CODE_6_GOTTPOFF is supported.
* config.in: Regenerated.
* configure: Likewise.
* config/i386/predicates.md (apx_ndd_add_memory_operand): Allow
UNSPEC_GOTNTPOFF if R_X86_64_CODE_6_GOTTPOFF is supported.

gcc/testsuite/

* gcc.target/i386/apx-ndd-tls-1b.c: New test.
* lib/target-supports.exp
(check_effective_target_code_6_gottpoff_reloc): New.
gcc/config.in
gcc/config/i386/predicates.md
gcc/configure
gcc/configure.ac
gcc/testsuite/gcc.target/i386/apx-ndd-tls-1b.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp