From 4f87808cf30abce4230a81277a2ab88e5d831cfc Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 13 Jun 2006 14:49:54 +0000 Subject: [PATCH] * elflink.c (elf_link_add_object_symbols): Save and restore struct bfd_hash_table table, size and count fields for as-needed libs. --- bfd/ChangeLog | 6 ++++++ bfd/elflink.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8a369c8b38f..5090a01bdb2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2006-06-14 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Save and restore + struct bfd_hash_table table, size and count fields for + as-needed libs. + 2006-06-12 Thiemo Seufer * elf32-mips.c: Expand comment about ABI-mandated pagesize values. diff --git a/bfd/elflink.c b/bfd/elflink.c index f4c63f4366b..0a329633689 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -3080,6 +3080,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) struct elf_link_hash_table *htab; bfd_size_type amt; void *alloc_mark = NULL; + struct bfd_hash_entry **old_table = NULL; + unsigned int old_size = 0; + unsigned int old_count = 0; void *old_tab = NULL; void *old_hash; void *old_ent; @@ -3504,6 +3507,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) memcpy (old_hash, sym_hash, hashsize); old_undefs = htab->root.undefs; old_undefs_tail = htab->root.undefs_tail; + old_table = htab->root.table.table; + old_size = htab->root.table.size; + old_count = htab->root.table.count; old_dynsymcount = htab->dynsymcount; for (i = 0; i < htab->root.table.size; i++) @@ -4151,6 +4157,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) old_hash = (char *) old_tab + tabsize; old_ent = (char *) old_hash + hashsize; sym_hash = elf_sym_hashes (abfd); + htab->root.table.table = old_table; + htab->root.table.size = old_size; + htab->root.table.count = old_count; memcpy (htab->root.table.table, old_tab, tabsize); memcpy (sym_hash, old_hash, hashsize); htab->root.undefs = old_undefs; -- 2.30.2