+2021-02-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/19609
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Provide more
+ info when failed to convert GOTPCREL relocation.
+
2021-02-04 Nelson Chu <nelson.chu@sifive.com>
* elfxx-riscv.c (riscv_parse_prefixed_ext): Removed zb*.
Elf_Internal_Rela *wrel;
Elf_Internal_Rela *relend;
unsigned int plt_entry_size;
+ bfd_boolean status;
/* Skip if check_relocs failed. */
if (input_section->check_relocs_failed)
_bfd_x86_elf_set_tls_module_base (info);
+ status = TRUE;
rel = wrel = relocs;
relend = relocs + input_section->reloc_count;
for (; rel < relend; wrel++, rel++)
if (converted_reloc)
{
info->callbacks->einfo
- (_("%F%P: failed to convert GOTPCREL relocation; relink with --no-relax\n"));
- return FALSE;
+ ("%X%H:", input_bfd, input_section, rel->r_offset);
+ info->callbacks->einfo
+ (_(" failed to convert GOTPCREL relocation against "
+ "'%s'; relink with --no-relax\n"),
+ name);
+ status = FALSE;
+ continue;
}
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
input_section->reloc_count -= deleted;
}
- return TRUE;
+ return status;
}
/* Finish up dynamic symbol handling. We set the contents of various
+2021-02-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/19609
+ * testsuite/ld-x86-64/pr19609-2a.d: Updated.
+ * testsuite/ld-x86-64/pr19609-2b.d: Likewise.
+ * testsuite/ld-x86-64/pr19609-4a.d: Likewise.
+ * testsuite/ld-x86-64/pr19609-4c.d: Likewise.
+ * testsuite/ld-x86-64/pr19609-5d.d: Likewise.
+ * testsuite/ld-x86-64/pr19609-7a.d: Likewise.
+ * testsuite/ld-x86-64/pr19609-7c.d: Likewise.
+
2021-02-04 H.J. Lu <hongjiu.lu@intel.com>
PR ld/15146
#source: pr19609-2.s
#as: --64 -mrelax-relocations=yes
#ld: -melf_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000
-#error: failed to convert GOTPCREL relocation; relink with --no-relax
+#error: .*failed to convert GOTPCREL relocation against 'foo'; relink with --no-relax.*
#source: pr19609-2.s
#as: --x32 -mrelax-relocations=yes
#ld: -melf32_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000
-#error: failed to convert GOTPCREL relocation; relink with --no-relax
+#error: .*failed to convert GOTPCREL relocation against 'foo'; relink with --no-relax.*
#source: pr19609-4.s
#as: --64 -mrelax-relocations=yes
#ld: -melf_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000
-#error: failed to convert GOTPCREL relocation; relink with --no-relax
+#error: .*failed to convert GOTPCREL relocation against 'foo'; relink with --no-relax.*failed to convert GOTPCREL relocation against 'foo'; relink with --no-relax.*
#source: pr19609-4.s
#as: --64 -mrelax-relocations=yes
#ld: -melf_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000
-#error: failed to convert GOTPCREL relocation; relink with --no-relax
+#error: .*failed to convert GOTPCREL relocation against 'foo'; relink with --no-relax.*failed to convert GOTPCREL relocation against 'foo'; relink with --no-relax.*
#source: pr19609-5.s
#as: --64 -mrelax-relocations=yes
#ld: -melf_x86_64 -Ttext=0x80000000
-#error: failed to convert GOTPCREL relocation; relink with --no-relax
+#error: .*failed to convert GOTPCREL relocation against 'bar'; relink with --no-relax
#source: pr19609-7.s
#as: --64 -mrelax-relocations=yes
#ld: -melf_x86_64 -Ttext=0x80000000
-#error: failed to convert GOTPCREL relocation; relink with --no-relax
+#error: .*failed to convert GOTPCREL relocation against 'foobar'; relink with --no-relax
#source: pr19609-7.s
#as: --x32 -mrelax-relocations=yes
#ld: -melf32_x86_64 -Ttext=0x80000000
-#error: failed to convert GOTPCREL relocation; relink with --no-relax
+#error: .*failed to convert GOTPCREL relocation against 'foobar'; relink with --no-relax