binutils/SOURCES/binutils-multiple-relocs-for-same-section.patch
2021-10-08 09:55:08 +00:00

24 lines
747 B
Diff

--- binutils.orig/bfd/elf.c 2019-09-10 10:57:33.391081672 +0100
+++ binutils-2.27/bfd/elf.c 2019-09-10 10:59:55.355010766 +0100
@@ -2324,9 +2324,18 @@ bfd_section_from_shdr (bfd *abfd, unsign
else
p_hdr = &esdt->rel.hdr;
- /* PR 17512: file: 0b4f81b7. */
+ /* PR 17512: file: 0b4f81b7.
+ Also see PR 24456, for a file which deliberately has two reloc
+ sections. */
if (*p_hdr != NULL)
- goto fail;
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%B: warning: multiple relocation sections for section %A \
+found - ignoring all but the first"),
+ abfd, target_sect);
+ goto success;
+ }
hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, sizeof (*hdr2));
if (hdr2 == NULL)
goto fail;