]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
x86-64: Convert load to mov only for GOTPCRELX relocations
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 5 Dec 2020 02:54:47 +0000 (18:54 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 5 Dec 2020 03:10:20 +0000 (19:10 -0800)
commite539c8303ff871dda6ea95c5ec3da9ea6f3609ae
treec17751148babc30f91f13cd9bf8cd421543716bd
parent1e5bc321758530ae00c111e6a4af4b771d974346
x86-64: Convert load to mov only for GOTPCRELX relocations

Since converting load to mov needs to rewrite the REX byte and we don't
know if there is a REX byte with GOTPCREL relocation, do it only for
GOTPCRELX relocations.

bfd/

PR ld/27016
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Convert load
to mov only for GOTPCRELX relocations.

ld/

PR ld/27016
* testsuite/ld-x86-64/x86-64.exp: Run pr27016a and pr27016b.
* testsuite/ld-x86-64/pr27016a.d: New file.
* testsuite/ld-x86-64/pr27016a.s: Likewise.
* testsuite/ld-x86-64/pr27016b.d: Likewise.
* testsuite/ld-x86-64/pr27016b.s: Likewise.

(cherry picked from commit 7e45e7a9ab38ee904ca62ed9934e933fdb1d6e9c)
bfd/ChangeLog
bfd/elf64-x86-64.c
ld/ChangeLog
ld/testsuite/ld-x86-64/pr27016a.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr27016a.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr27016b.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr27016b.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp