mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 12:23:31 +08:00
* elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link
field.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
1999-06-23 Ian Lance Taylor <ian@zembu.com>
|
||||||
|
|
||||||
|
* elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link
|
||||||
|
field.
|
||||||
|
|
||||||
1999-06-22 Ian Lance Taylor <ian@zembu.com>
|
1999-06-22 Ian Lance Taylor <ian@zembu.com>
|
||||||
|
|
||||||
From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>:
|
From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>:
|
||||||
|
@ -1201,6 +1201,15 @@ bfd_section_from_shdr (abfd, shindex)
|
|||||||
asection *target_sect;
|
asection *target_sect;
|
||||||
Elf_Internal_Shdr *hdr2;
|
Elf_Internal_Shdr *hdr2;
|
||||||
|
|
||||||
|
/* Check for a bogus link to avoid crashing. */
|
||||||
|
if (hdr->sh_link >= ehdr->e_shnum)
|
||||||
|
{
|
||||||
|
((*_bfd_error_handler)
|
||||||
|
(_("%s: invalid link %lu for reloc section %s (index %u)"),
|
||||||
|
bfd_get_filename (abfd), hdr->sh_link, name, shindex));
|
||||||
|
return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
|
||||||
|
}
|
||||||
|
|
||||||
/* For some incomprehensible reason Oracle distributes
|
/* For some incomprehensible reason Oracle distributes
|
||||||
libraries for Solaris in which some of the objects have
|
libraries for Solaris in which some of the objects have
|
||||||
bogus sh_link fields. It would be nice if we could just
|
bogus sh_link fields. It would be nice if we could just
|
||||||
|
Reference in New Issue
Block a user