diff options
author | Nick Clifton <nickc@redhat.com> | 2005-04-14 09:00:35 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2005-04-14 09:00:35 +0000 |
commit | f7a568eabfa46133c0bebd7af81704cd916e4152 (patch) | |
tree | a85da23139949df18b2028bc7875769801d6c94f | |
parent | 9e9b66a9565074bc875a2b2d01c628c58bca6bd5 (diff) | |
download | binutils-f7a568eabfa46133c0bebd7af81704cd916e4152.zip binutils-f7a568eabfa46133c0bebd7af81704cd916e4152.tar.gz binutils-f7a568eabfa46133c0bebd7af81704cd916e4152.tar.bz2 |
* as.c (main): Move parse_args before symbol_begin and frag_init so that the
hash table size can be set before it is used.
* hash.c: Use an unsigned long type for the size of the hash tables.
* hash.h (set_gas_hash_table_size): Update the prototype.
-rw-r--r-- | gas/ChangeLog | 8 | ||||
-rw-r--r-- | gas/as.c | 6 | ||||
-rw-r--r-- | gas/hash.c | 12 | ||||
-rw-r--r-- | gas/hash.h | 2 |
4 files changed, 19 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 58dc0a6..deab89a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2005-04-14 Nick Clifton <nickc@redhat.com> + + * as.c (main): Move parse_args before symbol_begin and frag_init + so that the hash table size can be set before it is used. + * hash.c: Use an unsigned long type for the size of the hash + tables. + * hash.h (set_gas_hash_table_size): Update the prototype. + 2005-04-14 Alan Modra <amodra@bigpond.net.au> * Makefile.am (NO_WERROR): Define. Use instead of -Wno-error. @@ -885,7 +885,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); case OPTION_HASH_TABLE_SIZE: { - bfd_size_type new_size; + unsigned long new_size; new_size = strtoul (optarg, NULL, 0); if (new_size) @@ -1114,10 +1114,12 @@ main (int argc, char ** argv) #endif PROGRESS (1); + /* Call parse_args before any of the init/begin functions + so that switches like --hash-size can be honored. */ + parse_args (&argc, &argv); symbol_begin (); frag_init (); subsegs_begin (); - parse_args (&argc, &argv); read_begin (); input_scrub_begin (); expr_begin (); @@ -73,20 +73,20 @@ struct hash_control { switch --reduce-memory-overheads, or set to other values by using the --hash-size=<NUMBER> switch. */ -static unsigned int gas_hash_table_size = 65537; +static unsigned long gas_hash_table_size = 65537; void -set_gas_hash_table_size (unsigned int size) +set_gas_hash_table_size (unsigned long size) { gas_hash_table_size = size; } /* FIXME: This function should be amalgmated with bfd/hash.c:bfd_hash_set_default_size(). */ -static unsigned int +static unsigned long get_gas_hash_table_size (void) { /* Extend this prime list if you want more granularity of hash table size. */ - static const unsigned int hash_size_primes[] = + static const unsigned long hash_size_primes[] = { 1021, 4051, 8599, 16699, 65537 }; @@ -107,9 +107,9 @@ get_gas_hash_table_size (void) struct hash_control * hash_new (void) { - unsigned int size; + unsigned long size; + unsigned long alloc; struct hash_control *ret; - unsigned int alloc; size = get_gas_hash_table_size (); @@ -26,7 +26,7 @@ struct hash_control; /* Set the size of the hash table used. */ -void set_gas_hash_table_size (unsigned int); +void set_gas_hash_table_size (unsigned long); /* Create a hash table. This return a control block. */ |