aboutsummaryrefslogtreecommitdiff
path: root/gas/as.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/as.c')
-rw-r--r--gas/as.c57
1 files changed, 15 insertions, 42 deletions
diff --git a/gas/as.c b/gas/as.c
index 9e059f9..f20b1e0 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -130,10 +130,6 @@ static long start_time;
#ifdef USE_EMULATIONS
#define EMULATION_ENVIRON "AS_EMULATION"
-extern struct emulation mipsbelf, mipslelf, mipself;
-extern struct emulation i386coff, i386elf, i386aout;
-extern struct emulation crisaout, criself;
-
static struct emulation *const emulations[] = { EMULATIONS };
static const int n_emulations = sizeof (emulations) / sizeof (emulations[0]);
@@ -182,13 +178,6 @@ select_emulation_mode (int argc, char **argv)
this_emulation->init ();
}
-const char *
-default_emul_bfd_name (void)
-{
- abort ();
- return NULL;
-}
-
void
common_emul_init (void)
{
@@ -333,7 +322,7 @@ Options:\n\
fprintf (stream, _("\
-f skip whitespace and comment preprocessing\n"));
fprintf (stream, _("\
- -g --gen-debug generate debugging information\n"));
+ -g, --gen-debug generate debugging information\n"));
fprintf (stream, _("\
--gstabs generate STABS debugging information\n"));
fprintf (stream, _("\
@@ -361,9 +350,9 @@ Options:\n\
fprintf (stream, _("\
-K warn when differences altered for long displacements\n"));
fprintf (stream, _("\
- -L,--keep-locals keep local symbols (e.g. starting with `L')\n"));
+ -L, --keep-locals keep local symbols (e.g. starting with `L')\n"));
fprintf (stream, _("\
- -M,--mri assemble in MRI compatibility mode\n"));
+ -M, --mri assemble in MRI compatibility mode\n"));
fprintf (stream, _("\
--MD FILE write dependency information in FILE (default none)\n"));
fprintf (stream, _("\
@@ -388,7 +377,7 @@ Options:\n\
fprintf (stream, _("\
--version print assembler version number and exit\n"));
fprintf (stream, _("\
- -W --no-warn suppress warnings\n"));
+ -W, --no-warn suppress warnings\n"));
fprintf (stream, _("\
--warn don't suppress warnings\n"));
fprintf (stream, _("\
@@ -449,7 +438,6 @@ parse_args (int * pargc, char *** pargv)
the ordering of the two. We describe each non-option ARGV-element
as if it were the argument of an option with character code 1. */
char *shortopts;
- extern const char *md_shortopts;
static const char std_shortopts[] =
{
'-', 'J',
@@ -457,13 +445,8 @@ parse_args (int * pargc, char *** pargv)
/* -K is not meaningful if .word is not being hacked. */
'K',
#endif
- 'L', 'M', 'R', 'W', 'Z', 'a', ':', ':', 'D', 'f', 'g', ':',':', 'I', ':', 'o', ':',
-#ifndef VMS
- /* -v takes an argument on VMS, so we don't make it a generic
- option. */
- 'v',
-#endif
- 'w', 'X',
+ 'L', 'M', 'R', 'W', 'Z', 'a', ':', ':', 'D', 'f', 'g', ':',':', 'I', ':',
+ 'o', ':', 'v', 'w', 'X',
#ifdef HAVE_ITBL_CPU
/* New option for extending instruction set (see also --itbl below). */
't', ':',
@@ -471,8 +454,6 @@ parse_args (int * pargc, char *** pargv)
'\0'
};
struct option *longopts;
- extern struct option md_longopts[];
- extern size_t md_longopts_size;
/* Codes used for the long options with no short synonyms. */
enum option_values
{
@@ -481,7 +462,6 @@ parse_args (int * pargc, char *** pargv)
OPTION_STATISTICS,
OPTION_VERSION,
OPTION_DUMPCONFIG,
- OPTION_VERBOSE,
OPTION_EMULATION,
OPTION_DEBUG_PREFIX_MAP,
OPTION_DEFSYM,
@@ -600,7 +580,7 @@ parse_args (int * pargc, char *** pargv)
,{"statistics", no_argument, NULL, OPTION_STATISTICS}
,{"strip-local-absolute", no_argument, NULL, OPTION_STRIP_LOCAL_ABSOLUTE}
,{"version", no_argument, NULL, OPTION_VERSION}
- ,{"verbose", no_argument, NULL, OPTION_VERBOSE}
+ ,{"verbose", no_argument, NULL, 'v'}
,{"target-help", no_argument, NULL, OPTION_TARGET_HELP}
,{"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT}
,{"warn", no_argument, NULL, OPTION_WARN}
@@ -650,24 +630,17 @@ parse_args (int * pargc, char *** pargv)
it explicitly here before deciding we've gotten a bad argument. */
if (optc == 'v')
{
-#ifdef VMS
- /* Telling getopt to treat -v's value as optional can result
- in it picking up a following filename argument here. The
- VMS code in md_parse_option can return 0 in that case,
- but it has no way of pushing the filename argument back. */
- if (optarg && *optarg)
- new_argv[new_argc++] = optarg, new_argv[new_argc] = NULL;
- else
-#else
- case 'v':
-#endif
- case OPTION_VERBOSE:
- print_version_id ();
- verbose = 1;
+ case 'v':
+ print_version_id ();
+ verbose = 1;
break;
}
+ else if (is_a_char (optc))
+ as_bad (_("unrecognized option `-%c%s'"), optc, optarg ? optarg : "");
+ else if (optarg)
+ as_bad (_("unrecognized option `--%s=%s'"), longopts[longind].name, optarg);
else
- as_bad (_("unrecognized option -%c%s"), optc, optarg ? optarg : "");
+ as_bad (_("unrecognized option `--%s'"), longopts[longind].name);
/* Fall through. */
case '?':