binutils/
* readelf.c (get_file_header): Only read the first section header if e_shoff is non-zero. bfd/ * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies e_shnum == 0. Only read the first section header if e_shoff is non-zero. Don't consider e_shstrndx if there are no sections.
This commit is contained in:
parent
cc22880b3e
commit
7ece0d85fd
4 changed files with 46 additions and 24 deletions
|
@ -9711,12 +9711,15 @@ get_file_header (file)
|
|||
elf_header.e_shstrndx = BYTE_GET (ehdr64.e_shstrndx);
|
||||
}
|
||||
|
||||
/* There may be some extensions in the first section header. Don't
|
||||
bomb if we can't read it. */
|
||||
if (is_32bit_elf)
|
||||
get_32bit_section_headers (file, 1);
|
||||
else
|
||||
get_64bit_section_headers (file, 1);
|
||||
if (elf_header.e_shoff)
|
||||
{
|
||||
/* There may be some extensions in the first section header. Don't
|
||||
bomb if we can't read it. */
|
||||
if (is_32bit_elf)
|
||||
get_32bit_section_headers (file, 1);
|
||||
else
|
||||
get_64bit_section_headers (file, 1);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue