diff options
author | Nick Clifton <nickc@redhat.com> | 2021-11-18 16:48:19 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2021-11-18 16:48:19 +0000 |
commit | 578c64a45a0e47fd0af53c77339ec0c26ef4874a (patch) | |
tree | b95f61afc34286ad08556eb14848e9ba2d0123a1 /gas/doc/as.texi | |
parent | 76eb8ef1ce470ca71b10fae721e32d49998d87b9 (diff) | |
download | gdb-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/doc/as.texi')
-rw-r--r-- | gas/doc/as.texi | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/gas/doc/as.texi b/gas/doc/as.texi index 9c1924d..b83f50b 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -245,6 +245,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{--sectname-subst}] [@b{--size-check=[error|warning]}] [@b{--elf-stt-common=[no|yes]}] [@b{--generate-missing-build-notes=[no|yes]}] + [@b{--multibyte-handling=[allow|warn|warn-sym-only]}] [@b{--target-help}] [@var{target-options}] [@b{--}|@var{files} @dots{}] @c @@ -871,6 +872,18 @@ Set the maximum width of an input source line, as displayed in a listing, to Set the maximum number of lines printed in a listing for a single line of input to @var{number} + 1. +@item --multibyte-handling=allow +@itemx --multibyte-handling=warn +@itemx --multibyte-handling=warn-sym-only +Controls how the assembler handles multibyte characters in the input. The +default (which can be restored by using the @option{allow} argument) is to +allow such characters without complaint. Using the @option{warn} argument will +make the assembler generate a warning message whenever any multibyte character +is encountered. Using the @option{warn-sym-only} argument will only cause a +warning to be generated when a symbol is defined with a name that contains +multibyte characters. (References to undefined symbols will not generate a +warning). + @item --no-pad-sections Stop the assembler for padding the ends of output sections to the alignment of that section. The default is to pad the sections, but this can waste space @@ -2966,9 +2979,11 @@ are noted in @ref{Machine Dependencies}. @end ifset No symbol may begin with a digit. Case is significant. There is no length limit; all characters are significant. Multibyte characters -are supported. Symbols are delimited by characters not in that set, or by the -beginning of a file (since the source program must end with a newline, the end -of a file is not a possible symbol delimiter). @xref{Symbols}. +are supported, but note that the setting of the +@option{--multibyte-handling} option might prevent their use. Symbols +are delimited by characters not in that set, or by the beginning of a file +(since the source program must end with a newline, the end of a file is not a +possible symbol delimiter). @xref{Symbols}. Symbol names may also be enclosed in double quote @code{"} characters. In such cases any characters are allowed, except for the NUL character. If a double @@ -3858,11 +3873,18 @@ than @code{Foo}. Symbol names do not start with a digit. An exception to this rule is made for Local Labels. See below. -Multibyte characters are supported. To generate a symbol name containing +Multibyte characters are supported, but note that the setting of the +@option{multibyte-handling} option might prevent their use. +To generate a symbol name containing multibyte characters enclose it within double quotes and use escape codes. cf @xref{Strings}. Generating a multibyte symbol name from a label is not currently supported. +Since multibyte symbol names are unusual, and could possibly be used +maliciously, @command{@value{AS}} provides a command line option +(@option{--multibyte-handling=warn-sym-only}) which can be used to generate a +warning message whenever a symbol name containing multibyte characters is defined. + Each symbol has exactly one name. Each name in an assembly language program refers to exactly one symbol. You may use that symbol name any number of times in a program. |