aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-07-27 22:04:23 +0000
committerMichael Snyder <msnyder@vmware.com>2007-07-27 22:04:23 +0000
commitd63388ff701ef7f579dad732b4ffb7c89b1758d5 (patch)
tree30d528882320851498075e7ec1cc1edb5b942d9f /bfd
parent50a39e971efc325abcb37c3fed453eaa6fee3b2f (diff)
downloadgdb-d63388ff701ef7f579dad732b4ffb7c89b1758d5.zip
gdb-d63388ff701ef7f579dad732b4ffb7c89b1758d5.tar.gz
gdb-d63388ff701ef7f579dad732b4ffb7c89b1758d5.tar.bz2
2007-07-27 Michael Snyder <msnyder@access-company.com>
* cofflink.c (coff_link_add_symbols): Return if count is zero.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog2
-rw-r--r--bfd/cofflink.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d8d371d..4f519a3 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,7 @@
2007-07-27 Michael Snyder <msnyder@access-company.com>
+ * cofflink.c (coff_link_add_symbols): Return if count is zero.
+
* coff-i386.c (coff_i386_rtype_to_howto): Off by one error.
* aoutx.h (slurp_symbol_table): Return if count == 0.
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index cdd5c51..c6ca559 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -302,6 +302,11 @@ coff_link_add_symbols (bfd *abfd,
bfd_byte *esym_end;
bfd_size_type amt;
+ symcount = obj_raw_syment_count (abfd);
+
+ if (symcount == 0)
+ return TRUE; /* Nothing to do. */
+
/* Keep the symbols during this function, in case the linker needs
to read the generic symbols in order to report an error message. */
keep_syms = obj_coff_keep_syms (abfd);
@@ -312,13 +317,11 @@ coff_link_add_symbols (bfd *abfd,
else
default_copy = TRUE;
- symcount = obj_raw_syment_count (abfd);
-
/* We keep a list of the linker hash table entries that correspond
to particular symbols. */
amt = symcount * sizeof (struct coff_link_hash_entry *);
sym_hash = bfd_zalloc (abfd, amt);
- if (sym_hash == NULL && symcount != 0)
+ if (sym_hash == NULL)
goto error_return;
obj_coff_sym_hashes (abfd) = sym_hash;