]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
x86-64: Never make R_X86_64_GOT64 section relative
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 19 Sep 2024 21:37:04 +0000 (05:37 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 20 Sep 2024 21:52:53 +0000 (05:52 +0800)
commit68d5dbd315d5e4a1675e430fd9a9553a523f79d3
treef1d71584f9aa19756d09abf972f43e18e43fb290
parentd77d08180d195a60193e9b35b6d08036caa55c70
x86-64: Never make R_X86_64_GOT64 section relative

R_X86_64_GOT64 relocation should never be made section relative.  Change
tc_i386_fix_adjustable to return 0 for BFD_RELOC_X86_64_GOT64.

gas/

PR gas/32189
* config/tc-i386.c (tc_i386_fix_adjustable): Return 0 for
BFD_RELOC_X86_64_GOT64.
* testsuite/gas/i386/reloc64.d: Updated.
* testsuite/gas/i386/reloc64.s: Add more tests for R_X86_64_GOT64
and R_X86_64_GOTOFF64.

ld/

PR gas/32189
* testsuite/ld-x86-64/x86-64.exp: Run PR gas/32189 test.
* testsuite/ld-x86-64/pr32189.s: New file.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 8015b1b0c1a1d3a581099c4855f95e4adfa3c0ad)
gas/config/tc-i386.c
gas/testsuite/gas/i386/reloc64.d
gas/testsuite/gas/i386/reloc64.s
ld/testsuite/ld-x86-64/pr32189.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp