diff options
author | Nick Clifton <nickc@redhat.com> | 2005-04-12 08:42:41 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2005-04-12 08:42:41 +0000 |
commit | 4bdd3565f140b0555071cea0d917a6e1e1e16d23 (patch) | |
tree | 3a11fa3961a9b46622ee2e5ad1dd2ddec7cc0427 /gas/as.c | |
parent | f394e3dd2e2f699104a24e7ba2a486d2f2b79807 (diff) | |
download | gdb-4bdd3565f140b0555071cea0d917a6e1e1e16d23.zip gdb-4bdd3565f140b0555071cea0d917a6e1e1e16d23.tar.gz gdb-4bdd3565f140b0555071cea0d917a6e1e1e16d23.tar.bz2 |
* 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.
Diffstat (limited to 'gas/as.c')
-rw-r--r-- | gas/as.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -42,6 +42,7 @@ #include "macro.h" #include "dwarf2dbg.h" #include "dw2gencfi.h" +#include "hash.h" #ifdef BFD_ASSEMBLER #include "bfdver.h" @@ -292,6 +293,8 @@ Options:\n\ fprintf (stream, _("\ --gdwarf-2 generate DWARF2 debugging information\n")); fprintf (stream, _("\ + --hash-size=<value> set the hash table size close to <value>\n")); + fprintf (stream, _("\ --help show this message and exit\n")); fprintf (stream, _("\ --target-help show target specific options\n")); @@ -314,6 +317,10 @@ Options:\n\ fprintf (stream, _("\ -R fold data section into text section\n")); fprintf (stream, _("\ + --reduce-memory-overheads \n\ + prefer smaller memory use at the cost of longer\n\ + assembly times\n")); + fprintf (stream, _("\ --statistics print various measured statistics from execution\n")); fprintf (stream, _("\ --strip-local-absolute strip local absolute symbols\n")); @@ -426,6 +433,8 @@ parse_args (int * pargc, char *** pargv) OPTION_EXECSTACK, OPTION_NOEXECSTACK, OPTION_ALTERNATE, + OPTION_HASH_TABLE_SIZE, + OPTION_REDUCE_MEMORY_OVERHEADS, OPTION_WARN_FATAL /* When you add options here, check that they do not collide with OPTION_MD_BASE. See as.h. */ @@ -457,6 +466,7 @@ parse_args (int * pargc, char *** pargv) ,{"gen-debug", no_argument, NULL, 'g'} ,{"gstabs", no_argument, NULL, OPTION_GSTABS} ,{"gstabs+", no_argument, NULL, OPTION_GSTABS_PLUS} + ,{"hash-size", required_argument, NULL, OPTION_HASH_TABLE_SIZE} ,{"help", no_argument, NULL, OPTION_HELP} /* New option for extending instruction set (see also -t above). The "-t file" or "--itbl file" option extends the basic set of @@ -478,6 +488,7 @@ parse_args (int * pargc, char *** pargv) ,{"mri", no_argument, NULL, 'M'} ,{"nocpp", no_argument, NULL, OPTION_NOCPP} ,{"no-warn", no_argument, NULL, 'W'} + ,{"reduce-memory-overheads", no_argument, NULL, OPTION_REDUCE_MEMORY_OVERHEADS} ,{"statistics", no_argument, NULL, OPTION_STATISTICS} ,{"strip-local-absolute", no_argument, NULL, OPTION_STRIP_LOCAL_ABSOLUTE} ,{"version", no_argument, NULL, OPTION_VERSION} @@ -865,6 +876,24 @@ the GNU General Public License. This program has absolutely no warranty.\n")); case 'X': /* -X means treat warnings as errors. */ break; + + case OPTION_REDUCE_MEMORY_OVERHEADS: + /* The only change we make at the moment is to reduce + the size of the hash tables that we use. */ + set_gas_hash_table_size (4051); + break; + + case OPTION_HASH_TABLE_SIZE: + { + bfd_size_type new_size; + + new_size = strtoul (optarg, NULL, 0); + if (new_size) + set_gas_hash_table_size (new_size); + else + as_fatal (_("--hash-size needs a numeric argument")); + break; + } } } |