aboutsummaryrefslogtreecommitdiff
path: root/gas/as.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-10-01 19:31:06 +0000
committerIan Lance Taylor <ian@airs.com>1996-10-01 19:31:06 +0000
commitbfc94743ea0a885386652f34be93bcbc40e12f11 (patch)
tree0612f98284748121ae81d012932eb59fd30b2ea6 /gas/as.c
parent01b1f5eb29f9190554ec47548be2c46551675854 (diff)
downloadgdb-bfc94743ea0a885386652f34be93bcbc40e12f11.zip
gdb-bfc94743ea0a885386652f34be93bcbc40e12f11.tar.gz
gdb-bfc94743ea0a885386652f34be93bcbc40e12f11.tar.bz2
* as.c (show_usage): Print bug report address.
(parse_args): Change version printing to match current GNU standards. * gasp.c (show_usage): Print bug report address. (main): Change version printing to match current GNU standards.
Diffstat (limited to 'gas/as.c')
-rw-r--r--gas/as.c59
1 files changed, 52 insertions, 7 deletions
diff --git a/gas/as.c b/gas/as.c
index 4062f62..21caa20 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -15,8 +15,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
/*
* Main program for AS; a 32-bit assembler of GNU.
@@ -44,6 +45,12 @@
#include "sb.h"
#include "macro.h"
+#ifdef HAVE_SBRK
+#ifdef NEED_DECLARATION_SBRK
+extern PTR sbrk ();
+#endif
+#endif
+
static void perform_an_assembly_pass PARAMS ((int argc, char **argv));
static int macro_expr PARAMS ((const char *, int, sb *, int *));
@@ -67,6 +74,17 @@ int chunksize = 5000;
Then the chunk sizes for gas and bfd will be reduced. */
int debug_memory = 0;
+/* We build a list of defsyms as we read the options, and then define
+ them after we have initialized everything. */
+
+struct defsym_list
+{
+ struct defsym_list *next;
+ char *name;
+ valueT value;
+};
+
+static struct defsym_list *defsyms;
void
print_version_id ()
@@ -121,6 +139,8 @@ Options:\n\
-Z generate object file even after errors\n");
md_show_usage (stream);
+
+ fprintf (stream, "\nReport bugs to bug-gnu-utils@prep.ai.mit.edu\n");
}
#ifdef USE_EMULATIONS
@@ -351,7 +371,14 @@ parse_args (pargc, pargv)
break;
case OPTION_VERSION:
- print_version_id ();
+ /* This output is intended to follow the GNU standards document. */
+ printf ("GNU assembler %s\n", GAS_VERSION);
+ printf ("Copyright 1996 Free Software Foundation, Inc.\n");
+ printf ("\
+This program is free software; you may redistribute it under the terms of\n\
+the GNU General Public License. This program has absolutely no warranty.\n");
+ printf ("This assembler was configured for a target of `%s'.\n",
+ TARGET_ALIAS);
exit (EXIT_SUCCESS);
case OPTION_EMULATION:
@@ -379,7 +406,7 @@ parse_args (pargc, pargv)
{
char *s;
long i;
- symbolS *sym;
+ struct defsym_list *n;
for (s = optarg; *s != '\0' && *s != '='; s++)
;
@@ -387,9 +414,11 @@ parse_args (pargc, pargv)
as_fatal ("bad defsym; format is --defsym name=value");
*s++ = '\0';
i = strtol (s, (char **) NULL, 0);
- sym = symbol_new (optarg, absolute_section, (valueT) i,
- &zero_address_frag);
- symbol_table_insert (sym);
+ n = (struct defsym_list *) xmalloc (sizeof *n);
+ n->next = defsyms;
+ n->name = optarg;
+ n->value = i;
+ defsyms = n;
}
break;
@@ -585,6 +614,22 @@ main (argc, argv)
tc_init_after_args ();
#endif
+ /* Now that we have fully initialized, and have created the output
+ file, define any symbols requested by --defsym command line
+ arguments. */
+ while (defsyms != NULL)
+ {
+ symbolS *sym;
+ struct defsym_list *next;
+
+ sym = symbol_new (defsyms->name, absolute_section, defsyms->value,
+ &zero_address_frag);
+ symbol_table_insert (sym);
+ next = defsyms->next;
+ free (defsyms);
+ defsyms = next;
+ }
+
PROGRESS (1);
perform_an_assembly_pass (argc, argv); /* Assemble it. */