aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-03-14 21:46:39 +0000
committerIan Lance Taylor <ian@airs.com>1997-03-14 21:46:39 +0000
commitf56d634e29f5c0a12dd4d49e769940bf325c9b3b (patch)
treeef418480b8da44b2dba1743c74021a1a5de7bb83 /bfd
parenta3ee56ec142fcee01de79be996bda7e3ad076605 (diff)
downloadgdb-f56d634e29f5c0a12dd4d49e769940bf325c9b3b.zip
gdb-f56d634e29f5c0a12dd4d49e769940bf325c9b3b.tar.gz
gdb-f56d634e29f5c0a12dd4d49e769940bf325c9b3b.tar.bz2
* elfcode.h (elf_slurp_symbol_table): Don't try to read the
version symbols if there aren't any.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfcode.h10
2 files changed, 11 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3d12e34..3043436 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+Fri Mar 14 16:43:22 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (elf_slurp_symbol_table): Don't try to read the
+ version symbols if there aren't any.
+
start-sanitize-tic80
Thu Mar 13 16:38:30 1997 Fred Fish <fnf@cygnus.com>
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 1320601..fe85d69 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -949,7 +949,10 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
else
{
hdr = &elf_tdata (abfd)->dynsymtab_hdr;
- verhdr = &elf_tdata (abfd)->dynversym_hdr;
+ if (elf_dynversym (abfd) == 0)
+ verhdr = NULL;
+ else
+ verhdr = &elf_tdata (abfd)->dynversym_hdr;
if ((elf_tdata (abfd)->dynverdef_section != 0
&& elf_tdata (abfd)->verdef == NULL)
|| (elf_tdata (abfd)->dynverref_section != 0
@@ -992,8 +995,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
/* Read the raw ELF version symbol information. */
- if (elf_dynversym (abfd) != 0
- && verhdr != NULL
+ if (verhdr != NULL
&& verhdr->sh_size / sizeof (Elf_External_Versym) != symcount)
{
(*_bfd_error_handler)
@@ -1013,7 +1015,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
goto error_return;
x_versymp = (Elf_External_Versym *) bfd_malloc (verhdr->sh_size);
- if (x_versymp == NULL && symcount != 0)
+ if (x_versymp == NULL && verhdr->sh_size != 0)
goto error_return;
if (bfd_read ((PTR) x_versymp, 1, verhdr->sh_size, abfd)