/* as.c - GAS main program.
- Copyright (C) 1987-2020 Free Software Foundation, Inc.
+ Copyright (C) 1987-2022 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
#if defined OBJ_ELF || defined OBJ_MAYBE_ELF
int flag_use_elf_stt_common = DEFAULT_GENERATE_ELF_STT_COMMON;
-bfd_boolean flag_generate_build_notes = DEFAULT_GENERATE_BUILD_NOTES;
+bool flag_generate_build_notes = DEFAULT_GENERATE_BUILD_NOTES;
#endif
/* Keep the output file. */
const char *em = NULL;
for (i = 1; i < argc; i++)
- if (!strncmp ("--em", argv[i], 4))
+ if (startswith (argv[i], "--em"))
break;
if (i == argc)
OPTION_DEBUG_PREFIX_MAP,
OPTION_DEFSYM,
OPTION_LISTING_LHS_WIDTH,
- OPTION_LISTING_LHS_WIDTH2,
+ OPTION_LISTING_LHS_WIDTH2, /* = STD_BASE + 10 */
OPTION_LISTING_RHS_WIDTH,
OPTION_LISTING_CONT_LINES,
OPTION_DEPFILE,
OPTION_GDWARF_3,
OPTION_GDWARF_4,
OPTION_GDWARF_5,
- OPTION_GDWARF_SECTIONS,
+ OPTION_GDWARF_SECTIONS, /* = STD_BASE + 20 */
OPTION_GDWARF_CIE_VERSION,
OPTION_STRIP_LOCAL_ABSOLUTE,
OPTION_TRADITIONAL_FORMAT,
OPTION_NOEXECSTACK,
OPTION_SIZE_CHECK,
OPTION_ELF_STT_COMMON,
- OPTION_ELF_BUILD_NOTES,
+ OPTION_ELF_BUILD_NOTES, /* = STD_BASE + 30 */
OPTION_SECTNAME_SUBST,
OPTION_ALTERNATE,
OPTION_AL,
OPTION_WARN_FATAL,
OPTION_COMPRESS_DEBUG,
OPTION_NOCOMPRESS_DEBUG,
- OPTION_NO_PAD_SECTIONS /* = STD_BASE + 40 */
+ OPTION_NO_PAD_SECTIONS,
+ OPTION_MULTIBYTE_HANDLING /* = STD_BASE + 40 */
/* When you add options here, check that they do
not collide with OPTION_MD_BASE. See as.h. */
};
,{"target-help", no_argument, NULL, OPTION_TARGET_HELP}
,{"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT}
,{"warn", no_argument, NULL, OPTION_WARN}
+ ,{"multibyte-handling", required_argument, NULL, OPTION_MULTIBYTE_HANDLING}
};
/* Construct the option lists from the standard list and the target
flag_traditional_format = 1;
break;
+ case OPTION_MULTIBYTE_HANDLING:
+ if (strcmp (optarg, "allow") == 0)
+ multibyte_handling = multibyte_allow;
+ else if (strcmp (optarg, "warn") == 0)
+ multibyte_handling = multibyte_warn;
+ else if (strcmp (optarg, "warn-sym-only") == 0)
+ multibyte_handling = multibyte_warn_syms;
+ else if (strcmp (optarg, "warn_sym_only") == 0)
+ multibyte_handling = multibyte_warn_syms;
+ else
+ as_fatal (_("unexpected argument to --multibyte-input-option: '%s'"), optarg);
+ break;
+
case OPTION_VERSION:
/* This output is intended to follow the GNU standards document. */
printf (_("GNU assembler %s\n"), BFD_VERSION_STRING);
- printf (_("Copyright (C) 2020 Free Software Foundation, Inc.\n"));
+ printf (_("Copyright (C) 2022 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 version 3 or later.\n\
/* We end up here for any -gsomething-not-already-a-long-option.
give some useful feedback on not (yet) supported -gdwarfxxx
versions/sections/options. */
- if (strncmp (old_argv[optind - 1], "-gdwarf",
- strlen ("-gdwarf")) == 0)
+ if (startswith (old_argv[optind - 1], "-gdwarf"))
as_fatal (_("unknown DWARF option %s\n"), old_argv[optind - 1]);
+ else if (old_argv[optind - 1][1] == 'g' && optarg != NULL)
+ as_fatal (_("unknown option `%s'"), old_argv[optind - 1]);
if (md_debug_format_selector)
debug_type = md_debug_format_selector (& use_gnu_debug_info_extensions);
break;
case OPTION_GDWARF_SECTIONS:
- flag_dwarf_sections = TRUE;
+ flag_dwarf_sections = true;
break;
case OPTION_GDWARF_CIE_VERSION:
case OPTION_SIZE_CHECK:
if (strcasecmp (optarg, "error") == 0)
- flag_allow_nonconst_size = FALSE;
+ flag_allow_nonconst_size = false;
else if (strcasecmp (optarg, "warning") == 0)
- flag_allow_nonconst_size = TRUE;
+ flag_allow_nonconst_size = true;
else
as_fatal (_("Invalid --size-check= option: `%s'"), optarg);
break;
case OPTION_ELF_BUILD_NOTES:
if (strcasecmp (optarg, "no") == 0)
- flag_generate_build_notes = FALSE;
+ flag_generate_build_notes = false;
else if (strcasecmp (optarg, "yes") == 0)
- flag_generate_build_notes = TRUE;
+ flag_generate_build_notes = true;
else
as_fatal (_("Invalid --generate-missing-build-notes option: `%s'"),
optarg);
start_time = get_run_time ();
signal_init ();
-#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
+#ifdef HAVE_LC_MESSAGES
setlocale (LC_MESSAGES, "");
#endif
-#if defined (HAVE_SETLOCALE)
setlocale (LC_CTYPE, "");
-#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);