From 15ba6505cb90d69cbfb101cc5a96c398b714a1a2 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 25 Mar 2009 01:37:18 +0000 Subject: [PATCH] * readelf.c (process_file_header): Don't report a corrupt string table index if it is zero. --- binutils/ChangeLog | 5 +++++ binutils/readelf.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index e601e61a317..2338abbad20 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2009-03-25 Ryan Mansfield + + * readelf.c (process_file_header): Don't report a corrupt string + table index if it is zero. + 2009-03-19 H.J. Lu * dwarf.c (dwarf_regnames): Moved before frame_need_space. diff --git a/binutils/readelf.c b/binutils/readelf.c index c0c5beb5bec..d1dea7b339e 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -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 (" "); putc ('\n', stdout); } -- 2.30.2