From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22402 invoked by alias); 13 Jun 2006 14:49:12 -0000 Received: (qmail 22389 invoked by uid 22791); 13 Jun 2006 14:49:11 -0000 X-Spam-Check-By: sourceware.org Received: from omta05ps.mx.bigpond.com (HELO omta05ps.mx.bigpond.com) (144.140.83.195) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Jun 2006 14:49:10 +0000 Received: from grove.modra.org ([144.136.172.108]) by omta05ps.mx.bigpond.com with ESMTP id <20060613144906.URJO10328.omta05ps.mx.bigpond.com@grove.modra.org>; Tue, 13 Jun 2006 14:49:06 +0000 Received: by bubble.grove.modra.org (Postfix, from userid 500) id 86D6219209C; Wed, 14 Jun 2006 00:19:06 +0930 (CST) Date: Tue, 13 Jun 2006 14:52:00 -0000 From: Alan Modra To: binutils@sourceware.org, Andreas Schwab Subject: Re: Increment Message-ID: <20060613144906.GK32562@bubble.grove.modra.org> Mail-Followup-To: binutils@sourceware.org, Andreas Schwab References: <20060606030414.GH519@bubble.grove.modra.org> <20060612002124.GF32562@bubble.grove.modra.org> <20060612190517.GA12535@lucon.org> <20060613025846.GA15374@lucon.org> <20060613143812.GJ32562@bubble.grove.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060613143812.GJ32562@bubble.grove.modra.org> User-Agent: Mutt/1.4i X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00207.txt.bz2 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: > > > > 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