From 9d61147ec534c032a4099913a4836e85dfc51938 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Wed, 17 Mar 1993 19:06:32 +0000 Subject: [PATCH] * xcoffread.c (xcoff_symfile_read): Only read stringtab and debugsec if there are a non-zero number of symbols. --- gdb/ChangeLog | 5 +++++ gdb/xcoffread.c | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bb0e931996f..4da4f8bfb32 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 a50b67a8122..84be25fb196 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); -- 2.30.2