aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Pettersson <mikpelinux@gmail.com>2020-09-17 10:45:39 +0100
committerNick Clifton <nickc@redhat.com>2020-09-17 10:45:39 +0100
commitdd80eb2cff5c415a6623e144119010917922d1f7 (patch)
tree6849a119d4d16edec7cd97deb70d85c94169332a
parentd2cd411356b0e6de58e502bf65c1683811b69af6 (diff)
downloadgdb-dd80eb2cff5c415a6623e144119010917922d1f7.zip
gdb-dd80eb2cff5c415a6623e144119010917922d1f7.tar.gz
gdb-dd80eb2cff5c415a6623e144119010917922d1f7.tar.bz2
Skip IFUNC relocations in debug sections ignored by ld.so. Fixes some ld test failures on sparc-linux-gnu.
PR ld/18808 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Skip IFUNC relocations in debug sections, change abort to _bfd_error_handler.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfxx-sparc.c20
2 files changed, 25 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 75904fe..66463bd 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2020-09-17 Mikael Pettersson <mikpelinux@gmail.com>
+
+ PR ld/18808
+ * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Skip IFUNC
+ relocations in debug sections, change abort to _bfd_error_handler.
+
2020-09-16 H.J. Lu <hongjiu.lu@intel.com>
PR ld/26583
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 273789e..be82612 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -2904,7 +2904,25 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
STT_GNU_IFUNC symbol as STT_FUNC. */
if (elf_section_type (input_section) == SHT_NOTE)
goto skip_ifunc;
- abort ();
+
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING
+ sections because such sections are not SEC_ALLOC and
+ thus ld.so will not process them. */
+ if ((input_section->flags & SEC_ALLOC) == 0
+ && (input_section->flags & SEC_DEBUGGING) != 0)
+ continue;
+
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB(%pA+%#" PRIx64 "): "
+ "unresolvable %s relocation against symbol `%s'"),
+ input_bfd,
+ input_section,
+ (uint64_t) rel->r_offset,
+ howto->name,
+ h->root.root.string);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
}
plt_sec = htab->elf.splt;