summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-08-01 19:58:40 +0000
committerMichael Snyder <msnyder@vmware.com>2007-08-01 19:58:40 +0000
commitf8ccb868058e2c91edd3f4d393b8629ac1c5bd07 (patch)
tree567cc1e5fea13a31d3484cd9645774ffc70b4af9
parentf781cc5c4c688602701f1c92c8b2bdc594bed67c (diff)
downloadbinutils-redhat-f8ccb868058e2c91edd3f4d393b8629ac1c5bd07.tar.gz
2007-08-01 Michael Snyder <msnyder@access-company.com>
* aoutx.h (aout_link_add_symbols): Return if count is zero.
-rw-r--r--bfd/ChangeLog2
-rw-r--r--bfd/aoutx.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ea5ece5e8d..f8c3343bc9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,7 @@
2007-08-01 Michael Snyder <msnyder@access-company.com>
+ * aoutx.h (aout_link_add_symbols): Return if count is zero.
+
* elf.c (bfd_elf_print_symbol): Macro dereferences pointer, so
pointer must be non-null.
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 78b05943e4..1244510981 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -2959,13 +2959,16 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
return FALSE;
}
+ if (sym_count == 0)
+ return TRUE; /* Nothing to do. */
+
/* We keep a list of the linker hash table entries that correspond
to particular symbols. We could just look them up in the hash
table, but keeping the list is more efficient. Perhaps this
should be conditional on info->keep_memory. */
amt = sym_count * sizeof (struct aout_link_hash_entry *);
sym_hash = bfd_alloc (abfd, amt);
- if (sym_hash == NULL && sym_count != 0)
+ if (sym_hash == NULL)
return FALSE;
obj_aout_sym_hashes (abfd) = sym_hash;