This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PR5900: corrupt e_shstrndx
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Ryan Mansfield <rmansfield at qnx dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 25 Mar 2009 12:08:17 +1030
- Subject: Re: PR5900: corrupt e_shstrndx
- References: <49C93143.6040101@qnx.com>
On Tue, Mar 24, 2009 at 03:15:15PM -0400, Ryan Mansfield wrote:
> Index: readelf.c
> ===================================================================
> RCS file: /cvs/src/src/binutils/readelf.c,v
> retrieving revision 1.441
> diff -c -3 -p -r1.441 readelf.c
> *** readelf.c 19 Mar 2009 14:42:52 -0000 1.441
> --- readelf.c 24 Mar 2009 18:43:13 -0000
> *************** process_file_header (void)
> *** 3205,3211 ****
> 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)
> printf (" <corrupt: out of range>");
> putc ('\n', stdout);
> }
> --- 3205,3212 ----
> if (section_headers != NULL
> && elf_header.e_shstrndx == (SHN_XINDEX & 0xffff))
> printf (" (%u)", section_headers[0].sh_link);
> ! else if (elf_header.e_shstrndx != SHN_UNDEF
> ! && elf_header.e_shstrndx >= elf_header.e_shnum)
> printf (" <corrupt: out of range>");
> putc ('\n', stdout);
> }
Applied with this changelog
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.
--
Alan Modra
Australia Development Lab, IBM