mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 23:39:35 +08:00
Fix seg-fault in linker when applying relocs to a corrupt binary.
PR ld/20911 * ldctor.c (ldctor_build_sets): Produce alternative error message if the reloc was being applied to a special section.
This commit is contained in:
@ -1,5 +1,9 @@
|
|||||||
2016-12-02 Nick Clifton <nickc@redhat.com>
|
2016-12-02 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR ld/20911
|
||||||
|
* ldctor.c (ldctor_build_sets): Produce alternative error message
|
||||||
|
if the reloc was being applied to a special section.
|
||||||
|
|
||||||
PR ld/20912
|
PR ld/20912
|
||||||
* emultempl/elf32.em (_place_orphan): Test for ELF format of the
|
* emultempl/elf32.em (_place_orphan): Test for ELF format of the
|
||||||
orphan before looking for the SHF_EXCLUDE flag.
|
orphan before looking for the SHF_EXCLUDE flag.
|
||||||
|
15
ld/ldctor.c
15
ld/ldctor.c
@ -290,10 +290,17 @@ ldctor_build_sets (void)
|
|||||||
p->reloc);
|
p->reloc);
|
||||||
if (howto == NULL)
|
if (howto == NULL)
|
||||||
{
|
{
|
||||||
einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
|
/* See PR 20911 for a reproducer. */
|
||||||
bfd_get_target (p->elements->section->owner),
|
if (p->elements->section->owner == NULL)
|
||||||
bfd_get_reloc_code_name (p->reloc),
|
einfo (_("%P%X: Special section %s does not support reloc %s for set %s\n"),
|
||||||
p->h->root.string);
|
bfd_get_section_name (link_info.output_bfd, p->elements->section),
|
||||||
|
bfd_get_reloc_code_name (p->reloc),
|
||||||
|
p->h->root.string);
|
||||||
|
else
|
||||||
|
einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
|
||||||
|
bfd_get_target (p->elements->section->owner),
|
||||||
|
bfd_get_reloc_code_name (p->reloc),
|
||||||
|
p->h->root.string);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user