GAS

Nick Clifton nickc@redhat.com
Wed Apr 6 11:17:00 GMT 2005


Hi Grigory,

> Similar issue was reported against 'ld' 1.5 years ago. Simple change of
> default hash size from 4K to 64K gave 2x link time improvement.
> http://lists.gnu.org/archive/html/bug-gnu-utils/2003-08/msg00153.html
> 
> Thus the patch may look like this:
> 
> $ diff gas/hash.c.org gas/hash.c
> 
> 38c38
> < #define DEFAULT_SIZE (4051)
> ---
>>#define DEFAULT_SIZE (65537)

We might as well do this properly.  Please could you try the attached 
patch which as well as changing the default hash size adds two new 
switches: --hash-size=<NUMBER> and --reduce-memory-overheads which 
behave in much the same way as their linker namesakes.

If the patch works for you and there are no objections then I will apply 
it next week.

Cheers
   Nick

gas/ChangeLog

2005-04-06  Nick Clifton  <nickc@redhat.com>

	* hash.c (DEFAULT_SIZE): Delete.  Replace with:
	(gas_hash_table_size): New static variable.
	(set_gas_hash_table_size): New function:  Records a requested size
	for the hash tables.
	(get_gas_hash_table_size): New function: Return a prime number
	near the requested size of the hash table.
	(hash_new): Use get_gas_hash_table_size.
	* hash.h: Add a prototype for set_gas_hash_table_size.
	* as.c (show_usage): Add description of new switches: --hash-size
	and --reduce-memory-overheads.
	(option_values): Add OPTION_HASH_TABLE_SIZE and
	OPTION_REDUCE_MEMORY_OVERHEADS.
	(std_longpopts): Add entries for the new options.
	(parse_args): Handle the new options.
	* Makefile.am: Add a dependency of as.c on hash.h.
	* Makefile.in: Regenerate.
	* doc/as.texinfo: Document the new switches.
	* NEWS: Mention the new switches.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gas.hash-size.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20050406/d74878f3/attachment.ksh>


More information about the Binutils mailing list