From d63388ff701ef7f579dad732b4ffb7c89b1758d5 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Fri, 27 Jul 2007 22:04:23 +0000 Subject: 2007-07-27 Michael Snyder * cofflink.c (coff_link_add_symbols): Return if count is zero. --- bfd/cofflink.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bfd/cofflink.c') 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; -- cgit v1.1