gold: Convert x86-64 GOTPCRELX only if addend == -4
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 29 Nov 2020 14:00:37 +0000 (06:00 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 29 Nov 2020 14:00:50 +0000 (06:00 -0800)
commit568cbddc710f6cb6be752f390a1521cd5556ad9b
tree8953d9b7c53cab14e7bc302a3bf66524dcb3686f
parent8ca751ee637ce1b8d1b284a794ffdb327951d0f8
gold: Convert x86-64 GOTPCRELX only if addend == -4

Convert x86-64 GOTPCRELX relocations only if addend == -4.

PR gold/26939
* x86_64.cc (Target_x86_64<size>::Scan::local): Check
get_r_addend() == -4 for GOTPCRELX conversion.
(Target_x86_64<size>::Scan::global): Likewise.
(Target_x86_64<size>::Relocate::relocate): Likewise.
* testsuite/Makefile.am (check_DATA): Add
x86_64_mov_to_lea15.stdout and x86_64_mov_to_lea16.stdout.
(MOSTLYCLEANFILES): Add x86_64_mov_to_lea15 and
x86_64_mov_to_lea16.
(x86_64_mov_to_lea9.o): New target.
(x86_64_mov_to_lea10.o): Likewise.
(x86_64_mov_to_lea15): Likewise.
(x86_64_mov_to_lea16): Likewise.
(x86_64_mov_to_lea15.stdout): Likewise.
(x86_64_mov_to_lea16.stdout): Likewise.
* testsuite/Makefile.in: Regenerated.
* testsuite/x86_64_mov_to_lea.sh: Updated.
* testsuite/x86_64_mov_to_lea5.s: New file.
gold/ChangeLog
gold/testsuite/Makefile.am
gold/testsuite/Makefile.in
gold/testsuite/x86_64_mov_to_lea.sh
gold/testsuite/x86_64_mov_to_lea5.s [new file with mode: 0644]
gold/x86_64.cc