mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 00:59:15 +08:00
Bug 23142, SIGSEGV in is_strip_section
PR 23142 * objcopy.c (group_signature): Don't accept groups that use a symbol table other than the one we've read.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2018-05-07 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR 23142
|
||||||
|
* objcopy.c (group_signature): Don't accept groups that use a
|
||||||
|
symbol table other than the one we've read.
|
||||||
|
|
||||||
2018-04-30 Francois H. Theron <francois.theron@netronome.com>
|
2018-04-30 Francois H. Theron <francois.theron@netronome.com>
|
||||||
|
|
||||||
* readelf.c: Very basic support for EM_NFP and its section types.
|
* readelf.c: Very basic support for EM_NFP and its section types.
|
||||||
|
@ -1211,14 +1211,13 @@ group_signature (asection *group)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ghdr = &elf_section_data (group)->this_hdr;
|
ghdr = &elf_section_data (group)->this_hdr;
|
||||||
if (ghdr->sh_link < elf_numsections (abfd))
|
if (ghdr->sh_link == elf_onesymtab (abfd))
|
||||||
{
|
{
|
||||||
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
||||||
Elf_Internal_Shdr *symhdr = elf_elfsections (abfd) [ghdr->sh_link];
|
Elf_Internal_Shdr *symhdr = &elf_symtab_hdr (abfd);
|
||||||
|
|
||||||
if (symhdr->sh_type == SHT_SYMTAB
|
if (ghdr->sh_info > 0
|
||||||
&& ghdr->sh_info > 0
|
&& ghdr->sh_info < symhdr->sh_size / bed->s->sizeof_sym)
|
||||||
&& ghdr->sh_info < (symhdr->sh_size / bed->s->sizeof_sym))
|
|
||||||
return isympp[ghdr->sh_info - 1];
|
return isympp[ghdr->sh_info - 1];
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user