aboutsummaryrefslogtreecommitdiff
path: root/gas/as.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2021-11-18 16:48:19 +0000
committerNick Clifton <nickc@redhat.com>2021-11-18 16:48:19 +0000
commit578c64a45a0e47fd0af53c77339ec0c26ef4874a (patch)
treeb95f61afc34286ad08556eb14848e9ba2d0123a1 /gas/as.c
parent76eb8ef1ce470ca71b10fae721e32d49998d87b9 (diff)
downloadgdb-578c64a45a0e47fd0af53c77339ec0c26ef4874a.zip
gdb-578c64a45a0e47fd0af53c77339ec0c26ef4874a.tar.gz
gdb-578c64a45a0e47fd0af53c77339ec0c26ef4874a.tar.bz2
Add multibyte character warning option to the assembler.
* as.c (parse_args): Add support for --multibyte-handling. * as.h (multibyte_handling): Declare. * app.c (scan_for_multibyte_characters): New function. (do_scrub_chars): Call the new function if multibyte warning is enabled. * input-scrub,c (input_scrub_next_buffer): Call the multibyte scanning function if multibyte warnings are enabled. * symbols.c (struct symbol_flags): Add multibyte_warned bit. (symbol_init): Call the multibyte scanning function if multibyte symbol warnings are enabled. (S_SET_SEGMENT): Likewise. * NEWS: Mention the new feature. * doc/as.texi: Document the new feature. * testsuite/gas/all/multibyte.s: New test source file. * testsuite/gas/all/multibyte1.d: New test driver file. * testsuite/gas/all/multibyte1.l: New test expected output. * testsuite/gas/all/multibyte2.d: New test driver file. * testsuite/gas/all/multibyte2.l: New test expected output. * testsuite/gas/all/gas.exp: Run the new tests.
Diffstat (limited to 'gas/as.c')
-rw-r--r--gas/as.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/gas/as.c b/gas/as.c
index 7de8af2..8af04aa 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -474,7 +474,7 @@ parse_args (int * pargc, char *** pargv)
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,
@@ -484,7 +484,7 @@ parse_args (int * pargc, char *** pargv)
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,
@@ -494,7 +494,7 @@ parse_args (int * pargc, char *** pargv)
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,
@@ -503,7 +503,8 @@ parse_args (int * pargc, char *** pargv)
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. */
};
@@ -581,6 +582,7 @@ parse_args (int * pargc, char *** pargv)
,{"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
@@ -683,6 +685,19 @@ parse_args (int * pargc, char *** pargv)
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);