This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed, PATCH] x86-64: Properly set converted_reloc


Linker now generates

failed to convert GOTPCREL relocation; relink with --no-relax

for more cases.

bfd/

	* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
	converted_reloc.

ld/

	* testsuite/ld-x86-64/pr19609-5d.d: Updated.
	* testsuite/ld-x86-64/pr19609-7a.d: Likewise.
	* testsuite/ld-x86-64/pr19609-7c.d: Likewise.
---
 bfd/ChangeLog                       | 5 +++++
 bfd/elf64-x86-64.c                  | 2 +-
 ld/ChangeLog                        | 6 ++++++
 ld/testsuite/ld-x86-64/pr19609-5d.d | 2 +-
 ld/testsuite/ld-x86-64/pr19609-7a.d | 2 +-
 ld/testsuite/ld-x86-64/pr19609-7c.d | 2 +-
 6 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 551891d402..7e98b61c03 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
 2017-09-05  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
+	converted_reloc.
+
+2017-09-05  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* 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
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index ddbf1330e4..bb471911a9 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1597,10 +1597,10 @@ elf_x86_64_convert_load_reloc (bfd *abfd,
   if (no_overflow)
     return TRUE;
 
+convert:
   if (h != NULL)
     ((struct elf_x86_link_hash_entry *) h)->converted_reloc = 1;
 
-convert:
   if (opcode == 0xff)
     {
       /* We have "call/jmp *foo@GOTPCREL(%rip)".  */
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 983c471f7c..7313795848 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,11 @@
 2017-09-05  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* testsuite/ld-x86-64/pr19609-5d.d: Updated.
+	* testsuite/ld-x86-64/pr19609-7a.d: Likewise.
+	* testsuite/ld-x86-64/pr19609-7c.d: Likewise.
+
+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.
 
diff --git a/ld/testsuite/ld-x86-64/pr19609-5d.d b/ld/testsuite/ld-x86-64/pr19609-5d.d
index 959c63e3d0..608c97bd6b 100644
--- a/ld/testsuite/ld-x86-64/pr19609-5d.d
+++ b/ld/testsuite/ld-x86-64/pr19609-5d.d
@@ -1,4 +1,4 @@
 #source: pr19609-5.s
 #as: --64 -mrelax-relocations=yes
 #ld: -melf_x86_64 -Ttext=0x80000000
-#error: .*relocation truncated to fit: R_X86_64_PC32 .*
+#error: failed to convert GOTPCREL relocation; relink with --no-relax
diff --git a/ld/testsuite/ld-x86-64/pr19609-7a.d b/ld/testsuite/ld-x86-64/pr19609-7a.d
index d960572814..015a6ffd0a 100644
--- a/ld/testsuite/ld-x86-64/pr19609-7a.d
+++ b/ld/testsuite/ld-x86-64/pr19609-7a.d
@@ -1,4 +1,4 @@
 #source: pr19609-7.s
 #as: --64 -mrelax-relocations=yes
 #ld: -melf_x86_64 -Ttext=0x80000000
-#error: .*relocation truncated to fit: R_X86_64_PC32 .*
+#error: failed to convert GOTPCREL relocation; relink with --no-relax
diff --git a/ld/testsuite/ld-x86-64/pr19609-7c.d b/ld/testsuite/ld-x86-64/pr19609-7c.d
index 8bd919a8e4..ff600498d4 100644
--- a/ld/testsuite/ld-x86-64/pr19609-7c.d
+++ b/ld/testsuite/ld-x86-64/pr19609-7c.d
@@ -1,4 +1,4 @@
 #source: pr19609-7.s
 #as: --x32 -mrelax-relocations=yes
 #ld: -melf32_x86_64 -Ttext=0x80000000
-#error: .*relocation truncated to fit: R_X86_64_PC32 .*
+#error: failed to convert GOTPCREL relocation; relink with --no-relax
-- 
2.13.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]