aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-11-14 14:38:39 +0000
committerNick Clifton <nickc@redhat.com>2002-11-14 14:38:39 +0000
commit2f62977e683fd566b7060848e0857e74f501def6 (patch)
tree21bdaf435fc49ef53bb7b133be5f0dc4675ee130 /binutils/readelf.c
parent51908eee4e7c08a3349047c7b554865c1d8efa10 (diff)
downloadgdb-2f62977e683fd566b7060848e0857e74f501def6.zip
gdb-2f62977e683fd566b7060848e0857e74f501def6.tar.gz
gdb-2f62977e683fd566b7060848e0857e74f501def6.tar.bz2
Handle binaries with corrupt section or segment headers
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index f381e23..cbeb059 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -2886,6 +2886,8 @@ get_64bit_program_headers (file, program_headers)
return 1;
}
+/* Returns 1 if the program headers were loaded. */
+
static int
process_program_headers (file)
FILE * file;
@@ -2898,7 +2900,7 @@ process_program_headers (file)
{
if (do_segments)
printf (_("\nThere are no program headers in this file.\n"));
- return 1;
+ return 0;
}
if (do_segments && !do_header)
@@ -10053,11 +10055,18 @@ process_file (file_name)
return 1;
}
- process_section_headers (file);
+ if (! process_section_headers (file))
+ {
+ /* Without loaded section headers we
+ cannot process lots of things. */
+ do_unwind = do_version = do_dump = do_arch = 0;
- process_program_headers (file);
+ if (! do_using_dynamic)
+ do_syms = do_reloc = 0;
+ }
- process_dynamic_segment (file);
+ if (process_program_headers (file))
+ process_dynamic_segment (file);
process_relocs (file);