aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-05 11:24:01 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-05 11:24:14 -0700
commit8b43e456886c5b3aaba1ef93195ed888b15de242 (patch)
tree971277b504081ef9ea170bcb1b26e1bf5e757d9d /ld
parent5eb5f85062a3d43bf449ded1b256d761d487f0d6 (diff)
downloadgdb-8b43e456886c5b3aaba1ef93195ed888b15de242.zip
gdb-8b43e456886c5b3aaba1ef93195ed888b15de242.tar.gz
gdb-8b43e456886c5b3aaba1ef93195ed888b15de242.tar.bz2
x86-64: Improve GOTPCREL relocation conversion
When GOTPCREL relocation conversion leads to relocation overflow, we may get a mysterious linker message, like relocation truncated to fit: R_X86_64_32S against symbol `foo' This patch changes the linker message to failed to convert GOTPCREL relocation; relink with --no-relax bfd/ * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec argument. Don't check relocation overflow. Avoid relocation overflow if --no-relax is used. Set converted_reloc on symbol if a GOTPCREL relocation is converted. (elf_x86_64_relocate_section): Issue a fatal error and suggest --no-relax if GOTPCREL relocation conversion leads to relocation overflow. * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc. ld/ * testsuite/ld-x86-64/pr19609-4e.d: Updated. * testsuite/ld-x86-64/pr19609-6a.d: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/testsuite/ld-x86-64/pr19609-4e.d4
-rw-r--r--ld/testsuite/ld-x86-64/pr19609-6a.d2
3 files changed, 8 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 1fbec40..983c471 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * testsuite/ld-x86-64/pr19609-4e.d: Updated.
+ * testsuite/ld-x86-64/pr19609-6a.d: Likewise.
+
2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22071
diff --git a/ld/testsuite/ld-x86-64/pr19609-4e.d b/ld/testsuite/ld-x86-64/pr19609-4e.d
index 527fe5d..f263494 100644
--- a/ld/testsuite/ld-x86-64/pr19609-4e.d
+++ b/ld/testsuite/ld-x86-64/pr19609-4e.d
@@ -9,5 +9,5 @@
Disassembly of section .text:
0+70000000 <_start>:
-[ ]*[a-f0-9]+: 48 8d 05 f9 ff ff 2f lea 0x2ffffff9\(%rip\),%rax # a0000000 <foo>
-[ ]*[a-f0-9]+: 4c 8d 1d f2 ff ff 2f lea 0x2ffffff2\(%rip\),%r11 # a0000000 <foo>
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov [-]?0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <.got>
+[ ]*[a-f0-9]+: 4c 8b 1d ([0-9a-f]{2} ){4} * mov [-]?0x[a-f0-9]+\(%rip\),%r11 # [a-f0-9]+ <.got>
diff --git a/ld/testsuite/ld-x86-64/pr19609-6a.d b/ld/testsuite/ld-x86-64/pr19609-6a.d
index 4802ffe..3c011d9 100644
--- a/ld/testsuite/ld-x86-64/pr19609-6a.d
+++ b/ld/testsuite/ld-x86-64/pr19609-6a.d
@@ -1,4 +1,4 @@
#source: pr19609-6.s
#as: --64 -mrelax-relocations=yes
#ld: -melf_x86_64 --defsym foobar=0x80000000
-#error: .*relocation truncated to fit: R_X86_64_32S .*
+#error: failed to convert GOTPCREL relocation; relink with --no-relax