aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-01-26 09:59:30 +0000
committerNick Clifton <nickc@redhat.com>2012-01-26 09:59:30 +0000
commitfa1908fd5686efe41ad5d583b0e8a7555cca7c77 (patch)
tree1ee80009fe6150a23fccbd6fb4c1e40023bdc627 /binutils
parente078317b28df990d6b0d54020f364df44d1b9ce4 (diff)
downloadgdb-fa1908fd5686efe41ad5d583b0e8a7555cca7c77.zip
gdb-fa1908fd5686efe41ad5d583b0e8a7555cca7c77.tar.gz
gdb-fa1908fd5686efe41ad5d583b0e8a7555cca7c77.tar.bz2
PR binutils/13622
* readelf.c (process_section_groups): If there are no section headers do not scan for section groups. (process_note_sections): Likewise for note sections.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog7
-rw-r--r--binutils/readelf.c5
2 files changed, 10 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index a7ee38a..304da83 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,10 @@
+2012-01-26 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/13622
+ * readelf.c (process_section_groups): If there are no section
+ headers do not scan for section groups.
+ (process_note_sections): Likewise for note sections.
+
2012-01-20 Tristan Gingold <gingold@adacore.com>
* od-macho.c (OPT_SEG_SPLIT_INFO): New macro.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 502c76e..861b2c1 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -4961,7 +4961,8 @@ process_section_groups (FILE * file)
if (section_headers == NULL)
{
error (_("Section headers are not available!\n"));
- abort ();
+ /* PR 13622: This can happen with a corrupt ELF header. */
+ return 0;
}
section_headers_groups = (struct group **) calloc (elf_header.e_shnum,
@@ -13070,7 +13071,7 @@ process_note_sections (FILE * file)
int res = 1;
for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
+ i < elf_header.e_shnum && section != NULL;
i++, section++)
if (section->sh_type == SHT_NOTE)
res &= process_corefile_note_segment (file,