Increment

Alan Modra amodra@bigpond.net.au
Tue Jun 13 14:52:00 GMT 2006


On Wed, Jun 14, 2006 at 12:08:12AM +0930, Alan Modra wrote:
> On Tue, Jun 13, 2006 at 12:52:09PM +0200, Andreas Schwab wrote:
> > <ftp://ftp.suse.com/pub/people/schwab/hash-resize-test.tar.gz>
> 
> The sym table is being resized while an as-needed lib is being loaded.
> Some extra hash table state needs to be restored, table, size and
> count.

	* elflink.c (elf_link_add_object_symbols): Save and restore
	struct bfd_hash_table table, size and count fields for
	as-needed libs.

Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.218
diff -u -p -r1.218 elflink.c
--- bfd/elflink.c	12 Jun 2006 11:12:51 -0000	1.218
+++ bfd/elflink.c	13 Jun 2006 14:43:41 -0000
@@ -3080,6 +3080,9 @@ elf_link_add_object_symbols (bfd *abfd, 
   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, 
       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, 
       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;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list