This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Speed tweak for STABS handling
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Thu, 29 Dec 2005 10:34:03 +0000
- Subject: Speed tweak for STABS handling
Hi Guys,
I am applying the patch below to speed up the processing of large
links with file that include STABS debug information. The original
code only used a very small hash table for holding the STABS strings
and this quickly ends up being a performance bottle neck. The patch
changes the code so that the default hash table size is used
instead. Since this can be controlled from the linker command line
(via the --hash-size= switch) the user is now able to tune the stabs
string hash table size to match the job that they are running.
Cheers
Nick
bfd/ChangeLog
2005-12-29 Nick Clifton <nickc@redhat.com>
* stabs.c (_bfd_link_section_stabs): Use bfd_hash_table_init
rather than bfd_hash_table_init_n(...,251) so that the size of the
hash table can be controlled by the user.
Index: bfd/stabs.c
===================================================================
RCS file: /cvs/src/src/bfd/stabs.c,v
retrieving revision 1.24
diff -c -3 -p -r1.24 stabs.c
*** bfd/stabs.c 4 May 2005 15:53:39 -0000 1.24
--- bfd/stabs.c 29 Dec 2005 10:24:29 -0000
*************** _bfd_link_section_stabs (bfd *abfd,
*** 194,202 ****
goto error_return;
/* Make sure the first byte is zero. */
(void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
! if (! bfd_hash_table_init_n (&sinfo->includes,
! stab_link_includes_newfunc,
! 251))
goto error_return;
sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
if (sinfo->stabstr == NULL)
--- 194,201 ----
goto error_return;
/* Make sure the first byte is zero. */
(void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
! if (! bfd_hash_table_init (&sinfo->includes,
! stab_link_includes_newfunc))
goto error_return;
sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
if (sinfo->stabstr == NULL)