x86-64: Properly set converted_reloc
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 5 Sep 2017 20:41:18 +0000 (13:41 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 5 Sep 2017 20:43:02 +0000 (13:43 -0700)
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
bfd/elf64-x86-64.c
ld/ChangeLog
ld/testsuite/ld-x86-64/pr19609-5d.d
ld/testsuite/ld-x86-64/pr19609-7a.d
ld/testsuite/ld-x86-64/pr19609-7c.d

index 551891d..7e98b61 100644 (file)
@@ -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
index ddbf133..bb47191 100644 (file)
@@ -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)".  */
index 983c471..7313795 100644 (file)
@@ -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.
 
index 959c63e..608c97b 100644 (file)
@@ -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
index d960572..015a6ff 100644 (file)
@@ -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
index 8bd919a..ff60049 100644 (file)
@@ -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