* readelf.c (process_file_header): Don't report a corrupt string
authorAlan Modra <amodra@gmail.com>
Wed, 25 Mar 2009 01:37:18 +0000 (01:37 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 25 Mar 2009 01:37:18 +0000 (01:37 +0000)
table index if it is zero.

binutils/ChangeLog
binutils/readelf.c

index e601e61a3172d73e1759ea7aa8b144e2c2163cf7..2338abbad20c79f2a1b39bb7c557a3f4210c6596 100644 (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.
index c0c5beb5bec8a1af5d74dd9810f242a79f634bc3..d1dea7b339e2e1fa663cf062ac6de23edd2d04cf 100644 (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);
     }