* readelf.c (process_file_header): Don't report a corrupt string

table index if it is zero.
This commit is contained in:
Alan Modra 2009-03-25 01:37:18 +00:00
parent 6d4796192d
commit 15ba6505cb
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2009-03-25 Ryan Mansfield <rmansfield@qnx.com>
* readelf.c (process_file_header): Don't report a corrupt string
table index if it is zero.
2009-03-19 H.J. Lu <hongjiu.lu@intel.com>
* dwarf.c (dwarf_regnames): Moved before frame_need_space.

View File

@ -3205,7 +3205,8 @@ process_file_header (void)
if (section_headers != NULL
&& elf_header.e_shstrndx == (SHN_XINDEX & 0xffff))
printf (" (%u)", section_headers[0].sh_link);
else if (elf_header.e_shstrndx >= elf_header.e_shnum)
else if (elf_header.e_shstrndx != SHN_UNDEF
&& elf_header.e_shstrndx >= elf_header.e_shnum)
printf (" <corrupt: out of range>");
putc ('\n', stdout);
}