From 012b2306cc5163b40c085a327e4b9c6ab1335ffa Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 8 May 2013 23:31:38 +0000 Subject: * elflink.c (elf_link_add_object_symbols): Don't omit reading of symbols when hashes already exist. --- bfd/elflink.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'bfd/elflink.c') diff --git a/bfd/elflink.c b/bfd/elflink.c index 43c54fc..34bbcd5 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -3699,20 +3699,23 @@ error_free_dyn: } sym_hash = elf_sym_hashes (abfd); - if (sym_hash == NULL && extsymcount != 0) + if (extsymcount != 0) { isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff, NULL, NULL, NULL); if (isymbuf == NULL) goto error_return; - /* We store a pointer to the hash table entry for each external - symbol. */ - amt = extsymcount * sizeof (struct elf_link_hash_entry *); - sym_hash = (struct elf_link_hash_entry **) bfd_zalloc (abfd, amt); if (sym_hash == NULL) - goto error_free_sym; - elf_sym_hashes (abfd) = sym_hash; + { + /* We store a pointer to the hash table entry for each + external symbol. */ + amt = extsymcount * sizeof (struct elf_link_hash_entry *); + sym_hash = (struct elf_link_hash_entry **) bfd_zalloc (abfd, amt); + if (sym_hash == NULL) + goto error_free_sym; + elf_sym_hashes (abfd) = sym_hash; + } } if (dynamic) -- cgit v1.1