diff options
author | Peter Schauer <Peter.Schauer@mytum.de> | 1994-07-17 06:42:14 +0000 |
---|---|---|
committer | Peter Schauer <Peter.Schauer@mytum.de> | 1994-07-17 06:42:14 +0000 |
commit | 00306b1e9e2e19c5c8f3078f97dfd39a194a1ddc (patch) | |
tree | 9216f701bcf373c1a7bb867e0ea89cb26f93f4b3 /gdb/elfread.c | |
parent | 81794792b70c586ac669013efee4742a3d0c96ad (diff) | |
download | gdb-00306b1e9e2e19c5c8f3078f97dfd39a194a1ddc.zip gdb-00306b1e9e2e19c5c8f3078f97dfd39a194a1ddc.tar.gz gdb-00306b1e9e2e19c5c8f3078f97dfd39a194a1ddc.tar.bz2 |
* elfread.c (elf_symtab_read): Handle error return from
bfd_get_dynamic_symtab_upper_bound gracefully.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index 214197c..67ce608 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -264,12 +264,20 @@ elf_symtab_read (abfd, addr, objfile, dynamic) int stripped = (bfd_get_symcount (abfd) == 0); if (dynamic) - storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd); + { + storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd); + + /* Nothing to be done if there is no dynamic symtab. */ + if (storage_needed < 0) + return; + } else - storage_needed = bfd_get_symtab_upper_bound (abfd); - if (storage_needed < 0) - error ("Can't read symbols from %s: %s", bfd_get_filename (abfd), - bfd_errmsg (bfd_get_error ())); + { + storage_needed = bfd_get_symtab_upper_bound (abfd); + if (storage_needed < 0) + error ("Can't read symbols from %s: %s", bfd_get_filename (abfd), + bfd_errmsg (bfd_get_error ())); + } if (storage_needed > 0) { symbol_table = (asymbol **) xmalloc (storage_needed); |