Put back BFD_RELOC_X86_64_GOTPCREL in TC_FORCE_RELOCATION_LOCAL, which
was removed by
commit
56ceb5b5405af23eddd12e12d8ba849010120324
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Oct 22 04:49:20 2015 -0700
Add R_X86_64_[REX_]GOTPCRELX support to gas and ld
by accident.
+2018-12-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/pr23968
+ * config/tc-i386.h (TC_FORCE_RELOCATION_LOCAL): Put back
+ BFD_RELOC_X86_64_GOTPCREL.
+ * testsuite/gas/i386/i386.exp: Run x86-64-gotpcrel-2.
+ * testsuite/gas/i386/x86-64-gotpcrel-2.d: New file.
+ * testsuite/gas/i386/x86-64-gotpcrel-2.s: Likewise.
+ * testsuite/gas/i386/ilp32/x86-64-gotpcrel-2.d: Likewise.
+
2018-12-07 Jim Wilson <jimw@sifive.com>
PR gas/23956
(GENERIC_FORCE_RELOCATION_LOCAL (FIX) \
|| (FIX)->fx_r_type == BFD_RELOC_386_PLT32 \
|| (FIX)->fx_r_type == BFD_RELOC_386_GOTPC \
+ || (FIX)->fx_r_type == BFD_RELOC_X86_64_GOTPCREL \
|| (FIX)->fx_r_type == BFD_RELOC_X86_64_GOTPCRELX \
|| (FIX)->fx_r_type == BFD_RELOC_X86_64_REX_GOTPCRELX)
run_dump_test "x86-64-gotpcrel"
run_dump_test "x86-64-gotpcrel-no-relax"
+ run_dump_test "x86-64-gotpcrel-2"
run_dump_test "x86-64-addend"
run_dump_test "x86-64-nop-3"
--- /dev/null
+#source: ../x86-64-gotpcrel-2.s
+#as: --x32 -mrelax-relocations=no
+#objdump: -dwr
+#name: x86-64 (ILP32) gotpcrel (2)
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <foo>:
+ +[a-f0-9]+: 48 8b 05 00 00 00 00 mov 0x0\(%rip\),%rax # 7 <foo\+0x7> 3: R_X86_64_GOTPCREL foo-0x4
+#pass
--- /dev/null
+#as: -mrelax-relocations=no
+#objdump: -dwr
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <foo>:
+ +[a-f0-9]+: 48 8b 05 00 00 00 00 mov 0x0\(%rip\),%rax # 7 <foo\+0x7> 3: R_X86_64_GOTPCREL foo-0x4
+#pass
--- /dev/null
+ .text
+foo:
+ movq foo@GOTPCREL(%rip), %rax