[PATCH] Fix elf-strtab.c performance problem
Alan Modra
amodra@bigpond.net.au
Tue Dec 18 01:40:00 GMT 2001
On Mon, Dec 17, 2001 at 07:04:16PM +0100, Jakub Jelinek wrote:
>
> * elf-strtab.c (struct elf_strtab_hash_entry): Add u.next.
> (last_eq): Remove.
> (_bfd_elf_strtab_finalize): Don't use a hash table for last
> character chains, instead use an array.
OK.
> + c = e->root.string[e->len - 2] & 0xff;
> + /* Put longest strings first. */
Errant comment?
Also, a slightly more tidy way to add to lists, but please yourself over
this suggestion:
struct elf_strtab_hash_entry **last_ptr[256];
.
.
for (i = 0; i < 256; i++)
last_ptr[i] = &last[i];
.
.
*last_ptr[i] = e;
last_ptr[i] = &e->next;
Alan
More information about the Binutils
mailing list