aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-03-17 19:06:32 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-03-17 19:06:32 +0000
commit9d61147ec534c032a4099913a4836e85dfc51938 (patch)
treedbb00bb04de567c511cbd20a72b3dca9e0d7089a
parent8b4a5fafe19d9bdd9a3fc36d0adf2c3d1e6f7d3d (diff)
downloadgdb-9d61147ec534c032a4099913a4836e85dfc51938.zip
gdb-9d61147ec534c032a4099913a4836e85dfc51938.tar.gz
gdb-9d61147ec534c032a4099913a4836e85dfc51938.tar.bz2
* xcoffread.c (xcoff_symfile_read): Only read stringtab and
debugsec if there are a non-zero number of symbols.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/xcoffread.c17
2 files changed, 15 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bb0e931..4da4f8b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+Wed Mar 17 09:46:31 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * xcoffread.c (xcoff_symfile_read): Only read stringtab and
+ debugsec if there are a non-zero number of symbols.
+
Tue Mar 16 15:18:17 1993 Jim Kingdon (kingdon@cygnus.com)
* xcoffexec.c (add_vmap): Wrap symbol read in catch_errors.
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index a50b67a..84be25f 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -2257,14 +2257,17 @@ xcoff_symfile_read (objfile, section_offset, mainline)
error("\"%s\": error reading line numbers\n", name);
}
- val = init_stringtab(abfd, stringtab_offset, objfile);
- if (val < 0) {
- error ("\"%s\": can't get string table", name);
- }
+ if (num_symbols > 0)
+ {
+ val = init_stringtab(abfd, stringtab_offset, objfile);
+ if (val < 0) {
+ error ("\"%s\": can't get string table", name);
+ }
- if (init_debugsection(abfd) < 0) {
- error ("Error reading .debug section of `%s'\n", name);
- }
+ if (init_debugsection(abfd) < 0) {
+ error ("Error reading .debug section of `%s'\n", name);
+ }
+ }
/* Position to read the symbol table. Do not read it all at once. */
val = bfd_seek(abfd, symtab_offset, L_SET);