aboutsummaryrefslogtreecommitdiff
path: root/gdb/nlmread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/nlmread.c')
-rw-r--r--gdb/nlmread.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/nlmread.c b/gdb/nlmread.c
index 218f293..79dcfe3 100644
--- a/gdb/nlmread.c
+++ b/gdb/nlmread.c
@@ -119,21 +119,27 @@ nlm_symtab_read (abfd, addr, objfile)
CORE_ADDR addr;
struct objfile *objfile;
{
- unsigned int storage_needed;
+ long storage_needed;
asymbol *sym;
asymbol **symbol_table;
- unsigned int number_of_symbols;
- unsigned int i;
+ long number_of_symbols;
+ long i;
struct cleanup *back_to;
CORE_ADDR symaddr;
enum minimal_symbol_type ms_type;
- storage_needed = get_symtab_upper_bound (abfd);
+ 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);
back_to = make_cleanup (free, symbol_table);
number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
+ if (number_of_symbols < 0)
+ error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
+ bfd_errmsg (bfd_get_error ()));
for (i = 0; i < number_of_symbols; i++)
{