This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: parallelized 'ld'?
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: DJ Delorie <dj at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 10 Jun 2004 10:58:54 +0930
- Subject: Re: parallelized 'ld'?
- References: <200307150234.h6F2YsNW028337@tully.CS.Berkeley.EDU> <87d6f63jes.fsf@muq.org> <200308261804.h7QI4VW26104@greed.delorie.com> <200406092352.i59NqGQw029088@greed.delorie.com>
On Wed, Jun 09, 2004 at 07:52:16PM -0400, DJ Delorie wrote:
> + fprintf(stderr, "dj: expand count %d size %d to %d\n", table->count, table->size, newsize);
You'd better remove the debug output. :)
> + newtable = ((struct bfd_hash_entry **)
> + objalloc_alloc ((struct objalloc *) table->memory, alloc));
> + memset ((PTR) newtable, 0, alloc);
No need for (PTR).
> + while (table->table[hi])
> + {
> + int index;
> + he = table->table[hi];
> + table->table[hi] = he->next;
> + index = he->hash % newsize;
> + he->next = newtable[index];
> + newtable[index] = he;
> + }
This will reverse entries with a duplicate key, won't it? I don't think
it matters at the moment, even though we have duplicates in the section
hash table, but it might cause a problem at some stage.
Hmm.
while (table->table[hi])
{
struct bfd_hash_entry *chain = table->table[hi];
struct bfd_hash_entry *chain_end = chain;
int index;
while (chain_end->next && chain_end->next->hash == chain->hash)
chain_end = chain_end->next;
table->table[hi] = chain_end->next;
index = chain->hash % newsize;
chain_end->next = newtable[index];
newtable[index] = chain;
}
--
Alan Modra
IBM OzLabs - Linux Technology Centre