+ /* Codes used for the long options with no short synonyms. */
+ enum option_values
+ {
+ OPTION_HELP = OPTION_STD_BASE,
+ OPTION_NOCPP,
+ OPTION_STATISTICS,
+ OPTION_VERSION,
+ OPTION_DUMPCONFIG,
+ OPTION_VERBOSE,
+ OPTION_EMULATION,
+ OPTION_DEBUG_PREFIX_MAP,
+ OPTION_DEFSYM,
+ OPTION_LISTING_LHS_WIDTH,
+ OPTION_LISTING_LHS_WIDTH2,
+ OPTION_LISTING_RHS_WIDTH,
+ OPTION_LISTING_CONT_LINES,
+ OPTION_DEPFILE,
+ OPTION_GSTABS,
+ OPTION_GSTABS_PLUS,
+ OPTION_GDWARF2,
+ OPTION_GDWARF_SECTIONS,
+ OPTION_STRIP_LOCAL_ABSOLUTE,
+ OPTION_TRADITIONAL_FORMAT,
+ OPTION_WARN,
+ OPTION_TARGET_HELP,
+ OPTION_EXECSTACK,
+ OPTION_NOEXECSTACK,
+ OPTION_SIZE_CHECK,
+ OPTION_ELF_STT_COMMON,
+ OPTION_SECTNAME_SUBST,
+ OPTION_ALTERNATE,
+ OPTION_AL,
+ OPTION_HASH_TABLE_SIZE,
+ OPTION_REDUCE_MEMORY_OVERHEADS,
+ OPTION_WARN_FATAL,
+ OPTION_COMPRESS_DEBUG,
+ OPTION_NOCOMPRESS_DEBUG
+ /* When you add options here, check that they do
+ not collide with OPTION_MD_BASE. See as.h. */
+ };
+
+ static const struct option std_longopts[] =
+ {
+ /* Note: commas are placed at the start of the line rather than
+ the end of the preceding line so that it is simpler to
+ selectively add and remove lines from this list. */
+ {"alternate", no_argument, NULL, OPTION_ALTERNATE}
+ /* The entry for "a" is here to prevent getopt_long_only() from
+ considering that -a is an abbreviation for --alternate. This is
+ necessary because -a=<FILE> is a valid switch but getopt would
+ normally reject it since --alternate does not take an argument. */
+ ,{"a", optional_argument, NULL, 'a'}
+ /* Handle -al=<FILE>. */
+ ,{"al", optional_argument, NULL, OPTION_AL}
+ ,{"compress-debug-sections", optional_argument, NULL, OPTION_COMPRESS_DEBUG}
+ ,{"nocompress-debug-sections", no_argument, NULL, OPTION_NOCOMPRESS_DEBUG}
+ ,{"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}
+#if defined OBJ_ELF || defined OBJ_MAYBE_ELF
+ ,{"execstack", no_argument, NULL, OPTION_EXECSTACK}
+ ,{"noexecstack", no_argument, NULL, OPTION_NOEXECSTACK}
+ ,{"size-check", required_argument, NULL, OPTION_SIZE_CHECK}
+ ,{"elf-stt-common", required_argument, NULL, OPTION_ELF_STT_COMMON}
+ ,{"sectname-subst", no_argument, NULL, OPTION_SECTNAME_SUBST}
+#endif
+ ,{"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}
+ ,{"gdwarf-2", no_argument, NULL, OPTION_GDWARF2}
+ /* GCC uses --gdwarf-2 but GAS uses to use --gdwarf2,
+ so we keep it here for backwards compatibility. */
+ ,{"gdwarf2", no_argument, NULL, OPTION_GDWARF2}
+ ,{"gdwarf-sections", no_argument, NULL, OPTION_GDWARF_SECTIONS}
+ ,{"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}
+#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, '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. */
+ ,{"keep-locals", no_argument, NULL, 'L'}
+ ,{"keep-locals", no_argument, NULL, 'L'}
+ ,{"listing-lhs-width", required_argument, NULL, OPTION_LISTING_LHS_WIDTH}
+ ,{"listing-lhs-width2", required_argument, NULL, OPTION_LISTING_LHS_WIDTH2}
+ ,{"listing-rhs-width", required_argument, NULL, OPTION_LISTING_RHS_WIDTH}
+ ,{"listing-cont-lines", required_argument, NULL, OPTION_LISTING_CONT_LINES}
+ ,{"MD", required_argument, NULL, OPTION_DEPFILE}
+ ,{"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}
+ ,{"verbose", no_argument, NULL, OPTION_VERBOSE}
+ ,{"target-help", no_argument, NULL, OPTION_TARGET_HELP}
+ ,{"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT}
+ ,{"warn", no_argument, NULL, OPTION_WARN}