This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/binutils-2_30-branch] x86: Put back BFD_RELOC_X86_64_GOTPCREL
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 9 Dec 2018 15:35:50 -0000
- Subject: [binutils-gdb/binutils-2_30-branch] x86: Put back BFD_RELOC_X86_64_GOTPCREL
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e8d7a880074c2fe2d552e850e7d53d492a9f4827
commit e8d7a880074c2fe2d552e850e7d53d492a9f4827
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sun Dec 9 07:22:14 2018 -0800
x86: Put back BFD_RELOC_X86_64_GOTPCREL
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.
(cherry picked from commit 9f52eab6a7a69870c7b5907a20b0305f30dbf2ae)
Diff:
---
gas/ChangeLog | 10 ++++++++++
gas/config/tc-i386.h | 1 +
gas/testsuite/gas/i386/i386.exp | 1 +
gas/testsuite/gas/i386/ilp32/x86-64-gotpcrel-2.d | 13 +++++++++++++
gas/testsuite/gas/i386/x86-64-gotpcrel-2.d | 11 +++++++++++
gas/testsuite/gas/i386/x86-64-gotpcrel-2.s | 3 +++
6 files changed, 39 insertions(+)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 800cd69..95ed8e4 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+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-11-26 H.J. Lu <hongjiu.lu@intel.com>
PR gas/23854
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index 6e4f440..db2e0f7 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -174,6 +174,7 @@ extern int tc_i386_fix_adjustable (struct fix *);
(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)
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 40c5d12..7514da6 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -953,6 +953,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
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"
}
diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-gotpcrel-2.d b/gas/testsuite/gas/i386/ilp32/x86-64-gotpcrel-2.d
new file mode 100644
index 0000000..41b9ac2
--- /dev/null
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-gotpcrel-2.d
@@ -0,0 +1,13 @@
+#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
diff --git a/gas/testsuite/gas/i386/x86-64-gotpcrel-2.d b/gas/testsuite/gas/i386/x86-64-gotpcrel-2.d
new file mode 100644
index 0000000..3d07631
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-gotpcrel-2.d
@@ -0,0 +1,11 @@
+#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
diff --git a/gas/testsuite/gas/i386/x86-64-gotpcrel-2.s b/gas/testsuite/gas/i386/x86-64-gotpcrel-2.s
new file mode 100644
index 0000000..db5ddf5
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-gotpcrel-2.s
@@ -0,0 +1,3 @@
+ .text
+foo:
+ movq foo@GOTPCREL(%rip), %rax