/* as.c - GAS main program.
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ the Free Software Foundation; either version 3, or (at your option)
any later version.
- GAS is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ GAS is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the 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
#ifdef HAVE_ITBL_CPU
#include "itbl-ops.h"
#else
-#define itbl_parse(itbl_file) 1
#define itbl_init()
#endif
#ifdef HAVE_SBRK
#ifdef NEED_DECLARATION_SBRK
-extern PTR sbrk ();
+extern void *sbrk ();
#endif
#endif
extern void gas_cgen_begin (void);
#endif
-/* Keep a record of the itbl files we read in. */
-struct itbl_file_list
-{
- struct itbl_file_list *next;
- char *name;
-};
-
/* We build a list of defsyms as we read the options, and then define
them after we have initialized everything. */
struct defsym_list
static struct defsym_list *defsyms;
+#ifdef HAVE_ITBL_CPU
+/* Keep a record of the itbl files we read in. */
+struct itbl_file_list
+{
+ struct itbl_file_list *next;
+ char *name;
+};
static struct itbl_file_list *itbl_files;
+#endif
static long start_time;
Sub-options [default hls]:\n\
c omit false conditionals\n\
d omit debugging directives\n\
+ g include general info\n\
h include high-level source\n\
l include assembly\n\
m include macro expansions\n\
fprintf (stream, _("\
-D produce assembler debugging messages\n"));
fprintf (stream, _("\
+ --debug-prefix-map OLD=NEW Map OLD to NEW in debug information\n"));
+ fprintf (stream, _("\
--defsym SYM=VAL define symbol SYM to given value\n"));
#ifdef USE_EMULATIONS
{
--warn don't suppress warnings\n"));
fprintf (stream, _("\
--fatal-warnings treat warnings as errors\n"));
+#ifdef HAVE_ITBL_CPU
fprintf (stream, _("\
--itbl INSTTBL extend instruction set to include instructions\n\
matching the specifications defined in file INSTTBL\n"));
+#endif
fprintf (stream, _("\
-w ignored\n"));
fprintf (stream, _("\
'v',
#endif
'w', 'X',
+#ifdef HAVE_ITBL_CPU
/* New option for extending instruction set (see also --itbl below). */
't', ':',
+#endif
'\0'
};
struct option *longopts;
OPTION_DUMPCONFIG,
OPTION_VERBOSE,
OPTION_EMULATION,
+ OPTION_DEBUG_PREFIX_MAP,
OPTION_DEFSYM,
- OPTION_INSTTBL,
OPTION_LISTING_LHS_WIDTH,
OPTION_LISTING_LHS_WIDTH2,
OPTION_LISTING_RHS_WIDTH,
,{"a", optional_argument, NULL, 'a'}
/* Handle -al=<FILE>. */
,{"al", optional_argument, NULL, OPTION_AL}
+ ,{"debug-prefix-map", required_argument, NULL, OPTION_DEBUG_PREFIX_MAP}
,{"defsym", required_argument, NULL, OPTION_DEFSYM}
,{"dump-config", no_argument, NULL, OPTION_DUMPCONFIG}
,{"emulation", required_argument, NULL, OPTION_EMULATION}
,{"gstabs+", no_argument, NULL, OPTION_GSTABS_PLUS}
,{"hash-size", required_argument, NULL, OPTION_HASH_TABLE_SIZE}
,{"help", no_argument, NULL, OPTION_HELP}
+#ifdef HAVE_ITBL_CPU
/* New option for extending instruction set (see also -t above).
The "-t file" or "--itbl file" option extends the basic set of
valid instructions by reading "file", a text file containing a
list of instruction formats. The additional opcodes and their
formats are added to the built-in set of instructions, and
mnemonics for new registers may also be defined. */
- ,{"itbl", required_argument, NULL, OPTION_INSTTBL}
+ ,{"itbl", required_argument, NULL, 't'}
+#endif
/* getopt allows abbreviations, so we do this to stop it from
treating -k as an abbreviation for --keep-locals. Some
ports use -k to enable PIC assembly. */
case OPTION_VERSION:
/* This output is intended to follow the GNU standards document. */
printf (_("GNU assembler %s\n"), BFD_VERSION_STRING);
- printf (_("Copyright 2007 Free Software Foundation, Inc.\n"));
+ printf (_("Copyright 2008 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"));
+the GNU General Public License version 3 or later.\n\
+This program has absolutely no warranty.\n"));
printf (_("This assembler was configured for a target of `%s'.\n"),
TARGET_ALIAS);
exit (EXIT_SUCCESS);
#endif
exit (EXIT_SUCCESS);
+ case OPTION_DEBUG_PREFIX_MAP:
+ add_debug_prefix_map (optarg);
+ break;
+
case OPTION_DEFSYM:
{
char *s;
}
break;
- case OPTION_INSTTBL:
+#ifdef HAVE_ITBL_CPU
case 't':
{
/* optarg is the name of the file containing the instruction
itbl_files->name);
}
break;
+#endif
case OPTION_DEPFILE:
start_dependencies (optarg);
case 'd':
listing |= LISTING_NODEBUG;
break;
+ case 'g':
+ listing |= LISTING_GENERAL;
+ break;
case 'h':
listing |= LISTING_HLL;
break;
#endif
}
-#ifndef OBJ_VMS
static void
close_output_file (void)
{
output_file_close (out_file_name);
}
-#endif
/* The interface between the macro code and gas expression handling. */
int
main (int argc, char ** argv)
{
+ char ** argv_orig = argv;
+
int macro_strip_at;
int keep_it;
input_scrub_begin ();
expr_begin ();
-#ifndef OBJ_VMS /* Does its own file handling. */
/* It has to be called after dump_statistics (). */
xatexit (close_output_file);
-#endif
if (flag_print_statistics)
xatexit (dump_statistics);
#endif
#ifdef OBJ_ELF
- create_obj_attrs_section ();
+ if (IS_ELF)
+ create_obj_attrs_section ();
#endif
#if defined OBJ_ELF || defined OBJ_MAYBE_ELF
if (keep_it)
write_object_file ();
+ fflush (stderr);
+
#ifndef NO_LISTING
- listing_print (listing_filename);
+ listing_print (listing_filename, argv_orig);
#endif
if (flag_fatal_warnings && had_warnings () > 0 && had_errors () == 0)