This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: parallelized 'ld'?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]