From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8407 invoked by alias); 14 Apr 2005 09:00:16 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 8198 invoked from network); 14 Apr 2005 09:00:09 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 14 Apr 2005 09:00:09 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j3E909IJ013051 for ; Thu, 14 Apr 2005 05:00:09 -0400 Received: from pobox.surrey.redhat.com (pobox.surrey.redhat.com [172.16.10.17]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j3E903O00891; Thu, 14 Apr 2005 05:00:03 -0400 Received: from [172.31.0.98] (vpnuser3.surrey.redhat.com [172.16.9.3]) by pobox.surrey.redhat.com (8.12.8/8.12.8) with ESMTP id j3E901kk017940; Thu, 14 Apr 2005 10:00:01 +0100 Message-ID: <425E30A9.40100@redhat.com> Date: Thu, 14 Apr 2005 09:00:00 -0000 From: Nick Clifton User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) MIME-Version: 1.0 To: "Zagorodnev, Grigory" CC: Stas Kiselev , binutils@sources.redhat.com Subject: Re: GAS References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------090602060809060707080205" X-SW-Source: 2005-04/txt/msg00361.txt.bz2 This is a multi-part message in MIME format. --------------090602060809060707080205 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 886 Hi Griogry, > Also there is a little problem with the patch: new command line option > has no affect on symbol table and local symbol table hashes because > routine parse_args gets called after symbol_begin in "as.c", where these > hashes allocated. Ah - good point. There was also a small problem with non-BFD assemblers in that the patch used the bfd_size_type. Therefore I am applying the attached patch to fix both of these problems. I checked - moving the parse_args before the symbol_begin does not appear to have any adverse effects. Cheers Nick gas/ChangeLog 2005-04-14 Nick Clifton * 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. --------------090602060809060707080205 Content-Type: text/plain; name="gas.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gas.patch" Content-length: 3872 Index: gas/as.c =================================================================== RCS file: /cvs/src/src/gas/as.c,v retrieving revision 1.59 diff -c -3 -p -r1.59 as.c *** gas/as.c 12 Apr 2005 08:42:38 -0000 1.59 --- gas/as.c 14 Apr 2005 08:56:36 -0000 *************** the GNU General Public License. This pr *** 885,891 **** case OPTION_HASH_TABLE_SIZE: { ! bfd_size_type new_size; new_size = strtoul (optarg, NULL, 0); if (new_size) --- 885,891 ---- case OPTION_HASH_TABLE_SIZE: { ! unsigned long new_size; new_size = strtoul (optarg, NULL, 0); if (new_size) *************** main (int argc, char ** argv) *** 1114,1123 **** #endif PROGRESS (1); symbol_begin (); frag_init (); subsegs_begin (); - parse_args (&argc, &argv); read_begin (); input_scrub_begin (); expr_begin (); --- 1114,1125 ---- #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 (); read_begin (); input_scrub_begin (); expr_begin (); Index: gas/hash.c =================================================================== RCS file: /cvs/src/src/gas/hash.c,v retrieving revision 1.14 diff -c -3 -p -r1.14 hash.c *** gas/hash.c 12 Apr 2005 08:42:38 -0000 1.14 --- gas/hash.c 14 Apr 2005 08:56:36 -0000 *************** struct hash_control { *** 73,92 **** switch --reduce-memory-overheads, or set to other values by using the --hash-size= switch. */ ! static unsigned int gas_hash_table_size = 65537; void ! set_gas_hash_table_size (unsigned int size) { gas_hash_table_size = size; } /* FIXME: This function should be amalgmated with bfd/hash.c:bfd_hash_set_default_size(). */ ! static unsigned int 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[] = { 1021, 4051, 8599, 16699, 65537 }; --- 73,92 ---- switch --reduce-memory-overheads, or set to other values by using the --hash-size= switch. */ ! static unsigned long gas_hash_table_size = 65537; void ! 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 long get_gas_hash_table_size (void) { /* Extend this prime list if you want more granularity of hash table size. */ ! static const unsigned long hash_size_primes[] = { 1021, 4051, 8599, 16699, 65537 }; *************** get_gas_hash_table_size (void) *** 107,115 **** struct hash_control * hash_new (void) { ! unsigned int size; struct hash_control *ret; - unsigned int alloc; size = get_gas_hash_table_size (); --- 107,115 ---- struct hash_control * hash_new (void) { ! unsigned long size; ! unsigned long alloc; struct hash_control *ret; size = get_gas_hash_table_size (); Index: gas/hash.h =================================================================== RCS file: /cvs/src/src/gas/hash.h,v retrieving revision 1.7 diff -c -3 -p -r1.7 hash.h *** gas/hash.h 12 Apr 2005 08:42:38 -0000 1.7 --- gas/hash.h 14 Apr 2005 08:56:36 -0000 *************** struct hash_control; *** 26,32 **** /* Set the size of the hash table used. */ ! void set_gas_hash_table_size (unsigned int); /* Create a hash table. This return a control block. */ --- 26,32 ---- /* Set the size of the hash table used. */ ! void set_gas_hash_table_size (unsigned long); /* Create a hash table. This return a control block. */ --------------090602060809060707080205--