Blame SOURCES/binutils.unicode.patch

2e9b04
Only in binutils-2.35.2/binutils/: Makefile
2e9b04
diff -rup binutils.orig/binutils/NEWS binutils-2.35.2/binutils/NEWS
2e9b04
--- binutils.orig/binutils/NEWS	2021-08-16 13:07:33.383206365 +0100
2e9b04
+++ binutils-2.35.2/binutils/NEWS	2021-10-25 12:12:22.311951242 +0100
2e9b04
@@ -122,6 +122,15 @@ Changes in 2.32:
2e9b04
 
2e9b04
 Changes in 2.31:
2e9b04
 
2e9b04
+* Tools which display names or strings (readelf, strings, nm, objdump)
2e9b04
+  have a new command line option which controls how unicode characters are
2e9b04
+  handled.  By default they are treated as normal for the tool.  Using
2e9b04
+  --unicode=locale will display them according to the current locale.
2e9b04
+  Using --unicode=hex will display them as hex byte values, whilst
2e9b04
+  --unicode=escape will display them as escape sequences.  In addition
2e9b04
+  using --unicode=highlight will display them as unicode escape sequences
2e9b04
+  highlighted in red (if supported by the output device).
2e9b04
+
2e9b04
 * Add support for disassembling netronome Flow Processor (NFP) firmware files.
2e9b04
 
2e9b04
 * The AArch64 port now supports showing disassembly notes which are emitted
2e9b04
Only in binutils-2.35.2/binutils/: bucomm.o
2e9b04
Only in binutils-2.35.2/binutils/: config.cache
2e9b04
Only in binutils-2.35.2/binutils/: config.h
2e9b04
Only in binutils-2.35.2/binutils/: config.log
2e9b04
Only in binutils-2.35.2/binutils/: config.status
2e9b04
diff -rup binutils.orig/binutils/configure binutils-2.35.2/binutils/configure
2e9b04
--- binutils.orig/binutils/configure	2021-08-16 13:07:33.383206365 +0100
2e9b04
+++ binutils-2.35.2/binutils/configure	2021-10-25 12:12:24.344944672 +0100
2e9b04
@@ -1911,7 +1911,7 @@ else
2e9b04
 #ifdef __cplusplus
2e9b04
 extern "C"
2e9b04
 #endif
2e9b04
-char $2 ();
2e9b04
+__attribute__ ((used)) char $2 ();
2e9b04
 /* The GNU C library defines this for functions which it implements
2e9b04
     to always fail with ENOSYS.  Some functions are actually named
2e9b04
     something starting with __ and the normal name is an alias.  */
2e9b04
@@ -16118,7 +16118,7 @@ CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_
2e9b04
 compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
2e9b04
 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
2e9b04
 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
2e9b04
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
2e9b04
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
2e9b04
 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
2e9b04
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
2e9b04
 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
2e9b04
Only in binutils-2.35.2/binutils/: configure.backup
2e9b04
Only in binutils-2.35.2/binutils/doc: Makefile
2e9b04
diff -rup binutils.orig/binutils/doc/addr2line.1 binutils-2.35.2/binutils/doc/addr2line.1
2e9b04
--- binutils.orig/binutils/doc/addr2line.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/addr2line.1	2021-10-25 12:13:31.293728313 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "ADDR2LINE 1"
2e9b04
-.TH ADDR2LINE 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH ADDR2LINE 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/ar.1 binutils-2.35.2/binutils/doc/ar.1
2e9b04
--- binutils.orig/binutils/doc/ar.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/ar.1	2021-10-25 12:13:31.317728235 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "AR 1"
2e9b04
-.TH AR 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH AR 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/binutils.info binutils-2.35.2/binutils/doc/binutils.info
2e9b04
--- binutils.orig/binutils/doc/binutils.info	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/binutils.info	2021-10-25 12:13:32.884723171 +0100
2e9b04
@@ -601,6 +601,7 @@ File: binutils.info,  Node: nm,  Next: o
2e9b04
         [-D|--dynamic] [-fFORMAT|--format=FORMAT]
2e9b04
         [-g|--extern-only] [-h|--help]
2e9b04
         [-l|--line-numbers] [--inlines]
2e9b04
+        [-U METHOD] [--unicode=METHOD]
2e9b04
         [-n|-v|--numeric-sort]
2e9b04
         [-P|--portability] [-p|--no-sort]
2e9b04
         [-r|--reverse-sort] [-S|--print-size]
2e9b04
@@ -867,6 +868,22 @@ equivalent.
2e9b04
      Display only undefined symbols (those external to each object
2e9b04
      file).
2e9b04
 
2e9b04
+'-U [D|I|L|E|X|H]'
2e9b04
+'--unicode=[DEFAULT|INVALID|LOCALE|ESCAPE|HEX|HIGHLIGHT]'
2e9b04
+     Controls the display of UTF-8 encoded mulibyte characters in
2e9b04
+     strings.  The default ('--unicode=default') is to give them no
2e9b04
+     special treatment.  The '--unicode=locale' option displays the
2e9b04
+     sequence in the current locale, which may or may not support them.
2e9b04
+     The options '--unicode=hex' and '--unicode=invalid' display them as
2e9b04
+     hex byte sequences enclosed by either angle brackets or curly
2e9b04
+     braces.
2e9b04
+
2e9b04
+     The '--unicode=escape' option displays them as escape sequences
2e9b04
+     (\UXXXX) and the '--unicode=highlight' option displays them as
2e9b04
+     escape sequences highlighted in red (if supported by the output
2e9b04
+     device).  The colouring is intended to draw attention to the
2e9b04
+     presence of unicode sequences where they might not be expected.
2e9b04
+
2e9b04
 '-V'
2e9b04
 '--version'
2e9b04
      Show the version number of 'nm' and exit.
2e9b04
@@ -1890,6 +1907,7 @@ File: binutils.info,  Node: objdump,  Ne
2e9b04
              [--prefix-strip=LEVEL]
2e9b04
              [--insn-width=WIDTH]
2e9b04
              [--visualize-jumps[=color|=extended-color|=off]
2e9b04
+             [-U METHOD] [--unicode=METHOD]
2e9b04
              [-V|--version]
2e9b04
              [-H|--help]
2e9b04
              OBJFILE...
2e9b04
@@ -2648,6 +2666,22 @@ given.
2e9b04
      be special in some way and which would not normally be of interest
2e9b04
      to the user.
2e9b04
 
2e9b04
+'-U [D|I|L|E|X|H]'
2e9b04
+'--unicode=[DEFAULT|INVALID|LOCALE|ESCAPE|HEX|HIGHLIGHT]'
2e9b04
+     Controls the display of UTF-8 encoded mulibyte characters in
2e9b04
+     strings.  The default ('--unicode=default') is to give them no
2e9b04
+     special treatment.  The '--unicode=locale' option displays the
2e9b04
+     sequence in the current locale, which may or may not support them.
2e9b04
+     The options '--unicode=hex' and '--unicode=invalid' display them as
2e9b04
+     hex byte sequences enclosed by either angle brackets or curly
2e9b04
+     braces.
2e9b04
+
2e9b04
+     The '--unicode=escape' option displays them as escape sequences
2e9b04
+     (\UXXXX) and the '--unicode=highlight' option displays them as
2e9b04
+     escape sequences highlighted in red (if supported by the output
2e9b04
+     device).  The colouring is intended to draw attention to the
2e9b04
+     presence of unicode sequences where they might not be expected.
2e9b04
+
2e9b04
 '-V'
2e9b04
 '--version'
2e9b04
      Print the version number of 'objdump' and exit.
2e9b04
@@ -2842,6 +2876,7 @@ File: binutils.info,  Node: strings,  Ne
2e9b04
              [-n MIN-LEN] [--bytes=MIN-LEN]
2e9b04
              [-t RADIX] [--radix=RADIX]
2e9b04
              [-e ENCODING] [--encoding=ENCODING]
2e9b04
+             [-U METHOD] [--unicode=METHOD]
2e9b04
              [-] [--all] [--print-file-name]
2e9b04
              [-T BFDNAME] [--target=BFDNAME]
2e9b04
              [-w] [--include-all-whitespace]
2e9b04
@@ -2924,6 +2959,27 @@ files.
2e9b04
      Useful for finding wide character strings.  ('l' and 'b' apply to,
2e9b04
      for example, Unicode UTF-16/UCS-2 encodings).
2e9b04
 
2e9b04
+'-U [D|I|L|E|X|H]'
2e9b04
+'--unicode=[DEFAULT|INVALID|LOCALE|ESCAPE|HEX|HIGHLIGHT]'
2e9b04
+     Controls the display of UTF-8 encoded mulibyte characters in
2e9b04
+     strings.  The default ('--unicode=default') is to give them no
2e9b04
+     special treatment, and instead rely upon the setting of the
2e9b04
+     '--encoding' option.  The other values for this option
2e9b04
+     automatically enable '--encoding=S'.
2e9b04
+
2e9b04
+     The '--unicode=invalid' option treats them as non-graphic
2e9b04
+     characters and hence not part of a valid string.  All the remaining
2e9b04
+     options treat them as valid string characters.
2e9b04
+
2e9b04
+     The '--unicode=locale' option displays them in the current locale,
2e9b04
+     which may or may not support UTF-8 encoding.  The '--unicode=hex'
2e9b04
+     option displays them as hex byte sequences enclosed between <>
2e9b04
+     characters.  The '--unicode=escape' option displays them as escape
2e9b04
+     sequences (\UXXXX) and the '--unicode=highlight' option displays
2e9b04
+     them as escape sequences highlighted in red (if supported by the
2e9b04
+     output device).  The colouring is intended to draw attention to the
2e9b04
+     presence of unicode sequences where they might not be expected.
2e9b04
+
2e9b04
 '-T BFDNAME'
2e9b04
 '--target=BFDNAME'
2e9b04
      Specify an object code format other than your system's default
2e9b04
@@ -4241,6 +4297,7 @@ File: binutils.info,  Node: readelf,  Ne
2e9b04
              [-W|--wide]
2e9b04
              [-T|--silent-truncation]
2e9b04
              [-H|--help]
2e9b04
+             [-U METHOD|--unicode=METHOD]
2e9b04
              ELFFILE...
2e9b04
 
2e9b04
    'readelf' displays information about one or more ELF format object
2e9b04
@@ -4310,6 +4367,28 @@ equivalent.  At least one option besides
2e9b04
      if it has one.  The output format is the same as the format used by
2e9b04
      the '--syms' option.
2e9b04
 
2e9b04
+'-U [D|I|L|E|X|H]'
2e9b04
+'--unicode=[default|invalid|locale|escape|hex|highlight]'
2e9b04
+     Controls the display of non-ASCII characters in identifier names.
2e9b04
+     The default ('--unicode=locale' or '--unicode=default') is to treat
2e9b04
+     them as multibyte characters and display them in the current
2e9b04
+     locale.  All other versions of this option treat the bytes as UTF-8
2e9b04
+     encoded values and attempt to interpret them.  If they cannot be
2e9b04
+     interpreted or if the '--unicode=invalid' option is used then they
2e9b04
+     are displayed as a sequence of hex bytes, encloses in curly
2e9b04
+     parethesis characters.
2e9b04
+
2e9b04
+     Using the '--unicode=escape' option will display the characters as
2e9b04
+     as unicode escape sequences (\UXXXX).  Using the '--unicode=hex'
2e9b04
+     will display the characters as hex byte sequences enclosed between
2e9b04
+     angle brackets.
2e9b04
+
2e9b04
+     Using the '--unicode=highlight' will display the characters as
2e9b04
+     unicode escape sequences but it will also highlighted them in red,
2e9b04
+     assuming that colouring is supported by the output device.  The
2e9b04
+     colouring is intended to draw attention to the presence of unicode
2e9b04
+     sequences when they might not be expected.
2e9b04
+
2e9b04
 '-e'
2e9b04
 '--headers'
2e9b04
      Display all the headers in the file.  Equivalent to '-h -l -S'.
2e9b04
@@ -5549,18 +5628,18 @@ Binutils Index
2e9b04
 * -enable-deterministic-archives <5>:    ranlib.              (line  44)
2e9b04
 * -enable-deterministic-archives <6>:    strip.               (line 155)
2e9b04
 * -enable-deterministic-archives <7>:    strip.               (line 165)
2e9b04
-* .stab:                                 objdump.             (line 696)
2e9b04
-* Add prefix to absolute paths:          objdump.             (line 505)
2e9b04
+* .stab:                                 objdump.             (line 697)
2e9b04
+* Add prefix to absolute paths:          objdump.             (line 506)
2e9b04
 * addr2line:                             addr2line.           (line   6)
2e9b04
 * address to file name and line number:  addr2line.           (line   6)
2e9b04
-* all header information, object file:   objdump.             (line 818)
2e9b04
+* all header information, object file:   objdump.             (line 835)
2e9b04
 * ar:                                    ar.                  (line   6)
2e9b04
 * ar compatibility:                      ar.                  (line  60)
2e9b04
-* architecture:                          objdump.             (line 257)
2e9b04
-* architectures available:               objdump.             (line 242)
2e9b04
+* architecture:                          objdump.             (line 258)
2e9b04
+* architectures available:               objdump.             (line 243)
2e9b04
 * archive contents:                      ranlib.              (line   6)
2e9b04
-* Archive file symbol index information: readelf.             (line 194)
2e9b04
-* archive headers:                       objdump.             (line  75)
2e9b04
+* Archive file symbol index information: readelf.             (line 217)
2e9b04
+* archive headers:                       objdump.             (line  76)
2e9b04
 * archives:                              ar.                  (line   6)
2e9b04
 * base files:                            dlltool.             (line 124)
2e9b04
 * bug criteria:                          Bug Criteria.        (line   6)
2e9b04
@@ -5574,23 +5653,23 @@ Binutils Index
2e9b04
 * changing section VMA:                  objcopy.             (line 434)
2e9b04
 * changing start address:                objcopy.             (line 396)
2e9b04
 * collections of files:                  ar.                  (line   6)
2e9b04
-* Compact Type Format:                   objdump.             (line 682)
2e9b04
-* Compact Type Format <1>:               readelf.             (line 342)
2e9b04
+* Compact Type Format:                   objdump.             (line 683)
2e9b04
+* Compact Type Format <1>:               readelf.             (line 365)
2e9b04
 * compatibility, ar:                     ar.                  (line  60)
2e9b04
 * contents of archive:                   ar cmdline.          (line  97)
2e9b04
 * crash:                                 Bug Criteria.        (line   9)
2e9b04
 * creating archives:                     ar cmdline.          (line 144)
2e9b04
 * creating thin archive:                 ar cmdline.          (line 219)
2e9b04
-* CTF:                                   objdump.             (line 682)
2e9b04
-* CTF <1>:                               readelf.             (line 342)
2e9b04
+* CTF:                                   objdump.             (line 683)
2e9b04
+* CTF <1>:                               readelf.             (line 365)
2e9b04
 * cxxfilt:                               c++filt.             (line  16)
2e9b04
 * dates in archive:                      ar cmdline.          (line 183)
2e9b04
-* debug symbols:                         objdump.             (line 696)
2e9b04
-* debugging symbols:                     nm.                  (line 160)
2e9b04
+* debug symbols:                         objdump.             (line 697)
2e9b04
+* debugging symbols:                     nm.                  (line 161)
2e9b04
 * deleting from archive:                 ar cmdline.          (line  26)
2e9b04
 * demangling C++ symbols:                c++filt.             (line   6)
2e9b04
-* demangling in nm:                      nm.                  (line 168)
2e9b04
-* demangling in objdump:                 objdump.             (line 103)
2e9b04
+* demangling in nm:                      nm.                  (line 169)
2e9b04
+* demangling in objdump:                 objdump.             (line 104)
2e9b04
 * demangling in objdump <1>:             addr2line.           (line  86)
2e9b04
 * deterministic archives:                ar cmdline.          (line 150)
2e9b04
 * deterministic archives <1>:            ar cmdline.          (line 233)
2e9b04
@@ -5600,73 +5679,73 @@ Binutils Index
2e9b04
 * deterministic archives <5>:            ranlib.              (line  44)
2e9b04
 * deterministic archives <6>:            strip.               (line 155)
2e9b04
 * deterministic archives <7>:            strip.               (line 165)
2e9b04
-* disassembling object code:             objdump.             (line 144)
2e9b04
-* disassembly architecture:              objdump.             (line 257)
2e9b04
-* disassembly endianness:                objdump.             (line 192)
2e9b04
-* disassembly, with source:              objdump.             (line 494)
2e9b04
-* disassembly, with source <1>:          objdump.             (line 498)
2e9b04
+* disassembling object code:             objdump.             (line 145)
2e9b04
+* disassembly architecture:              objdump.             (line 258)
2e9b04
+* disassembly endianness:                objdump.             (line 193)
2e9b04
+* disassembly, with source:              objdump.             (line 495)
2e9b04
+* disassembly, with source <1>:          objdump.             (line 499)
2e9b04
 * discarding symbols:                    strip.               (line   6)
2e9b04
 * DLL:                                   dlltool.             (line   6)
2e9b04
 * dlltool:                               dlltool.             (line   6)
2e9b04
-* dynamic relocation entries, in object file: objdump.        (line 482)
2e9b04
-* dynamic symbol table entries, printing: objdump.            (line 795)
2e9b04
-* dynamic symbols:                       nm.                  (line 198)
2e9b04
-* ELF dynamic section information:       readelf.             (line 134)
2e9b04
-* ELF dynamic symbol table information:  readelf.             (line 106)
2e9b04
-* ELF file header information:           readelf.             (line  69)
2e9b04
+* dynamic relocation entries, in object file: objdump.        (line 483)
2e9b04
+* dynamic symbol table entries, printing: objdump.            (line 796)
2e9b04
+* dynamic symbols:                       nm.                  (line 199)
2e9b04
+* ELF dynamic section information:       readelf.             (line 157)
2e9b04
+* ELF dynamic symbol table information:  readelf.             (line 107)
2e9b04
+* ELF file header information:           readelf.             (line  70)
2e9b04
 * ELF file information:                  readelf.             (line   6)
2e9b04
-* ELF notes:                             readelf.             (line 116)
2e9b04
-* ELF object file format:                objdump.             (line 696)
2e9b04
-* ELF program header information:        readelf.             (line  75)
2e9b04
-* ELF reloc information:                 readelf.             (line 120)
2e9b04
-* ELF section group information:         readelf.             (line  86)
2e9b04
-* ELF section information:               readelf.             (line  81)
2e9b04
-* ELF section information <1>:           readelf.             (line  91)
2e9b04
-* ELF segment information:               readelf.             (line  75)
2e9b04
-* ELF symbol table information:          readelf.             (line  96)
2e9b04
-* ELF version sections information:      readelf.             (line 138)
2e9b04
+* ELF notes:                             readelf.             (line 139)
2e9b04
+* ELF object file format:                objdump.             (line 697)
2e9b04
+* ELF program header information:        readelf.             (line  76)
2e9b04
+* ELF reloc information:                 readelf.             (line 143)
2e9b04
+* ELF section group information:         readelf.             (line  87)
2e9b04
+* ELF section information:               readelf.             (line  82)
2e9b04
+* ELF section information <1>:           readelf.             (line  92)
2e9b04
+* ELF segment information:               readelf.             (line  76)
2e9b04
+* ELF symbol table information:          readelf.             (line  97)
2e9b04
+* ELF version sections information:      readelf.             (line 161)
2e9b04
 * elfedit:                               elfedit.             (line   6)
2e9b04
-* endianness:                            objdump.             (line 192)
2e9b04
+* endianness:                            objdump.             (line 193)
2e9b04
 * error on valid input:                  Bug Criteria.        (line  12)
2e9b04
-* external symbols:                      nm.                  (line 210)
2e9b04
-* external symbols <1>:                  nm.                  (line 274)
2e9b04
-* external symbols <2>:                  nm.                  (line 288)
2e9b04
+* external symbols:                      nm.                  (line 211)
2e9b04
+* external symbols <1>:                  nm.                  (line 275)
2e9b04
+* external symbols <2>:                  nm.                  (line 305)
2e9b04
 * extract from archive:                  ar cmdline.          (line 114)
2e9b04
 * fatal signal:                          Bug Criteria.        (line   9)
2e9b04
-* file name:                             nm.                  (line 154)
2e9b04
-* header information, all:               objdump.             (line 818)
2e9b04
+* file name:                             nm.                  (line 155)
2e9b04
+* header information, all:               objdump.             (line 835)
2e9b04
 * input .def file:                       dlltool.             (line 120)
2e9b04
-* input file name:                       nm.                  (line 154)
2e9b04
-* Instruction width:                     objdump.             (line 522)
2e9b04
+* input file name:                       nm.                  (line 155)
2e9b04
+* Instruction width:                     objdump.             (line 523)
2e9b04
 * libraries:                             ar.                  (line  25)
2e9b04
 * listings strings:                      strings.             (line   6)
2e9b04
-* machine instructions:                  objdump.             (line 144)
2e9b04
+* machine instructions:                  objdump.             (line 145)
2e9b04
 * moving in archive:                     ar cmdline.          (line  34)
2e9b04
 * MRI compatibility, ar:                 ar scripts.          (line   8)
2e9b04
 * name duplication in archive:           ar cmdline.          (line 108)
2e9b04
 * name length:                           ar.                  (line  18)
2e9b04
 * nm:                                    nm.                  (line   6)
2e9b04
-* nm compatibility:                      nm.                  (line 164)
2e9b04
-* nm compatibility <1>:                  nm.                  (line 204)
2e9b04
-* nm format:                             nm.                  (line 164)
2e9b04
-* nm format <1>:                         nm.                  (line 204)
2e9b04
+* nm compatibility:                      nm.                  (line 165)
2e9b04
+* nm compatibility <1>:                  nm.                  (line 205)
2e9b04
+* nm format:                             nm.                  (line 165)
2e9b04
+* nm format <1>:                         nm.                  (line 205)
2e9b04
 * not writing archive index:             ar cmdline.          (line 212)
2e9b04
 * objdump:                               objdump.             (line   6)
2e9b04
-* objdump inlines:                       nm.                  (line 226)
2e9b04
-* object code format:                    nm.                  (line 332)
2e9b04
-* object code format <1>:                objdump.             (line  89)
2e9b04
+* objdump inlines:                       nm.                  (line 227)
2e9b04
+* object code format:                    nm.                  (line 349)
2e9b04
+* object code format <1>:                objdump.             (line  90)
2e9b04
 * object code format <2>:                size.                (line 103)
2e9b04
-* object code format <3>:                strings.             (line  94)
2e9b04
+* object code format <3>:                strings.             (line 116)
2e9b04
 * object code format <4>:                addr2line.           (line  81)
2e9b04
-* object file header:                    objdump.             (line 198)
2e9b04
+* object file header:                    objdump.             (line 199)
2e9b04
 * object file information:               objdump.             (line   6)
2e9b04
-* object file offsets:                   objdump.             (line 203)
2e9b04
-* object file sections:                  objdump.             (line 489)
2e9b04
-* object formats available:              objdump.             (line 242)
2e9b04
+* object file offsets:                   objdump.             (line 204)
2e9b04
+* object file sections:                  objdump.             (line 490)
2e9b04
+* object formats available:              objdump.             (line 243)
2e9b04
 * offsets of files:                      ar cmdline.          (line 188)
2e9b04
 * operations on archive:                 ar cmdline.          (line  22)
2e9b04
 * plugins:                               ar cmdline.          (line 267)
2e9b04
-* plugins <1>:                           nm.                  (line 291)
2e9b04
+* plugins <1>:                           nm.                  (line 308)
2e9b04
 * printing from archive:                 ar cmdline.          (line  46)
2e9b04
 * printing strings:                      strings.             (line   6)
2e9b04
 * quick append to archive:               ar cmdline.          (line  54)
2e9b04
@@ -5675,51 +5754,51 @@ Binutils Index
2e9b04
 * ranlib <1>:                            ar cmdline.          (line  91)
2e9b04
 * readelf:                               readelf.             (line   6)
2e9b04
 * relative placement in archive:         ar cmdline.          (line 132)
2e9b04
-* relocation entries, in object file:    objdump.             (line 476)
2e9b04
+* relocation entries, in object file:    objdump.             (line 477)
2e9b04
 * removing symbols:                      strip.               (line   6)
2e9b04
 * repeated names in archive:             ar cmdline.          (line 108)
2e9b04
 * replacement in archive:                ar cmdline.          (line  73)
2e9b04
 * reporting bugs:                        Reporting Bugs.      (line   6)
2e9b04
 * scripts, ar:                           ar scripts.          (line   8)
2e9b04
-* section addresses in objdump:          objdump.             (line  81)
2e9b04
-* section headers:                       objdump.             (line 219)
2e9b04
-* section information:                   objdump.             (line 247)
2e9b04
+* section addresses in objdump:          objdump.             (line  82)
2e9b04
+* section headers:                       objdump.             (line 220)
2e9b04
+* section information:                   objdump.             (line 248)
2e9b04
 * section sizes:                         size.                (line   6)
2e9b04
-* sections, full contents:               objdump.             (line 489)
2e9b04
+* sections, full contents:               objdump.             (line 490)
2e9b04
 * separate debug files:                  debuginfod.          (line   6)
2e9b04
 * size:                                  size.                (line   6)
2e9b04
 * size display format:                   size.                (line  28)
2e9b04
 * size number format:                    size.                (line  85)
2e9b04
-* sorting symbols:                       nm.                  (line 241)
2e9b04
-* source code context:                   objdump.             (line 212)
2e9b04
-* source disassembly:                    objdump.             (line 494)
2e9b04
-* source disassembly <1>:                objdump.             (line 498)
2e9b04
-* source file name:                      nm.                  (line 154)
2e9b04
-* source filenames for object files:     objdump.             (line 251)
2e9b04
-* stab:                                  objdump.             (line 696)
2e9b04
-* start-address:                         objdump.             (line 705)
2e9b04
-* stop-address:                          objdump.             (line 709)
2e9b04
+* sorting symbols:                       nm.                  (line 242)
2e9b04
+* source code context:                   objdump.             (line 213)
2e9b04
+* source disassembly:                    objdump.             (line 495)
2e9b04
+* source disassembly <1>:                objdump.             (line 499)
2e9b04
+* source file name:                      nm.                  (line 155)
2e9b04
+* source filenames for object files:     objdump.             (line 252)
2e9b04
+* stab:                                  objdump.             (line 697)
2e9b04
+* start-address:                         objdump.             (line 706)
2e9b04
+* stop-address:                          objdump.             (line 710)
2e9b04
 * strings:                               strings.             (line   6)
2e9b04
 * strings, printing:                     strings.             (line   6)
2e9b04
 * strip:                                 strip.               (line   6)
2e9b04
-* Strip absolute paths:                  objdump.             (line 508)
2e9b04
+* Strip absolute paths:                  objdump.             (line 509)
2e9b04
 * symbol index:                          ar.                  (line  28)
2e9b04
 * symbol index <1>:                      ranlib.              (line   6)
2e9b04
-* symbol index, listing:                 nm.                  (line 263)
2e9b04
-* symbol line numbers:                   nm.                  (line 218)
2e9b04
-* symbol table entries, printing:        objdump.             (line 714)
2e9b04
+* symbol index, listing:                 nm.                  (line 264)
2e9b04
+* symbol line numbers:                   nm.                  (line 219)
2e9b04
+* symbol table entries, printing:        objdump.             (line 715)
2e9b04
 * symbols:                               nm.                  (line   6)
2e9b04
 * symbols, discarding:                   strip.               (line   6)
2e9b04
 * thin archives:                         ar.                  (line  40)
2e9b04
-* undefined symbols:                     nm.                  (line 274)
2e9b04
-* undefined symbols <1>:                 nm.                  (line 288)
2e9b04
+* undefined symbols:                     nm.                  (line 275)
2e9b04
+* undefined symbols <1>:                 nm.                  (line 305)
2e9b04
 * Unix compatibility, ar:                ar cmdline.          (line   8)
2e9b04
-* unwind information:                    readelf.             (line 125)
2e9b04
+* unwind information:                    readelf.             (line 148)
2e9b04
 * Update ELF header:                     elfedit.             (line   6)
2e9b04
 * updating an archive:                   ar cmdline.          (line 224)
2e9b04
 * version:                               Top.                 (line   6)
2e9b04
-* VMA in objdump:                        objdump.             (line  81)
2e9b04
-* wide output, printing:                 objdump.             (line 824)
2e9b04
+* VMA in objdump:                        objdump.             (line  82)
2e9b04
+* wide output, printing:                 objdump.             (line 841)
2e9b04
 * writing archive index:                 ar cmdline.          (line 206)
2e9b04
 
2e9b04
 
2e9b04
@@ -5730,31 +5809,31 @@ Node: ar3553
2e9b04
 Node: ar cmdline6706
2e9b04
 Node: ar scripts19332
2e9b04
 Node: nm25018
2e9b04
-Node: objcopy37699
2e9b04
-Node: objdump78192
2e9b04
-Node: ranlib111217
2e9b04
-Node: size112816
2e9b04
-Node: strings116785
2e9b04
-Node: strip121157
2e9b04
-Node: c++filt130682
2e9b04
-Ref: c++filt-Footnote-1136544
2e9b04
-Node: addr2line136650
2e9b04
-Node: windmc142329
2e9b04
-Node: windres145988
2e9b04
-Node: dlltool152347
2e9b04
-Node: def file format165344
2e9b04
-Node: readelf167874
2e9b04
-Node: elfedit181388
2e9b04
-Node: Common Options184344
2e9b04
-Node: Selecting the Target System185378
2e9b04
-Node: Target Selection186306
2e9b04
-Node: Architecture Selection188287
2e9b04
-Node: debuginfod189115
2e9b04
-Node: Reporting Bugs189874
2e9b04
-Node: Bug Criteria190636
2e9b04
-Node: Bug Reporting191189
2e9b04
-Node: GNU Free Documentation License198059
2e9b04
-Node: Binutils Index223219
2e9b04
+Node: objcopy38585
2e9b04
+Node: objdump79078
2e9b04
+Node: ranlib112994
2e9b04
+Node: size114593
2e9b04
+Node: strings118562
2e9b04
+Node: strip124112
2e9b04
+Node: c++filt133637
2e9b04
+Ref: c++filt-Footnote-1139499
2e9b04
+Node: addr2line139605
2e9b04
+Node: windmc145284
2e9b04
+Node: windres148943
2e9b04
+Node: dlltool155302
2e9b04
+Node: def file format168299
2e9b04
+Node: readelf170829
2e9b04
+Node: elfedit185547
2e9b04
+Node: Common Options188503
2e9b04
+Node: Selecting the Target System189537
2e9b04
+Node: Target Selection190465
2e9b04
+Node: Architecture Selection192446
2e9b04
+Node: debuginfod193274
2e9b04
+Node: Reporting Bugs194033
2e9b04
+Node: Bug Criteria194795
2e9b04
+Node: Bug Reporting195348
2e9b04
+Node: GNU Free Documentation License202218
2e9b04
+Node: Binutils Index227378
2e9b04
 ?
2e9b04
 End Tag Table
2e9b04
 
2e9b04
diff -rup binutils.orig/binutils/doc/binutils.texi binutils-2.35.2/binutils/doc/binutils.texi
2e9b04
--- binutils.orig/binutils/doc/binutils.texi	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/binutils.texi	2021-10-25 12:12:22.312951239 +0100
2e9b04
@@ -787,6 +787,7 @@ nm [@option{-A}|@option{-o}|@option{--pr
2e9b04
    [@option{-D}|@option{--dynamic}] [@option{-f}@var{format}|@option{--format=}@var{format}]
2e9b04
    [@option{-g}|@option{--extern-only}] [@option{-h}|@option{--help}]
2e9b04
    [@option{-l}|@option{--line-numbers}] [@option{--inlines}]
2e9b04
+   [@option{-U} @var{method}] [@option{--unicode=}@var{method}]
2e9b04
    [@option{-n}|@option{-v}|@option{--numeric-sort}]
2e9b04
    [@option{-P}|@option{--portability}] [@option{-p}|@option{--no-sort}]
2e9b04
    [@option{-r}|@option{--reverse-sort}] [@option{-S}|@option{--print-size}]
2e9b04
@@ -1081,6 +1082,21 @@ Use @var{radix} as the radix for printin
2e9b04
 @cindex undefined symbols
2e9b04
 Display only undefined symbols (those external to each object file).
2e9b04
 
2e9b04
+@item -U @var{[d|i|l|e|x|h]}
2e9b04
+@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
2e9b04
+Controls the display of UTF-8 encoded mulibyte characters in strings.
2e9b04
+The default (@option{--unicode=default}) is to give them no special
2e9b04
+treatment.  The @option{--unicode=locale} option displays the sequence
2e9b04
+in the current locale, which may or may not support them.  The options
2e9b04
+@option{--unicode=hex} and @option{--unicode=invalid} display them as
2e9b04
+hex byte sequences enclosed by either angle brackets or curly braces.
2e9b04
+
2e9b04
+The @option{--unicode=escape} option displays them as escape sequences
2e9b04
+(@var{\uxxxx}) and the @option{--unicode=highlight} option displays
2e9b04
+them as escape sequences highlighted in red (if supported by the
2e9b04
+output device).  The colouring is intended to draw attention to the
2e9b04
+presence of unicode sequences where they might not be expected.
2e9b04
+
2e9b04
 @item -V
2e9b04
 @itemx --version
2e9b04
 Show the version number of @command{nm} and exit.
2e9b04
@@ -2174,6 +2190,7 @@ objdump [@option{-a}|@option{--archive-h
2e9b04
         [@option{--prefix-strip=}@var{level}]
2e9b04
         [@option{--insn-width=}@var{width}]
2e9b04
         [@option{--visualize-jumps[=color|=extended-color|=off]}
2e9b04
+        [@option{-U} @var{method}] [@option{--unicode=}@var{method}]
2e9b04
         [@option{-V}|@option{--version}]
2e9b04
         [@option{-H}|@option{--help}]
2e9b04
         @var{objfile}@dots{}
2e9b04
@@ -2841,6 +2858,21 @@ When displaying symbols include those wh
2e9b04
 special in some way and which would not normally be of interest to the
2e9b04
 user.
2e9b04
 
2e9b04
+@item -U @var{[d|i|l|e|x|h]}
2e9b04
+@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
2e9b04
+Controls the display of UTF-8 encoded mulibyte characters in strings.
2e9b04
+The default (@option{--unicode=default}) is to give them no special
2e9b04
+treatment.  The @option{--unicode=locale} option displays the sequence
2e9b04
+in the current locale, which may or may not support them.  The options
2e9b04
+@option{--unicode=hex} and @option{--unicode=invalid} display them as
2e9b04
+hex byte sequences enclosed by either angle brackets or curly braces.
2e9b04
+
2e9b04
+The @option{--unicode=escape} option displays them as escape sequences
2e9b04
+(@var{\uxxxx}) and the @option{--unicode=highlight} option displays
2e9b04
+them as escape sequences highlighted in red (if supported by the
2e9b04
+output device).  The colouring is intended to draw attention to the
2e9b04
+presence of unicode sequences where they might not be expected.
2e9b04
+
2e9b04
 @item -V
2e9b04
 @itemx --version
2e9b04
 Print the version number of @command{objdump} and exit.
2e9b04
@@ -3117,6 +3149,7 @@ strings [@option{-afovV}] [@option{-}@va
2e9b04
         [@option{-n} @var{min-len}] [@option{--bytes=}@var{min-len}]
2e9b04
         [@option{-t} @var{radix}] [@option{--radix=}@var{radix}]
2e9b04
         [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}]
2e9b04
+        [@option{-U} @var{method}] [@option{--unicode=}@var{method}]
2e9b04
         [@option{-}] [@option{--all}] [@option{--print-file-name}]
2e9b04
         [@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}]
2e9b04
         [@option{-w}] [@option{--include-all-whitespace}]
2e9b04
@@ -3208,6 +3241,28 @@ single-8-bit-byte characters, @samp{b} =
2e9b04
 littleendian.  Useful for finding wide character strings. (@samp{l}
2e9b04
 and @samp{b} apply to, for example, Unicode UTF-16/UCS-2 encodings).
2e9b04
 
2e9b04
+@item -U @var{[d|i|l|e|x|h]}
2e9b04
+@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
2e9b04
+Controls the display of UTF-8 encoded mulibyte characters in strings.
2e9b04
+The default (@option{--unicode=default}) is to give them no special
2e9b04
+treatment, and instead rely upon the setting of the
2e9b04
+@option{--encoding} option.  The other values for this option
2e9b04
+automatically enable @option{--encoding=S}.
2e9b04
+
2e9b04
+The @option{--unicode=invalid} option treats them as non-graphic
2e9b04
+characters and hence not part of a valid string.  All the remaining
2e9b04
+options treat them as valid string characters.
2e9b04
+
2e9b04
+The @option{--unicode=locale} option displays them in the current
2e9b04
+locale, which may or may not support UTF-8 encoding.  The
2e9b04
+@option{--unicode=hex} option displays them as hex byte sequences
2e9b04
+enclosed between @var{<>} characters.  The @option{--unicode=escape}
2e9b04
+option displays them as escape sequences (@var{\uxxxx}) and the
2e9b04
+@option{--unicode=highlight} option displays them as escape sequences
2e9b04
+highlighted in red (if supported by the output device).  The colouring
2e9b04
+is intended to draw attention to the presence of unicode sequences
2e9b04
+where they might not be expected.
2e9b04
+
2e9b04
 @item -T @var{bfdname}
2e9b04
 @itemx --target=@var{bfdname}
2e9b04
 @cindex object code format
2e9b04
@@ -4726,6 +4781,7 @@ readelf [@option{-a}|@option{--all}]
2e9b04
         [@option{-W}|@option{--wide}]
2e9b04
         [@option{-T}|@option{--silent-truncation}]
2e9b04
         [@option{-H}|@option{--help}]
2e9b04
+        [@option{-U} @var{method}|@option{--unicode=}@var{method}]
2e9b04
         @var{elffile}@dots{}
2e9b04
 @c man end
2e9b04
 @end smallexample
2e9b04
@@ -4815,6 +4871,28 @@ Displays the entries in dynamic symbol t
2e9b04
 has one.  The output format is the same as the format used by the
2e9b04
 @option{--syms} option.
2e9b04
 
2e9b04
+@item -U @var{[d|i|l|e|x|h]}
2e9b04
+@itemx --unicode=[default|invalid|locale|escape|hex|highlight]
2e9b04
+Controls the display of non-ASCII characters in identifier names.
2e9b04
+The default (@option{--unicode=locale} or @option{--unicode=default}) is
2e9b04
+to treat them as multibyte characters and display them in the current
2e9b04
+locale.  All other versions of this option treat the bytes as UTF-8
2e9b04
+encoded values and attempt to interpret them.  If they cannot be
2e9b04
+interpreted or if the @option{--unicode=invalid} option is used then
2e9b04
+they are displayed as a sequence of hex bytes, encloses in curly
2e9b04
+parethesis characters.
2e9b04
+
2e9b04
+Using the @option{--unicode=escape} option will display the characters
2e9b04
+as as unicode escape sequences (@var{\uxxxx}).  Using the
2e9b04
+@option{--unicode=hex} will display the characters as hex byte
2e9b04
+sequences enclosed between angle brackets.
2e9b04
+
2e9b04
+Using the @option{--unicode=highlight} will display the characters as 
2e9b04
+unicode escape sequences but it will also highlighted them in red,
2e9b04
+assuming that colouring is supported by the output device.  The
2e9b04
+colouring is intended to draw attention to the presence of unicode
2e9b04
+sequences when they might not be expected.
2e9b04
+
2e9b04
 @item -e
2e9b04
 @itemx --headers
2e9b04
 Display all the headers in the file.  Equivalent to @option{-h -l -S}.
2e9b04
diff -rup binutils.orig/binutils/doc/c++filt.1 binutils-2.35.2/binutils/doc/c++filt.1
2e9b04
--- binutils.orig/binutils/doc/c++filt.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/c++filt.1	2021-10-25 12:13:31.698727004 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "C++FILT 1"
2e9b04
-.TH C++FILT 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH C++FILT 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/cxxfilt.man binutils-2.35.2/binutils/doc/cxxfilt.man
2e9b04
--- binutils.orig/binutils/doc/cxxfilt.man	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/cxxfilt.man	2021-10-25 12:13:31.495727660 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "C++FILT 1"
2e9b04
-.TH C++FILT 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH C++FILT 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/dlltool.1 binutils-2.35.2/binutils/doc/dlltool.1
2e9b04
--- binutils.orig/binutils/doc/dlltool.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/dlltool.1	2021-10-25 12:13:31.308728264 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "DLLTOOL 1"
2e9b04
-.TH DLLTOOL 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH DLLTOOL 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/elfedit.1 binutils-2.35.2/binutils/doc/elfedit.1
2e9b04
--- binutils.orig/binutils/doc/elfedit.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/elfedit.1	2021-10-25 12:13:31.427727880 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "ELFEDIT 1"
2e9b04
-.TH ELFEDIT 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH ELFEDIT 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/nm.1 binutils-2.35.2/binutils/doc/nm.1
2e9b04
--- binutils.orig/binutils/doc/nm.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/nm.1	2021-10-25 12:13:31.322728219 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "NM 1"
2e9b04
-.TH NM 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH NM 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
@@ -147,6 +147,7 @@ nm [\fB\-A\fR|\fB\-o\fR|\fB\-\-print\-fi
2e9b04
    [\fB\-D\fR|\fB\-\-dynamic\fR] [\fB\-f\fR\fIformat\fR|\fB\-\-format=\fR\fIformat\fR]
2e9b04
    [\fB\-g\fR|\fB\-\-extern\-only\fR] [\fB\-h\fR|\fB\-\-help\fR]
2e9b04
    [\fB\-l\fR|\fB\-\-line\-numbers\fR] [\fB\-\-inlines\fR]
2e9b04
+   [\fB\-U\fR \fImethod\fR] [\fB\-\-unicode=\fR\fImethod\fR]
2e9b04
    [\fB\-n\fR|\fB\-v\fR|\fB\-\-numeric\-sort\fR]
2e9b04
    [\fB\-P\fR|\fB\-\-portability\fR] [\fB\-p\fR|\fB\-\-no\-sort\fR]
2e9b04
    [\fB\-r\fR|\fB\-\-reverse\-sort\fR] [\fB\-S\fR|\fB\-\-print\-size\fR]
2e9b04
@@ -514,6 +515,24 @@ Use \fIradix\fR as the radix for printin
2e9b04
 .IX Item "--undefined-only"
2e9b04
 .PD
2e9b04
 Display only undefined symbols (those external to each object file).
2e9b04
+.IP "\fB\-U\fR \fI[d|i|l|e|x|h]\fR" 4
2e9b04
+.IX Item "-U [d|i|l|e|x|h]"
2e9b04
+.PD 0
2e9b04
+.IP "\fB\-\-unicode=\fR\fI[default|invalid|locale|escape|hex|highlight]\fR" 4
2e9b04
+.IX Item "--unicode=[default|invalid|locale|escape|hex|highlight]"
2e9b04
+.PD
2e9b04
+Controls the display of \s-1UTF\-8\s0 encoded mulibyte characters in strings.
2e9b04
+The default (\fB\-\-unicode=default\fR) is to give them no special
2e9b04
+treatment.  The \fB\-\-unicode=locale\fR option displays the sequence
2e9b04
+in the current locale, which may or may not support them.  The options
2e9b04
+\&\fB\-\-unicode=hex\fR and \fB\-\-unicode=invalid\fR display them as
2e9b04
+hex byte sequences enclosed by either angle brackets or curly braces.
2e9b04
+.Sp
2e9b04
+The \fB\-\-unicode=escape\fR option displays them as escape sequences
2e9b04
+(\fI\euxxxx\fR) and the \fB\-\-unicode=highlight\fR option displays
2e9b04
+them as escape sequences highlighted in red (if supported by the
2e9b04
+output device).  The colouring is intended to draw attention to the
2e9b04
+presence of unicode sequences where they might not be expected.
2e9b04
 .IP "\fB\-V\fR" 4
2e9b04
 .IX Item "-V"
2e9b04
 .PD 0
2e9b04
diff -rup binutils.orig/binutils/doc/objcopy.1 binutils-2.35.2/binutils/doc/objcopy.1
2e9b04
--- binutils.orig/binutils/doc/objcopy.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/objcopy.1	2021-10-25 12:13:31.363728087 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "OBJCOPY 1"
2e9b04
-.TH OBJCOPY 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH OBJCOPY 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/objdump.1 binutils-2.35.2/binutils/doc/objdump.1
2e9b04
--- binutils.orig/binutils/doc/objdump.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/objdump.1	2021-10-25 12:13:31.370728064 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "OBJDUMP 1"
2e9b04
-.TH OBJDUMP 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH OBJDUMP 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
@@ -190,6 +190,7 @@ objdump [\fB\-a\fR|\fB\-\-archive\-heade
2e9b04
         [\fB\-\-prefix\-strip=\fR\fIlevel\fR]
2e9b04
         [\fB\-\-insn\-width=\fR\fIwidth\fR]
2e9b04
         [\fB\-\-visualize\-jumps[=color|=extended\-color|=off]\fR
2e9b04
+        [\fB\-U\fR \fImethod\fR] [\fB\-\-unicode=\fR\fImethod\fR]
2e9b04
         [\fB\-V\fR|\fB\-\-version\fR]
2e9b04
         [\fB\-H\fR|\fB\-\-help\fR]
2e9b04
         \fIobjfile\fR...
2e9b04
@@ -1265,6 +1266,24 @@ otherwise it's put into parentheses.
2e9b04
 When displaying symbols include those which the target considers to be
2e9b04
 special in some way and which would not normally be of interest to the
2e9b04
 user.
2e9b04
+.IP "\fB\-U\fR \fI[d|i|l|e|x|h]\fR" 4
2e9b04
+.IX Item "-U [d|i|l|e|x|h]"
2e9b04
+.PD 0
2e9b04
+.IP "\fB\-\-unicode=\fR\fI[default|invalid|locale|escape|hex|highlight]\fR" 4
2e9b04
+.IX Item "--unicode=[default|invalid|locale|escape|hex|highlight]"
2e9b04
+.PD
2e9b04
+Controls the display of \s-1UTF\-8\s0 encoded mulibyte characters in strings.
2e9b04
+The default (\fB\-\-unicode=default\fR) is to give them no special
2e9b04
+treatment.  The \fB\-\-unicode=locale\fR option displays the sequence
2e9b04
+in the current locale, which may or may not support them.  The options
2e9b04
+\&\fB\-\-unicode=hex\fR and \fB\-\-unicode=invalid\fR display them as
2e9b04
+hex byte sequences enclosed by either angle brackets or curly braces.
2e9b04
+.Sp
2e9b04
+The \fB\-\-unicode=escape\fR option displays them as escape sequences
2e9b04
+(\fI\euxxxx\fR) and the \fB\-\-unicode=highlight\fR option displays
2e9b04
+them as escape sequences highlighted in red (if supported by the
2e9b04
+output device).  The colouring is intended to draw attention to the
2e9b04
+presence of unicode sequences where they might not be expected.
2e9b04
 .IP "\fB\-V\fR" 4
2e9b04
 .IX Item "-V"
2e9b04
 .PD 0
2e9b04
diff -rup binutils.orig/binutils/doc/ranlib.1 binutils-2.35.2/binutils/doc/ranlib.1
2e9b04
--- binutils.orig/binutils/doc/ranlib.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/ranlib.1	2021-10-25 12:13:31.289728326 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "RANLIB 1"
2e9b04
-.TH RANLIB 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH RANLIB 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/readelf.1 binutils-2.35.2/binutils/doc/readelf.1
2e9b04
--- binutils.orig/binutils/doc/readelf.1	2021-08-16 13:07:33.367206466 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/readelf.1	2021-10-25 12:13:31.419727906 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "READELF 1"
2e9b04
-.TH READELF 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH READELF 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
@@ -177,6 +177,7 @@ readelf [\fB\-a\fR|\fB\-\-all\fR]
2e9b04
         [\fB\-W\fR|\fB\-\-wide\fR]
2e9b04
         [\fB\-T\fR|\fB\-\-silent\-truncation\fR]
2e9b04
         [\fB\-H\fR|\fB\-\-help\fR]
2e9b04
+        [\fB\-U\fR \fImethod\fR|\fB\-\-unicode=\fR\fImethod\fR]
2e9b04
         \fIelffile\fR...
2e9b04
 .SH "DESCRIPTION"
2e9b04
 .IX Header "DESCRIPTION"
2e9b04
@@ -274,6 +275,31 @@ displayed as a suffix preceeded by two @
2e9b04
 Displays the entries in dynamic symbol table section of the file, if it
2e9b04
 has one.  The output format is the same as the format used by the
2e9b04
 \&\fB\-\-syms\fR option.
2e9b04
+.IP "\fB\-U\fR \fI[d|i|l|e|x|h]\fR" 4
2e9b04
+.IX Item "-U [d|i|l|e|x|h]"
2e9b04
+.PD 0
2e9b04
+.IP "\fB\-\-unicode=[default|invalid|locale|escape|hex|highlight]\fR" 4
2e9b04
+.IX Item "--unicode=[default|invalid|locale|escape|hex|highlight]"
2e9b04
+.PD
2e9b04
+Controls the display of non-ASCII characters in identifier names.
2e9b04
+The default (\fB\-\-unicode=locale\fR or \fB\-\-unicode=default\fR) is
2e9b04
+to treat them as multibyte characters and display them in the current
2e9b04
+locale.  All other versions of this option treat the bytes as \s-1UTF\-8\s0
2e9b04
+encoded values and attempt to interpret them.  If they cannot be
2e9b04
+interpreted or if the \fB\-\-unicode=invalid\fR option is used then
2e9b04
+they are displayed as a sequence of hex bytes, encloses in curly
2e9b04
+parethesis characters.
2e9b04
+.Sp
2e9b04
+Using the \fB\-\-unicode=escape\fR option will display the characters
2e9b04
+as as unicode escape sequences (\fI\euxxxx\fR).  Using the
2e9b04
+\&\fB\-\-unicode=hex\fR will display the characters as hex byte
2e9b04
+sequences enclosed between angle brackets.
2e9b04
+.Sp
2e9b04
+Using the \fB\-\-unicode=highlight\fR will display the characters as 
2e9b04
+unicode escape sequences but it will also highlighted them in red,
2e9b04
+assuming that colouring is supported by the output device.  The
2e9b04
+colouring is intended to draw attention to the presence of unicode
2e9b04
+sequences when they might not be expected.
2e9b04
 .IP "\fB\-e\fR" 4
2e9b04
 .IX Item "-e"
2e9b04
 .PD 0
2e9b04
diff -rup binutils.orig/binutils/doc/size.1 binutils-2.35.2/binutils/doc/size.1
2e9b04
--- binutils.orig/binutils/doc/size.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/size.1	2021-10-25 12:13:31.404727954 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "SIZE 1"
2e9b04
-.TH SIZE 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH SIZE 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/strings.1 binutils-2.35.2/binutils/doc/strings.1
2e9b04
--- binutils.orig/binutils/doc/strings.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/strings.1	2021-10-25 12:13:31.408727941 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "STRINGS 1"
2e9b04
-.TH STRINGS 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH STRINGS 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
@@ -146,6 +146,7 @@ strings [\fB\-afovV\fR] [\fB\-\fR\fImin-
2e9b04
         [\fB\-n\fR \fImin-len\fR] [\fB\-\-bytes=\fR\fImin-len\fR]
2e9b04
         [\fB\-t\fR \fIradix\fR] [\fB\-\-radix=\fR\fIradix\fR]
2e9b04
         [\fB\-e\fR \fIencoding\fR] [\fB\-\-encoding=\fR\fIencoding\fR]
2e9b04
+        [\fB\-U\fR \fImethod\fR] [\fB\-\-unicode=\fR\fImethod\fR]
2e9b04
         [\fB\-\fR] [\fB\-\-all\fR] [\fB\-\-print\-file\-name\fR]
2e9b04
         [\fB\-T\fR \fIbfdname\fR] [\fB\-\-target=\fR\fIbfdname\fR]
2e9b04
         [\fB\-w\fR] [\fB\-\-include\-all\-whitespace\fR]
2e9b04
@@ -250,6 +251,31 @@ single\-8\-bit\-byte characters, \fBb\fR
2e9b04
 16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit
2e9b04
 littleendian.  Useful for finding wide character strings. (\fBl\fR
2e9b04
 and \fBb\fR apply to, for example, Unicode \s-1UTF\-16/UCS\-2\s0 encodings).
2e9b04
+.IP "\fB\-U\fR \fI[d|i|l|e|x|h]\fR" 4
2e9b04
+.IX Item "-U [d|i|l|e|x|h]"
2e9b04
+.PD 0
2e9b04
+.IP "\fB\-\-unicode=\fR\fI[default|invalid|locale|escape|hex|highlight]\fR" 4
2e9b04
+.IX Item "--unicode=[default|invalid|locale|escape|hex|highlight]"
2e9b04
+.PD
2e9b04
+Controls the display of \s-1UTF\-8\s0 encoded mulibyte characters in strings.
2e9b04
+The default (\fB\-\-unicode=default\fR) is to give them no special
2e9b04
+treatment, and instead rely upon the setting of the
2e9b04
+\&\fB\-\-encoding\fR option.  The other values for this option
2e9b04
+automatically enable \fB\-\-encoding=S\fR.
2e9b04
+.Sp
2e9b04
+The \fB\-\-unicode=invalid\fR option treats them as non-graphic
2e9b04
+characters and hence not part of a valid string.  All the remaining
2e9b04
+options treat them as valid string characters.
2e9b04
+.Sp
2e9b04
+The \fB\-\-unicode=locale\fR option displays them in the current
2e9b04
+locale, which may or may not support \s-1UTF\-8\s0 encoding.  The
2e9b04
+\&\fB\-\-unicode=hex\fR option displays them as hex byte sequences
2e9b04
+enclosed between \fI<>\fR characters.  The \fB\-\-unicode=escape\fR
2e9b04
+option displays them as escape sequences (\fI\euxxxx\fR) and the
2e9b04
+\&\fB\-\-unicode=highlight\fR option displays them as escape sequences
2e9b04
+highlighted in red (if supported by the output device).  The colouring
2e9b04
+is intended to draw attention to the presence of unicode sequences
2e9b04
+where they might not be expected.
2e9b04
 .IP "\fB\-T\fR \fIbfdname\fR" 4
2e9b04
 .IX Item "-T bfdname"
2e9b04
 .PD 0
2e9b04
diff -rup binutils.orig/binutils/doc/strip.1 binutils-2.35.2/binutils/doc/strip.1
2e9b04
--- binutils.orig/binutils/doc/strip.1	2021-08-16 13:07:33.367206466 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/strip.1	2021-10-25 12:13:31.441727835 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "STRIP 1"
2e9b04
-.TH STRIP 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH STRIP 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/windmc.1 binutils-2.35.2/binutils/doc/windmc.1
2e9b04
--- binutils.orig/binutils/doc/windmc.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/windmc.1	2021-10-25 12:13:31.484727696 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "WINDMC 1"
2e9b04
-.TH WINDMC 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH WINDMC 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
diff -rup binutils.orig/binutils/doc/windres.1 binutils-2.35.2/binutils/doc/windres.1
2e9b04
--- binutils.orig/binutils/doc/windres.1	2021-08-16 13:07:33.366206472 +0100
2e9b04
+++ binutils-2.35.2/binutils/doc/windres.1	2021-10-25 12:13:31.467727751 +0100
2e9b04
@@ -1,4 +1,4 @@
2e9b04
-.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
2e9b04
+.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
2e9b04
 .\"
2e9b04
 .\" Standard preamble:
2e9b04
 .\" ========================================================================
2e9b04
@@ -133,7 +133,7 @@
2e9b04
 .\" ========================================================================
2e9b04
 .\"
2e9b04
 .IX Title "WINDRES 1"
2e9b04
-.TH WINDRES 1 "2021-01-30" "binutils-2.35.2" "GNU Development Tools"
2e9b04
+.TH WINDRES 1 "2021-10-25" "binutils-2.35.2" "GNU Development Tools"
2e9b04
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
2e9b04
 .\" way too many mistakes in technical documents.
2e9b04
 .if n .ad l
2e9b04
Only in binutils-2.35.2/binutils/: filemode.o
2e9b04
Only in binutils-2.35.2/binutils/: libtool
2e9b04
diff -rup binutils.orig/binutils/nm.c binutils-2.35.2/binutils/nm.c
2e9b04
--- binutils.orig/binutils/nm.c	2021-08-16 13:07:33.367206466 +0100
2e9b04
+++ binutils-2.35.2/binutils/nm.c	2021-10-25 12:12:22.313951236 +0100
2e9b04
@@ -38,6 +38,11 @@
2e9b04
 #include "bucomm.h"
2e9b04
 #include "plugin-api.h"
2e9b04
 #include "plugin.h"
2e9b04
+#include "safe-ctype.h"
2e9b04
+
2e9b04
+#ifndef streq
2e9b04
+#define streq(a,b) (strcmp ((a),(b)) == 0)
2e9b04
+#endif
2e9b04
 
2e9b04
 /* When sorting by size, we use this structure to hold the size and a
2e9b04
    pointer to the minisymbol.  */
2e9b04
@@ -185,6 +190,18 @@ static const char *plugin_target = NULL;
2e9b04
 static bfd *lineno_cache_bfd;
2e9b04
 static bfd *lineno_cache_rel_bfd;
2e9b04
 
2e9b04
+typedef enum unicode_display_type
2e9b04
+{
2e9b04
+  unicode_default = 0,
2e9b04
+  unicode_locale,
2e9b04
+  unicode_escape,
2e9b04
+  unicode_hex,
2e9b04
+  unicode_highlight,
2e9b04
+  unicode_invalid
2e9b04
+} unicode_display_type;
2e9b04
+
2e9b04
+static unicode_display_type unicode_display = unicode_default;
2e9b04
+
2e9b04
 enum long_option_values
2e9b04
 {
2e9b04
   OPTION_TARGET = 200,
2e9b04
@@ -225,6 +242,7 @@ static struct option long_options[] =
2e9b04
   {"target", required_argument, 0, OPTION_TARGET},
2e9b04
   {"defined-only", no_argument, &defined_only, 1},
2e9b04
   {"undefined-only", no_argument, &undefined_only, 1},
2e9b04
+  {"unicode", required_argument, NULL, 'U'},
2e9b04
   {"version", no_argument, &show_version, 1},
2e9b04
   {"with-symbol-versions", no_argument, NULL,
2e9b04
    OPTION_WITH_SYMBOL_VERSIONS},
2e9b04
@@ -275,6 +293,8 @@ usage (FILE *stream, int status)
2e9b04
   -t, --radix=RADIX      Use RADIX for printing symbol values\n\
2e9b04
       --target=BFDNAME   Specify the target object format as BFDNAME\n\
2e9b04
   -u, --undefined-only   Display only undefined symbols\n\
2e9b04
+  -U {d|s|i|x|e|h}       Specify how to treat UTF-8 encoded unicode characters\n\
2e9b04
+      --unicode={default|show|invalid|hex|escape|highlight}\n\
2e9b04
       --with-symbol-versions  Display version strings after symbol names\n\
2e9b04
   -X 32_64               (ignored)\n\
2e9b04
   @FILE                  Read options from FILE\n\
2e9b04
@@ -390,6 +410,189 @@ get_coff_symbol_type (const struct inter
2e9b04
   return bufp;
2e9b04
 }
2e9b04
 
2e9b04
+/* Convert a potential UTF-8 encoded sequence in IN into characters in OUT.
2e9b04
+   The conversion format is controlled by the unicode_display variable.
2e9b04
+   Returns the number of characters added to OUT.
2e9b04
+   Returns the number of bytes consumed from IN in CONSUMED.
2e9b04
+   Always consumes at least one byte and displays at least one character.  */
2e9b04
+   
2e9b04
+static unsigned int
2e9b04
+display_utf8 (const unsigned char * in, char * out, unsigned int * consumed)
2e9b04
+{
2e9b04
+  char *        orig_out = out;
2e9b04
+  unsigned int  nchars = 0;
2e9b04
+
2e9b04
+  if (unicode_display == unicode_default)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  if (in[0] < 0xc0)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  if ((in[1] & 0xc0) != 0x80)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  if ((in[0] & 0x20) == 0)
2e9b04
+    {
2e9b04
+      nchars = 2;
2e9b04
+      goto valid;
2e9b04
+    }
2e9b04
+
2e9b04
+  if ((in[2] & 0xc0) != 0x80)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  if ((in[0] & 0x10) == 0)
2e9b04
+    {
2e9b04
+      nchars = 3;
2e9b04
+      goto valid;
2e9b04
+    }
2e9b04
+
2e9b04
+  if ((in[3] & 0xc0) != 0x80)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  nchars = 4;
2e9b04
+
2e9b04
+ valid:
2e9b04
+  switch (unicode_display)
2e9b04
+    {
2e9b04
+    case unicode_locale:
2e9b04
+      /* Copy the bytes into the output buffer as is.  */
2e9b04
+      memcpy (out, in, nchars);
2e9b04
+      out += nchars;
2e9b04
+      break;
2e9b04
+
2e9b04
+    case unicode_invalid:
2e9b04
+    case unicode_hex:
2e9b04
+      {
2e9b04
+      unsigned int j;
2e9b04
+
2e9b04
+      out += sprintf (out, "%c", unicode_display == unicode_hex ? '<' : '{');
2e9b04
+      for (j = 0; j < nchars; j++)
2e9b04
+	out += sprintf (out, "%02x", in [j]);
2e9b04
+      out += sprintf (out, "%c", unicode_display == unicode_hex ? '>' : '}');
2e9b04
+      }
2e9b04
+      break;
2e9b04
+      
2e9b04
+    case unicode_highlight:
2e9b04
+      if (isatty (1))
2e9b04
+	out += sprintf (out, "\x1B[31;47m"); /* Red.  */
2e9b04
+      /* Fall through.  */
2e9b04
+    case unicode_escape:
2e9b04
+      switch (nchars)
2e9b04
+	{
2e9b04
+	case 2:
2e9b04
+	  out += sprintf (out, "\\u%02x%02x",
2e9b04
+		  ((in[0] & 0x1c) >> 2), 
2e9b04
+		  ((in[0] & 0x03) << 6) | (in[1] & 0x3f));
2e9b04
+	  break;
2e9b04
+
2e9b04
+	case 3:
2e9b04
+	  out += sprintf (out, "\\u%02x%02x",
2e9b04
+		  ((in[0] & 0x0f) << 4) | ((in[1] & 0x3c) >> 2),
2e9b04
+		  ((in[1] & 0x03) << 6) | ((in[2] & 0x3f)));
2e9b04
+	  break;
2e9b04
+
2e9b04
+	case 4:
2e9b04
+	  out += sprintf (out, "\\u%02x%02x%02x",
2e9b04
+		  ((in[0] & 0x07) << 6) | ((in[1] & 0x3c) >> 2),
2e9b04
+		  ((in[1] & 0x03) << 6) | ((in[2] & 0x3c) >> 2),
2e9b04
+		  ((in[2] & 0x03) << 6) | ((in[3] & 0x3f)));
2e9b04
+	  break;
2e9b04
+	default:
2e9b04
+	  /* URG.  */
2e9b04
+	  break;
2e9b04
+	}
2e9b04
+
2e9b04
+      if (unicode_display == unicode_highlight && isatty (1))
2e9b04
+	out += sprintf (out, "\033[0m"); /* Default colour.  */
2e9b04
+      break;
2e9b04
+
2e9b04
+    default:
2e9b04
+      /* URG */
2e9b04
+      break;
2e9b04
+    }
2e9b04
+
2e9b04
+  * consumed = nchars;
2e9b04
+  return out - orig_out;
2e9b04
+
2e9b04
+ invalid:
2e9b04
+  /* Not a valid UTF-8 sequence.  */
2e9b04
+  *out = *in;
2e9b04
+  * consumed = 1;
2e9b04
+  return 1;
2e9b04
+}
2e9b04
+
2e9b04
+/* Convert any UTF-8 encoded characters in NAME into the form specified by
2e9b04
+   unicode_display.  Also converts control characters.  Returns a static
2e9b04
+   buffer if conversion was necessary.
2e9b04
+   Code stolen from objdump.c:sanitize_string().  */
2e9b04
+
2e9b04
+static const char *
2e9b04
+convert_utf8 (const char * in)
2e9b04
+{
2e9b04
+  static char *  buffer = NULL;
2e9b04
+  static size_t  buffer_len = 0;
2e9b04
+  const char *   original = in;
2e9b04
+  char *         out;
2e9b04
+
2e9b04
+  /* Paranoia.  */
2e9b04
+  if (in == NULL)
2e9b04
+    return "";
2e9b04
+
2e9b04
+  /* See if any conversion is necessary.
2e9b04
+     In the majority of cases it will not be needed.  */
2e9b04
+  do
2e9b04
+    {
2e9b04
+      unsigned char c = *in++;
2e9b04
+
2e9b04
+      if (c == 0)
2e9b04
+	return original;
2e9b04
+
2e9b04
+      if (ISCNTRL (c))
2e9b04
+	break;
2e9b04
+
2e9b04
+      if (unicode_display != unicode_default && c >= 0xc0)
2e9b04
+	break;
2e9b04
+    }
2e9b04
+  while (1);
2e9b04
+
2e9b04
+  /* Copy the input, translating as needed.  */
2e9b04
+  in = original;
2e9b04
+  if (buffer_len < (strlen (in) * 9))
2e9b04
+    {
2e9b04
+      free ((void *) buffer);
2e9b04
+      buffer_len = strlen (in) * 9;
2e9b04
+      buffer = xmalloc (buffer_len + 1);
2e9b04
+    }
2e9b04
+
2e9b04
+  out = buffer;
2e9b04
+  do
2e9b04
+    {
2e9b04
+      unsigned char c = *in++;
2e9b04
+
2e9b04
+      if (c == 0)
2e9b04
+	break;
2e9b04
+
2e9b04
+      if (ISCNTRL (c))
2e9b04
+	{
2e9b04
+	  *out++ = '^';
2e9b04
+	  *out++ = c + 0x40;
2e9b04
+	}
2e9b04
+      else if (unicode_display != unicode_default && c >= 0xc0)
2e9b04
+	{
2e9b04
+	  unsigned int num_consumed;
2e9b04
+
2e9b04
+	  out += display_utf8 ((const unsigned char *)(in - 1), out, & num_consumed);
2e9b04
+	  in += num_consumed - 1;
2e9b04
+	}
2e9b04
+      else
2e9b04
+	*out++ = c;
2e9b04
+    }
2e9b04
+  while (1);
2e9b04
+
2e9b04
+  *out = 0;
2e9b04
+  return buffer;
2e9b04
+}
2e9b04
+
2e9b04
 /* Print symbol name NAME, read from ABFD, with printf format FORM,
2e9b04
    demangling it if requested.  */
2e9b04
 
2e9b04
@@ -408,6 +611,9 @@ print_symname (const char *form, struct
2e9b04
 	name = alloc;
2e9b04
     }
2e9b04
 
2e9b04
+  if (unicode_display != unicode_default)
2e9b04
+    name = convert_utf8 (name);
2e9b04
+
2e9b04
   if (info != NULL && info->elfinfo)
2e9b04
     {
2e9b04
       const char *version_string;
2e9b04
@@ -1716,7 +1922,7 @@ main (int argc, char **argv)
2e9b04
     fatal (_("fatal error: libbfd ABI mismatch"));
2e9b04
   set_default_bfd_target ();
2e9b04
 
2e9b04
-  while ((c = getopt_long (argc, argv, "aABCDef:gHhlnopPrSst:uvVvX:",
2e9b04
+  while ((c = getopt_long (argc, argv, "aABCDef:gHhlnopPrSst:uU:vVvX:",
2e9b04
 			   long_options, (int *) 0)) != EOF)
2e9b04
     {
2e9b04
       switch (c)
2e9b04
@@ -1806,6 +2012,24 @@ main (int argc, char **argv)
2e9b04
 	case 'u':
2e9b04
 	  undefined_only = 1;
2e9b04
 	  break;
2e9b04
+
2e9b04
+	case 'U':
2e9b04
+	  if (streq (optarg, "default") || streq (optarg, "d"))
2e9b04
+	    unicode_display = unicode_default;
2e9b04
+	  else if (streq (optarg, "locale") || streq (optarg, "l"))
2e9b04
+	    unicode_display = unicode_locale;
2e9b04
+	  else if (streq (optarg, "escape") || streq (optarg, "e"))
2e9b04
+	    unicode_display = unicode_escape;
2e9b04
+	  else if (streq (optarg, "invalid") || streq (optarg, "i"))
2e9b04
+	    unicode_display = unicode_invalid;
2e9b04
+	  else if (streq (optarg, "hex") || streq (optarg, "x"))
2e9b04
+	    unicode_display = unicode_hex;
2e9b04
+	  else if (streq (optarg, "highlight") || streq (optarg, "h"))
2e9b04
+	    unicode_display = unicode_highlight;
2e9b04
+	  else
2e9b04
+	    fatal (_("invalid argument to -U/--unicode: %s"), optarg);
2e9b04
+	  break;
2e9b04
+
2e9b04
 	case 'V':
2e9b04
 	  show_version = 1;
2e9b04
 	  break;
2e9b04
diff -rup binutils.orig/binutils/objdump.c binutils-2.35.2/binutils/objdump.c
2e9b04
--- binutils.orig/binutils/objdump.c	2021-08-16 13:07:33.368206459 +0100
2e9b04
+++ binutils-2.35.2/binutils/objdump.c	2021-10-25 12:16:10.140214947 +0100
2e9b04
@@ -205,6 +205,18 @@ static const struct objdump_private_desc
2e9b04
 
2e9b04
 /* The list of detected jumps inside a function.  */
2e9b04
 static struct jump_info *detected_jumps = NULL;
2e9b04
+
2e9b04
+typedef enum unicode_display_type
2e9b04
+{
2e9b04
+  unicode_default = 0,
2e9b04
+  unicode_locale,
2e9b04
+  unicode_escape,
2e9b04
+  unicode_hex,
2e9b04
+  unicode_highlight,
2e9b04
+  unicode_invalid
2e9b04
+} unicode_display_type;
2e9b04
+
2e9b04
+static unicode_display_type unicode_display = unicode_default;
2e9b04
 
2e9b04
 static void usage (FILE *, int) ATTRIBUTE_NORETURN;
2e9b04
 static void
2e9b04
@@ -247,6 +259,9 @@ usage (FILE *stream, int status)
2e9b04
   -r, --reloc              Display the relocation entries in the file\n\
2e9b04
   -R, --dynamic-reloc      Display the dynamic relocation entries in the file\n\
2e9b04
   @<file>                  Read options from <file>\n\
2e9b04
+  -U[d|l|i|x|e|h]          Controls the display of UTF-8 unicode characters\n\
2e9b04
+  --unicode=[default|locale|invalid|hex|escape|highlight]\n"));
2e9b04
+      fprintf (stream, _("\
2e9b04
   -v, --version            Display this program's version number\n\
2e9b04
   -i, --info               List object formats and architectures supported\n\
2e9b04
   -H, --help               Display this information\n\
2e9b04
@@ -395,6 +410,7 @@ static struct option long_options[]=
2e9b04
   {"stop-address", required_argument, NULL, OPTION_STOP_ADDRESS},
2e9b04
   {"syms", no_argument, NULL, 't'},
2e9b04
   {"target", required_argument, NULL, 'b'},
2e9b04
+  {"unicode", required_argument, NULL, 'U'},
2e9b04
   {"version", no_argument, NULL, 'V'},
2e9b04
   {"wide", no_argument, NULL, 'w'},
2e9b04
   {"prefix", required_argument, NULL, OPTION_PREFIX},
2e9b04
@@ -415,9 +431,123 @@ nonfatal (const char *msg)
2e9b04
   exit_status = 1;
2e9b04
 }
2e9b04
 
2e9b04
+/* Convert a potential UTF-8 encoded sequence in IN into characters in OUT.
2e9b04
+   The conversion format is controlled by the unicode_display variable.
2e9b04
+   Returns the number of characters added to OUT.
2e9b04
+   Returns the number of bytes consumed from IN in CONSUMED.
2e9b04
+   Always consumes at least one byte and displays at least one character.  */
2e9b04
+   
2e9b04
+static unsigned int
2e9b04
+display_utf8 (const unsigned char * in, char * out, unsigned int * consumed)
2e9b04
+{
2e9b04
+  char *        orig_out = out;
2e9b04
+  unsigned int  nchars = 0;
2e9b04
+
2e9b04
+  if (unicode_display == unicode_default)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  if (in[0] < 0xc0)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  if ((in[1] & 0xc0) != 0x80)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  if ((in[0] & 0x20) == 0)
2e9b04
+    {
2e9b04
+      nchars = 2;
2e9b04
+      goto valid;
2e9b04
+    }
2e9b04
+
2e9b04
+  if ((in[2] & 0xc0) != 0x80)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  if ((in[0] & 0x10) == 0)
2e9b04
+    {
2e9b04
+      nchars = 3;
2e9b04
+      goto valid;
2e9b04
+    }
2e9b04
+
2e9b04
+  if ((in[3] & 0xc0) != 0x80)
2e9b04
+    goto invalid;
2e9b04
+
2e9b04
+  nchars = 4;
2e9b04
+
2e9b04
+ valid:
2e9b04
+  switch (unicode_display)
2e9b04
+    {
2e9b04
+    case unicode_locale:
2e9b04
+      /* Copy the bytes into the output buffer as is.  */
2e9b04
+      memcpy (out, in, nchars);
2e9b04
+      out += nchars;
2e9b04
+      break;
2e9b04
+
2e9b04
+    case unicode_invalid:
2e9b04
+    case unicode_hex:
2e9b04
+      {
2e9b04
+      unsigned int j;
2e9b04
+
2e9b04
+      out += sprintf (out, "%c", unicode_display == unicode_hex ? '<' : '{');
2e9b04
+      for (j = 0; j < nchars; j++)
2e9b04
+	out += sprintf (out, "%02x", in [j]);
2e9b04
+      out += sprintf (out, "%c", unicode_display == unicode_hex ? '>' : '}');
2e9b04
+      }
2e9b04
+      break;
2e9b04
+      
2e9b04
+    case unicode_highlight:
2e9b04
+      if (isatty (1))
2e9b04
+	out += sprintf (out, "\x1B[31;47m"); /* Red.  */
2e9b04
+      /* Fall through.  */
2e9b04
+    case unicode_escape:
2e9b04
+      switch (nchars)
2e9b04
+	{
2e9b04
+	case 2:
2e9b04
+	  out += sprintf (out, "\\u%02x%02x",
2e9b04
+		  ((in[0] & 0x1c) >> 2), 
2e9b04
+		  ((in[0] & 0x03) << 6) | (in[1] & 0x3f));
2e9b04
+	  break;
2e9b04
+
2e9b04
+	case 3:
2e9b04
+	  out += sprintf (out, "\\u%02x%02x",
2e9b04
+		  ((in[0] & 0x0f) << 4) | ((in[1] & 0x3c) >> 2),
2e9b04
+		  ((in[1] & 0x03) << 6) | ((in[2] & 0x3f)));
2e9b04
+	  break;
2e9b04
+
2e9b04
+	case 4:
2e9b04
+	  out += sprintf (out, "\\u%02x%02x%02x",
2e9b04
+		  ((in[0] & 0x07) << 6) | ((in[1] & 0x3c) >> 2),
2e9b04
+		  ((in[1] & 0x03) << 6) | ((in[2] & 0x3c) >> 2),
2e9b04
+		  ((in[2] & 0x03) << 6) | ((in[3] & 0x3f)));
2e9b04
+	  break;
2e9b04
+	default:
2e9b04
+	  /* URG.  */
2e9b04
+	  break;
2e9b04
+	}
2e9b04
+
2e9b04
+      if (unicode_display == unicode_highlight && isatty (1))
2e9b04
+	out += sprintf (out, "\033[0m"); /* Default colour.  */
2e9b04
+      break;
2e9b04
+
2e9b04
+    default:
2e9b04
+      /* URG */
2e9b04
+      break;
2e9b04
+    }
2e9b04
+
2e9b04
+  * consumed = nchars;
2e9b04
+  return out - orig_out;
2e9b04
+
2e9b04
+ invalid:
2e9b04
+  /* Not a valid UTF-8 sequence.  */
2e9b04
+  *out = *in;
2e9b04
+  * consumed = 1;
2e9b04
+  return 1;
2e9b04
+}
2e9b04
+
2e9b04
 /* Returns a version of IN with any control characters
2e9b04
    replaced by escape sequences.  Uses a static buffer
2e9b04
-   if necessary.  */
2e9b04
+   if necessary.
2e9b04
+
2e9b04
+   If unicode display is enabled, then also handles the
2e9b04
+   conversion of unicode characters.  */
2e9b04
 
2e9b04
 static const char *
2e9b04
 sanitize_string (const char * in)
2e9b04
@@ -435,40 +565,50 @@ sanitize_string (const char * in)
2e9b04
      of cases it will not be needed.  */
2e9b04
   do
2e9b04
     {
2e9b04
-      char c = *in++;
2e9b04
+      unsigned char c = *in++;
2e9b04
 
2e9b04
       if (c == 0)
2e9b04
 	return original;
2e9b04
 
2e9b04
       if (ISCNTRL (c))
2e9b04
 	break;
2e9b04
+
2e9b04
+      if (unicode_display != unicode_default && c >= 0xc0)
2e9b04
+	break;
2e9b04
     }
2e9b04
   while (1);
2e9b04
 
2e9b04
   /* Copy the input, translating as needed.  */
2e9b04
   in = original;
2e9b04
-  if (buffer_len < (strlen (in) * 2))
2e9b04
+  if (buffer_len < (strlen (in) * 9))
2e9b04
     {
2e9b04
       free ((void *) buffer);
2e9b04
-      buffer_len = strlen (in) * 2;
2e9b04
+      buffer_len = strlen (in) * 9;
2e9b04
       buffer = xmalloc (buffer_len + 1);
2e9b04
     }
2e9b04
 
2e9b04
   out = buffer;
2e9b04
   do
2e9b04
     {
2e9b04
-      char c = *in++;
2e9b04
+      unsigned char c = *in++;
2e9b04
 
2e9b04
       if (c == 0)
2e9b04
 	break;
2e9b04
 
2e9b04
-      if (!ISCNTRL (c))
2e9b04
-	*out++ = c;
2e9b04
-      else
2e9b04
+      if (ISCNTRL (c))
2e9b04
 	{
2e9b04
 	  *out++ = '^';
2e9b04
 	  *out++ = c + 0x40;
2e9b04
 	}
2e9b04
+      else if (unicode_display != unicode_default && c >= 0xc0)
2e9b04
+	{
2e9b04
+	  unsigned int num_consumed;
2e9b04
+
2e9b04
+	  out += display_utf8 ((const unsigned char *)(in - 1), out, & num_consumed);
2e9b04
+	  in += num_consumed - 1;
2e9b04
+	}
2e9b04
+      else
2e9b04
+	*out++ = c;
2e9b04
     }
2e9b04
   while (1);
2e9b04
 
2e9b04
@@ -476,7 +616,6 @@ sanitize_string (const char * in)
2e9b04
   return buffer;
2e9b04
 }
2e9b04
 
2e9b04
-
2e9b04
 /* Returns TRUE if the specified section should be dumped.  */
2e9b04
 
2e9b04
 static bfd_boolean
2e9b04
@@ -1055,6 +1194,8 @@ objdump_print_symname (bfd *abfd, struct
2e9b04
 
2e9b04
   name = sanitize_string (name);
2e9b04
 
2e9b04
+  name = sanitize_string (name);
2e9b04
+
2e9b04
   if (inf != NULL)
2e9b04
     {
2e9b04
       (*inf->fprintf_func) (inf->stream, "%s", name);
2e9b04
@@ -3136,7 +3277,7 @@ disassemble_section (bfd *abfd, asection
2e9b04
   if (!bfd_malloc_and_get_section (abfd, section, &data))
2e9b04
     {
2e9b04
       non_fatal (_("Reading section %s failed because: %s"),
2e9b04
-		 section->name, bfd_errmsg (bfd_get_error ()));
2e9b04
+		 sanitize_string (section->name), bfd_errmsg (bfd_get_error ()));
2e9b04
       return;
2e9b04
     }
2e9b04
 
2e9b04
@@ -4307,7 +4448,7 @@ dump_section (bfd *abfd, asection *secti
2e9b04
   if (!bfd_get_full_section_contents (abfd, section, &data))
2e9b04
     {
2e9b04
       non_fatal (_("Reading section %s failed because: %s"),
2e9b04
-		 section->name, bfd_errmsg (bfd_get_error ()));
2e9b04
+		 sanitize_string (section->name), bfd_errmsg (bfd_get_error ()));
2e9b04
       return;
2e9b04
     }
2e9b04
 
2e9b04
@@ -4447,6 +4588,24 @@ dump_symbols (bfd *abfd ATTRIBUTE_UNUSED
2e9b04
 		  free (alloc);
2e9b04
 		}
2e9b04
 	    }
2e9b04
+	  else if (unicode_display != unicode_default
2e9b04
+		   && name != NULL && *name != '\0')
2e9b04
+	    {
2e9b04
+	      const char * sanitized_name;
2e9b04
+
2e9b04
+	      /* If we want to sanitize the name, we do it here, and
2e9b04
+		 temporarily clobber it while calling bfd_print_symbol.
2e9b04
+		 FIXME: This is a gross hack.  */
2e9b04
+	      sanitized_name = sanitize_string (name);
2e9b04
+	      if (sanitized_name != name)
2e9b04
+		(*current)->name = sanitized_name;
2e9b04
+	      else
2e9b04
+		sanitized_name = NULL;
2e9b04
+	      bfd_print_symbol (cur_bfd, stdout, *current,
2e9b04
+				bfd_print_symbol_all);
2e9b04
+	      if (sanitized_name != NULL)
2e9b04
+		(*current)->name = name;
2e9b04
+	    }
2e9b04
 	  else
2e9b04
 	    bfd_print_symbol (cur_bfd, stdout, *current,
2e9b04
 			      bfd_print_symbol_all);
2e9b04
@@ -5128,7 +5287,7 @@ main (int argc, char **argv)
2e9b04
   set_default_bfd_target ();
2e9b04
 
2e9b04
   while ((c = getopt_long (argc, argv,
2e9b04
-			   "pP:ib:m:M:VvCdDlfFaHhrRtTxsSI:j:wE:zgeGW::",
2e9b04
+			   "pP:ib:m:M:VvCdDlfFaHhrRtTxsSI:j:wE:zgeGW::U:",
2e9b04
 			   long_options, (int *) 0))
2e9b04
 	 != EOF)
2e9b04
     {
2e9b04
@@ -5407,6 +5566,23 @@ main (int argc, char **argv)
2e9b04
 	  seenflag = TRUE;
2e9b04
 	  break;
2e9b04
 
2e9b04
+	case 'U':
2e9b04
+	  if (streq (optarg, "default") || streq (optarg, "d"))
2e9b04
+	    unicode_display = unicode_default;
2e9b04
+	  else if (streq (optarg, "locale") || streq (optarg, "l"))
2e9b04
+	    unicode_display = unicode_locale;
2e9b04
+	  else if (streq (optarg, "escape") || streq (optarg, "e"))
2e9b04
+	    unicode_display = unicode_escape;
2e9b04
+	  else if (streq (optarg, "invalid") || streq (optarg, "i"))
2e9b04
+	    unicode_display = unicode_invalid;
2e9b04
+	  else if (streq (optarg, "hex") || streq (optarg, "x"))
2e9b04
+	    unicode_display = unicode_hex;
2e9b04
+	  else if (streq (optarg, "highlight") || streq (optarg, "h"))
2e9b04
+	    unicode_display = unicode_highlight;
2e9b04
+	  else
2e9b04
+	    fatal (_("invalid argument to -U/--unicode: %s"), optarg);
2e9b04
+	  break;
2e9b04
+
2e9b04
 	case 'H':
2e9b04
 	  usage (stdout, 0);
2e9b04
 	  /* No need to set seenflag or to break - usage() does not return.  */
2e9b04
Only in binutils-2.35.2/binutils/po: Makefile
2e9b04
Only in binutils-2.35.2/binutils/po: Makefile.in
2e9b04
Only in binutils-2.35.2/binutils/po: POTFILES
2e9b04
diff -rup binutils.orig/binutils/readelf.c binutils-2.35.2/binutils/readelf.c
2e9b04
--- binutils.orig/binutils/readelf.c	2021-08-16 13:07:33.384206359 +0100
2e9b04
+++ binutils-2.35.2/binutils/readelf.c	2021-10-25 12:12:22.318951219 +0100
2e9b04
@@ -317,6 +317,18 @@ typedef enum print_mode
2e9b04
 }
2e9b04
 print_mode;
2e9b04
 
2e9b04
+typedef enum unicode_display_type
2e9b04
+{
2e9b04
+  unicode_locale,
2e9b04
+  unicode_escape,
2e9b04
+  unicode_hex,
2e9b04
+  unicode_highlight,
2e9b04
+  unicode_invalid
2e9b04
+} unicode_display_type;
2e9b04
+
2e9b04
+static unicode_display_type unicode_display = unicode_locale;
2e9b04
+
2e9b04
+  
2e9b04
 /* Versioned symbol info.  */
2e9b04
 enum versioned_symbol_info
2e9b04
 {
2e9b04
@@ -592,11 +604,18 @@ print_symbol (signed int width, const ch
2e9b04
       if (c == 0)
2e9b04
 	break;
2e9b04
 
2e9b04
-      /* Do not print control characters directly as they can affect terminal
2e9b04
-	 settings.  Such characters usually appear in the names generated
2e9b04
-	 by the assembler for local labels.  */
2e9b04
-      if (ISCNTRL (c))
2e9b04
+      if (ISPRINT (c))
2e9b04
+	{
2e9b04
+	  putchar (c);
2e9b04
+	  width_remaining --;
2e9b04
+	  num_printed ++;
2e9b04
+	}
2e9b04
+      else if (ISCNTRL (c))
2e9b04
 	{
2e9b04
+	  /* Do not print control characters directly as they can affect terminal
2e9b04
+	     settings.  Such characters usually appear in the names generated
2e9b04
+	     by the assembler for local labels.  */
2e9b04
+
2e9b04
 	  if (width_remaining < 2)
2e9b04
 	    break;
2e9b04
 
2e9b04
@@ -604,11 +623,135 @@ print_symbol (signed int width, const ch
2e9b04
 	  width_remaining -= 2;
2e9b04
 	  num_printed += 2;
2e9b04
 	}
2e9b04
-      else if (ISPRINT (c))
2e9b04
+      else if (c == 0x7f)
2e9b04
 	{
2e9b04
-	  putchar (c);
2e9b04
-	  width_remaining --;
2e9b04
-	  num_printed ++;
2e9b04
+	  if (width_remaining < 5)
2e9b04
+	    break;
2e9b04
+	  printf ("");
2e9b04
+	  width_remaining -= 5;
2e9b04
+	  num_printed += 5;
2e9b04
+	}
2e9b04
+      else if (unicode_display != unicode_locale)
2e9b04
+	{
2e9b04
+	  /* Display unicode characters as something else.  */
2e9b04
+	  unsigned char bytes[4];
2e9b04
+	  bfd_boolean   is_utf8;
2e9b04
+	  unsigned int  nbytes;
2e9b04
+
2e9b04
+	  bytes[0] = c;
2e9b04
+
2e9b04
+	  if (bytes[0] < 0xc0)
2e9b04
+	    {
2e9b04
+	      nbytes = 1;
2e9b04
+	      is_utf8 = FALSE;
2e9b04
+	    }
2e9b04
+	  else
2e9b04
+	    {
2e9b04
+	      bytes[1] = *symbol++;
2e9b04
+
2e9b04
+	      if ((bytes[1] & 0xc0) != 0x80)
2e9b04
+		{
2e9b04
+		  is_utf8 = FALSE;
2e9b04
+		  /* Do not consume this character.  It may only
2e9b04
+		     be the first byte in the sequence that was
2e9b04
+		     corrupt.  */
2e9b04
+		  --symbol;
2e9b04
+		  nbytes = 1;
2e9b04
+		}
2e9b04
+	      else if ((bytes[0] & 0x20) == 0)
2e9b04
+		{
2e9b04
+		  is_utf8 = TRUE;
2e9b04
+		  nbytes = 2;
2e9b04
+		}
2e9b04
+	      else
2e9b04
+		{
2e9b04
+		  bytes[2] = *symbol++;
2e9b04
+
2e9b04
+		  if ((bytes[2] & 0xc0) != 0x80)
2e9b04
+		    {
2e9b04
+		      is_utf8 = FALSE;
2e9b04
+		      symbol -= 2;
2e9b04
+		      nbytes = 1;
2e9b04
+		    }
2e9b04
+		  else if ((bytes[0] & 0x10) == 0)
2e9b04
+		    {
2e9b04
+		      is_utf8 = TRUE;
2e9b04
+		      nbytes = 3;
2e9b04
+		    }
2e9b04
+		  else
2e9b04
+		    {
2e9b04
+		      bytes[3] = *symbol++;
2e9b04
+
2e9b04
+		      nbytes = 4;
2e9b04
+
2e9b04
+		      if ((bytes[3] & 0xc0) != 0x80)
2e9b04
+			{
2e9b04
+			  is_utf8 = FALSE;
2e9b04
+			  symbol -= 3;
2e9b04
+			  nbytes = 1;
2e9b04
+			}
2e9b04
+		      else
2e9b04
+			is_utf8 = TRUE;
2e9b04
+		    }
2e9b04
+		}
2e9b04
+	    }
2e9b04
+
2e9b04
+	  if (unicode_display == unicode_invalid)
2e9b04
+	    is_utf8 = FALSE;
2e9b04
+
2e9b04
+	  if (unicode_display == unicode_hex || ! is_utf8)
2e9b04
+	    {
2e9b04
+	      unsigned int i;
2e9b04
+
2e9b04
+	      if (width_remaining < (nbytes * 2) + 2)
2e9b04
+		break;
2e9b04
+	  
2e9b04
+	      putchar (is_utf8 ? '<' : '{');
2e9b04
+	      for (i = 0; i < nbytes; i++)
2e9b04
+		printf ("%02x", bytes[i]);
2e9b04
+	      putchar (is_utf8 ? '>' : '}');
2e9b04
+	    }
2e9b04
+	  else
2e9b04
+	    {
2e9b04
+	      if (unicode_display == unicode_highlight && isatty (1))
2e9b04
+		printf ("\x1B[31;47m"); /* Red.  */
2e9b04
+	      
2e9b04
+	      switch (nbytes)
2e9b04
+		{
2e9b04
+		case 2:
2e9b04
+		  if (width_remaining < 6)
2e9b04
+		    break;
2e9b04
+		  printf ("\\u%02x%02x",
2e9b04
+			  (bytes[0] & 0x1c) >> 2, 
2e9b04
+			  ((bytes[0] & 0x03) << 6) | (bytes[1] & 0x3f));
2e9b04
+		  break;
2e9b04
+		case 3:
2e9b04
+		  if (width_remaining < 6)
2e9b04
+		    break;
2e9b04
+		  printf ("\\u%02x%02x",
2e9b04
+			  ((bytes[0] & 0x0f) << 4) | ((bytes[1] & 0x3c) >> 2),
2e9b04
+			  ((bytes[1] & 0x03) << 6) | (bytes[2] & 0x3f));
2e9b04
+		  break;
2e9b04
+		case 4:
2e9b04
+		  if (width_remaining < 8)
2e9b04
+		    break;
2e9b04
+		  printf ("\\u%02x%02x%02x",
2e9b04
+			  ((bytes[0] & 0x07) << 6) | ((bytes[1] & 0x3c) >> 2),
2e9b04
+			  ((bytes[1] & 0x03) << 6) | ((bytes[2] & 0x3c) >> 2),
2e9b04
+			  ((bytes[2] & 0x03) << 6) | (bytes[3] & 0x3f));
2e9b04
+		  
2e9b04
+		  break;
2e9b04
+		default:
2e9b04
+		  /* URG.  */
2e9b04
+		  break;
2e9b04
+		}
2e9b04
+
2e9b04
+	      if (unicode_display == unicode_highlight && isatty (1))
2e9b04
+		printf ("\033[0m"); /* Default colour.  */
2e9b04
+	    }
2e9b04
+	  
2e9b04
+	  if (bytes[nbytes - 1] == 0)
2e9b04
+	    break;
2e9b04
 	}
2e9b04
       else
2e9b04
 	{
2e9b04
@@ -4528,6 +4671,7 @@ static struct option options[] =
2e9b04
   {"ctf-parent",       required_argument, 0, OPTION_CTF_PARENT},
2e9b04
 #endif
2e9b04
 
2e9b04
+  {"unicode",          required_argument, 0, 'U'},
2e9b04
   {"version",	       no_argument, 0, 'v'},
2e9b04
   {"wide",	       no_argument, 0, 'W'},
2e9b04
   {"silent-truncation",no_argument, 0, 'T'},
2e9b04
@@ -4599,6 +4743,11 @@ usage (FILE * stream)
2e9b04
   -I --histogram         Display histogram of bucket list lengths\n\
2e9b04
   -W --wide              Allow output width to exceed 80 characters\n\
2e9b04
   -T --silent-truncation If a symbol name is truncated, do not add a suffix [...]\n\
2e9b04
+  -U --unicode=[locale|escape|hex|highlight|invalid]\n\
2e9b04
+                         Display unicode characters as determined by the current locale\n\
2e9b04
+                          (default), escape sequences, \"<hex sequences>\", highlighted\n\
2e9b04
+                          escape sequences, or treat them as invalid and display as\n\
2e9b04
+                          \"{hex sequences}\"\n\
2e9b04
   @<file>                Read options from <file>\n\
2e9b04
   -H --help              Display this information\n\
2e9b04
   -v --version           Display the version number of readelf\n"));
2e9b04
@@ -4693,7 +4842,7 @@ parse_args (struct dump_data *dumpdata,
2e9b04
     usage (stderr);
2e9b04
 
2e9b04
   while ((c = getopt_long
2e9b04
-	  (argc, argv, "ADHILNR:STVWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF)
2e9b04
+	  (argc, argv, "ADHILNR:STU:VWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF)
2e9b04
     {
2e9b04
       switch (c)
2e9b04
 	{
2e9b04
@@ -4843,6 +4992,25 @@ parse_args (struct dump_data *dumpdata,
2e9b04
 	  request_dump (dumpdata, DISASS_DUMP);
2e9b04
 	  break;
2e9b04
 #endif
2e9b04
+	case 'U':
2e9b04
+	  if (optarg == NULL)
2e9b04
+	    error (_("Missing arg to -U/--unicode")); /* Can this happen ?  */
2e9b04
+	  else if (streq (optarg, "default") || streq (optarg, "d"))
2e9b04
+	    unicode_display = unicode_locale;
2e9b04
+	  else if (streq (optarg, "locale") || streq (optarg, "l"))
2e9b04
+	    unicode_display = unicode_locale;
2e9b04
+	  else if (streq (optarg, "escape") || streq (optarg, "e"))
2e9b04
+	    unicode_display = unicode_escape;
2e9b04
+	  else if (streq (optarg, "invalid") || streq (optarg, "i"))
2e9b04
+	    unicode_display = unicode_invalid;
2e9b04
+	  else if (streq (optarg, "hex") || streq (optarg, "x"))
2e9b04
+	    unicode_display = unicode_hex;
2e9b04
+	  else if (streq (optarg, "highlight") || streq (optarg, "h"))
2e9b04
+	    unicode_display = unicode_highlight;
2e9b04
+	  else
2e9b04
+	    error (_("unknown argument to -U/--unicode: %s"), optarg);
2e9b04
+	  break;
2e9b04
+
2e9b04
 	case 'v':
2e9b04
 	  print_version (program_name);
2e9b04
 	  break;
2e9b04
Only in binutils-2.35.2/binutils/: size.o
2e9b04
Only in binutils-2.35.2/binutils/: stamp-h1
2e9b04
diff -rup binutils.orig/binutils/strings.c binutils-2.35.2/binutils/strings.c
2e9b04
--- binutils.orig/binutils/strings.c	2021-08-16 13:07:33.382206371 +0100
2e9b04
+++ binutils-2.35.2/binutils/strings.c	2021-10-25 12:12:22.319951216 +0100
2e9b04
@@ -55,6 +55,19 @@
2e9b04
    -T {bfdname}
2e9b04
 		Specify a non-default object file format.
2e9b04
 
2e9b04
+  --unicode={default|locale|invalid|hex|escape|highlight}
2e9b04
+  -U {d|l|i|x|e|h}
2e9b04
+                Determine how to handle UTF-8 unicode characters.  The default
2e9b04
+		is no special treatment.  All other versions of this option
2e9b04
+		only apply if the encoding is valid and enabling the option
2e9b04
+		implies --encoding=S.
2e9b04
+		The 'locale' option displays the characters according to the
2e9b04
+		current locale.  The 'invalid' option treats them as
2e9b04
+		non-string characters.  The 'hex' option displays them as hex
2e9b04
+		byte sequences.  The 'escape' option displays them as escape
2e9b04
+		sequences and the 'highlight' option displays them as
2e9b04
+		coloured escape sequences.
2e9b04
+
2e9b04
   --output-separator=sep_string
2e9b04
   -s sep_string	String used to separate parsed strings in output.
2e9b04
 		Default is newline.
2e9b04
@@ -76,6 +89,22 @@
2e9b04
 #include "safe-ctype.h"
2e9b04
 #include "bucomm.h"
2e9b04
 
2e9b04
+#ifndef streq
2e9b04
+#define streq(a,b) (strcmp ((a),(b)) == 0)
2e9b04
+#endif
2e9b04
+
2e9b04
+typedef enum unicode_display_type
2e9b04
+{
2e9b04
+  unicode_default = 0,
2e9b04
+  unicode_locale,
2e9b04
+  unicode_escape,
2e9b04
+  unicode_hex,
2e9b04
+  unicode_highlight,
2e9b04
+  unicode_invalid
2e9b04
+} unicode_display_type;
2e9b04
+
2e9b04
+static unicode_display_type unicode_display = unicode_default;
2e9b04
+
2e9b04
 #define STRING_ISGRAPHIC(c) \
2e9b04
       (   (c) >= 0 \
2e9b04
        && (c) <= 255 \
2e9b04
@@ -94,7 +123,7 @@ extern int errno;
2e9b04
 static int address_radix;
2e9b04
 
2e9b04
 /* Minimum length of sequence of graphic chars to trigger output.  */
2e9b04
-static int string_min;
2e9b04
+static uint string_min;
2e9b04
 
2e9b04
 /* Whether or not we include all whitespace as a graphic char.   */
2e9b04
 static bfd_boolean include_all_whitespace;
2e9b04
@@ -130,6 +159,7 @@ static struct option long_options[] =
2e9b04
   {"target", required_argument, NULL, 'T'},
2e9b04
   {"output-separator", required_argument, NULL, 's'},
2e9b04
   {"help", no_argument, NULL, 'h'},
2e9b04
+  {"unicode", required_argument, NULL, 'U'},
2e9b04
   {"version", no_argument, NULL, 'v'},
2e9b04
   {NULL, 0, NULL, 0}
2e9b04
 };
2e9b04
@@ -173,7 +203,7 @@ main (int argc, char **argv)
2e9b04
   encoding = 's';
2e9b04
   output_separator = NULL;
2e9b04
 
2e9b04
-  while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:Vv0123456789",
2e9b04
+  while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:U:Vv0123456789",
2e9b04
 			      long_options, (int *) 0)) != EOF)
2e9b04
     {
2e9b04
       switch (optc)
2e9b04
@@ -246,6 +276,23 @@ main (int argc, char **argv)
2e9b04
 	  output_separator = optarg;
2e9b04
           break;
2e9b04
 
2e9b04
+	case 'U':
2e9b04
+	  if (streq (optarg, "default") || streq (optarg, "d"))
2e9b04
+	    unicode_display = unicode_default;
2e9b04
+	  else if (streq (optarg, "locale") || streq (optarg, "l"))
2e9b04
+	    unicode_display = unicode_locale;
2e9b04
+	  else if (streq (optarg, "escape") || streq (optarg, "e"))
2e9b04
+	    unicode_display = unicode_escape;
2e9b04
+	  else if (streq (optarg, "invalid") || streq (optarg, "i"))
2e9b04
+	    unicode_display = unicode_invalid;
2e9b04
+	  else if (streq (optarg, "hex") || streq (optarg, "x"))
2e9b04
+	    unicode_display = unicode_hex;
2e9b04
+	  else if (streq (optarg, "highlight") || streq (optarg, "h"))
2e9b04
+	    unicode_display = unicode_highlight;
2e9b04
+	  else
2e9b04
+	    fatal (_("invalid argument to -U/--unicode: %s"), optarg);
2e9b04
+	  break;
2e9b04
+
2e9b04
 	case 'V':
2e9b04
 	case 'v':
2e9b04
 	  print_version ("strings");
2e9b04
@@ -260,6 +307,9 @@ main (int argc, char **argv)
2e9b04
 	}
2e9b04
     }
2e9b04
 
2e9b04
+  if (unicode_display != unicode_default)
2e9b04
+    encoding = 'S';
2e9b04
+
2e9b04
   if (numeric_opt != 0)
2e9b04
     {
2e9b04
       string_min = (int) strtoul (argv[numeric_opt - 1] + 1, &s, 0);
2e9b04
@@ -553,11 +603,629 @@ unget_part_char (long c, file_ptr *addre
2e9b04
 	}
2e9b04
     }
2e9b04
 }
2e9b04
+
2e9b04
+static void
2e9b04
+print_filename_and_address (const char * filename, file_ptr address)
2e9b04
+{
2e9b04
+  if (print_filenames)
2e9b04
+    printf ("%s: ", filename);
2e9b04
+
2e9b04
+  if (! print_addresses)
2e9b04
+    return;
2e9b04
+
2e9b04
+  switch (address_radix)
2e9b04
+    {
2e9b04
+    case 8:
2e9b04
+      if (sizeof (address) > sizeof (long))
2e9b04
+	{
2e9b04
+#ifndef __MSVCRT__
2e9b04
+	  printf ("%7llo ", (unsigned long long) address);
2e9b04
+#else
2e9b04
+	  printf ("%7I64o ", (unsigned long long) address);
2e9b04
+#endif
2e9b04
+	}
2e9b04
+      else
2e9b04
+	printf ("%7lo ", (unsigned long) address);
2e9b04
+      break;
2e9b04
+
2e9b04
+    case 10:
2e9b04
+      if (sizeof (address) > sizeof (long))
2e9b04
+	{
2e9b04
+#ifndef __MSVCRT__
2e9b04
+	  printf ("%7llu ", (unsigned long long) address);
2e9b04
+#else
2e9b04
+	  printf ("%7I64d ", (unsigned long long) address);
2e9b04
+#endif
2e9b04
+	}
2e9b04
+      else
2e9b04
+	printf ("%7ld ", (long) address);
2e9b04
+      break;
2e9b04
+
2e9b04
+    case 16:
2e9b04
+      if (sizeof (address) > sizeof (long))
2e9b04
+	{
2e9b04
+#ifndef __MSVCRT__
2e9b04
+	  printf ("%7llx ", (unsigned long long) address);
2e9b04
+#else
2e9b04
+	  printf ("%7I64x ", (unsigned long long) address);
2e9b04
+#endif
2e9b04
+	}
2e9b04
+      else
2e9b04
+	printf ("%7lx ", (unsigned long) address);
2e9b04
+      break;
2e9b04
+    }
2e9b04
+}
2e9b04
+
2e9b04
+/* Return non-zero if the bytes starting at BUFFER form a valid UTF-8 encoding.
2e9b04
+   If the encoding is valid then returns the number of bytes it uses.  */
2e9b04
+
2e9b04
+static unsigned int
2e9b04
+is_valid_utf8 (const unsigned char * buffer, unsigned long buflen)
2e9b04
+{
2e9b04
+  if (buffer[0] < 0xc0)
2e9b04
+    return 0;
2e9b04
+
2e9b04
+  if (buflen < 2)
2e9b04
+    return 0;
2e9b04
+
2e9b04
+  if ((buffer[1] & 0xc0) != 0x80)
2e9b04
+    return 0;
2e9b04
+
2e9b04
+  if ((buffer[0] & 0x20) == 0)
2e9b04
+    return 2;
2e9b04
+
2e9b04
+  if (buflen < 3)
2e9b04
+    return 0;
2e9b04
+
2e9b04
+  if ((buffer[2] & 0xc0) != 0x80)
2e9b04
+    return 0;
2e9b04
+  
2e9b04
+  if ((buffer[0] & 0x10) == 0)
2e9b04
+    return 3;
2e9b04
+
2e9b04
+  if (buflen < 4)
2e9b04
+    return 0;
2e9b04
+
2e9b04
+  if ((buffer[3] & 0xc0) != 0x80)
2e9b04
+    return 0;
2e9b04
+
2e9b04
+  return 4;
2e9b04
+}
2e9b04
+
2e9b04
+/* Display a UTF-8 encoded character in BUFFER according to the setting
2e9b04
+   of unicode_display.  The character is known to be valid.
2e9b04
+   Returns the number of bytes consumed.  */
2e9b04
+
2e9b04
+static unsigned int
2e9b04
+display_utf8_char (const unsigned char * buffer)
2e9b04
+{
2e9b04
+  unsigned int j;
2e9b04
+  unsigned int utf8_len;
2e9b04
+
2e9b04
+  switch (buffer[0] & 0x30)
2e9b04
+    {
2e9b04
+    case 0x00:
2e9b04
+    case 0x10:
2e9b04
+      utf8_len = 2;
2e9b04
+      break;
2e9b04
+    case 0x20:
2e9b04
+      utf8_len = 3;
2e9b04
+      break;
2e9b04
+    default:
2e9b04
+      utf8_len = 4;
2e9b04
+    }
2e9b04
+      
2e9b04
+  switch (unicode_display)
2e9b04
+    {
2e9b04
+    default:
2e9b04
+      fprintf (stderr, "ICE: unexpected unicode display type\n");
2e9b04
+      break;
2e9b04
+
2e9b04
+    case unicode_escape:
2e9b04
+    case unicode_highlight:
2e9b04
+      if (unicode_display == unicode_highlight && isatty (1))
2e9b04
+	printf ("\x1B[31;47m"); /* Red.  */
2e9b04
+
2e9b04
+      switch (utf8_len)
2e9b04
+	{
2e9b04
+	case 2:
2e9b04
+	  printf ("\\u%02x%02x",
2e9b04
+		  ((buffer[0] & 0x1c) >> 2), 
2e9b04
+		  ((buffer[0] & 0x03) << 6) | (buffer[1] & 0x3f));
2e9b04
+	  break;
2e9b04
+
2e9b04
+	case 3:
2e9b04
+	  printf ("\\u%02x%02x",
2e9b04
+		  ((buffer[0] & 0x0f) << 4) | ((buffer[1] & 0x3c) >> 2),
2e9b04
+		  ((buffer[1] & 0x03) << 6) | ((buffer[2] & 0x3f)));
2e9b04
+	  break;
2e9b04
+
2e9b04
+	case 4:
2e9b04
+	  printf ("\\u%02x%02x%02x",
2e9b04
+		  ((buffer[0] & 0x07) << 6) | ((buffer[1] & 0x3c) >> 2),
2e9b04
+		  ((buffer[1] & 0x03) << 6) | ((buffer[2] & 0x3c) >> 2),
2e9b04
+		  ((buffer[2] & 0x03) << 6) | ((buffer[3] & 0x3f)));
2e9b04
+	  break;
2e9b04
+	default:
2e9b04
+	  /* URG.  */
2e9b04
+	  break;
2e9b04
+	}
2e9b04
+
2e9b04
+      if (unicode_display == unicode_highlight && isatty (1))
2e9b04
+	printf ("\033[0m"); /* Default colour.  */
2e9b04
+      break;
2e9b04
+
2e9b04
+    case unicode_hex:
2e9b04
+      putchar ('<');
2e9b04
+      for (j = 0; j < utf8_len; j++)
2e9b04
+	printf ("%02x", buffer [j]);
2e9b04
+      putchar ('>');
2e9b04
+      break;
2e9b04
+
2e9b04
+    case unicode_locale:
2e9b04
+      printf ("%.1s", buffer);
2e9b04
+      break;
2e9b04
+    }
2e9b04
+
2e9b04
+  return utf8_len;
2e9b04
+}
2e9b04
+
2e9b04
+/* Display strings in BUFFER.  Treat any UTF-8 encoded characters encountered
2e9b04
+   according to the setting of the unicode_display variable.  The buffer
2e9b04
+   contains BUFLEN bytes.
2e9b04
+
2e9b04
+   Display the characters as if they started at ADDRESS and are contained in
2e9b04
+   FILENAME.  */
2e9b04
+
2e9b04
+static void
2e9b04
+print_unicode_buffer (const char *            filename,
2e9b04
+		      file_ptr                address,
2e9b04
+		      const unsigned char *   buffer,
2e9b04
+		      unsigned long           buflen)
2e9b04
+{
2e9b04
+  /* Paranoia checks...  */
2e9b04
+  if (filename == NULL
2e9b04
+      || buffer == NULL
2e9b04
+      || unicode_display == unicode_default
2e9b04
+      || encoding != 'S'
2e9b04
+      || encoding_bytes != 1)
2e9b04
+    {
2e9b04
+      fprintf (stderr, "ICE: bad arguments to print_unicode_buffer\n");
2e9b04
+      return;
2e9b04
+    }
2e9b04
+
2e9b04
+  if (buflen == 0)
2e9b04
+    return;
2e9b04
+
2e9b04
+  /* We must only display strings that are at least string_min *characters*
2e9b04
+     long.  So we scan the buffer in two stages.  First we locate the start
2e9b04
+     of a potential string.  Then we walk along it until we have found
2e9b04
+     string_min characters.  Then we go back to the start point and start
2e9b04
+     displaying characters according to the unicode_display setting.  */
2e9b04
+
2e9b04
+  unsigned long start_point = 0;
2e9b04
+  unsigned long i = 0;
2e9b04
+  unsigned int char_len = 1;
2e9b04
+  unsigned int num_found = 0;
2e9b04
+
2e9b04
+  for (i = 0; i < buflen; i += char_len)
2e9b04
+    {
2e9b04
+      int c = buffer[i];
2e9b04
+
2e9b04
+      char_len = 1;
2e9b04
+
2e9b04
+      /* Find the first potential character of a string.  */
2e9b04
+      if (! STRING_ISGRAPHIC (c))
2e9b04
+	{
2e9b04
+	  num_found = 0;
2e9b04
+	  continue;
2e9b04
+	}
2e9b04
+
2e9b04
+      if (c > 126)
2e9b04
+	{
2e9b04
+	  if (c < 0xc0)
2e9b04
+	    {
2e9b04
+	      num_found = 0;
2e9b04
+	      continue;
2e9b04
+	    }
2e9b04
+
2e9b04
+	  if ((char_len = is_valid_utf8 (buffer + i, buflen - i)) == 0)
2e9b04
+	    {
2e9b04
+	      char_len = 1;
2e9b04
+	      num_found = 0;
2e9b04
+	      continue;
2e9b04
+	    }
2e9b04
+
2e9b04
+	  if (unicode_display == unicode_invalid)
2e9b04
+	    {
2e9b04
+	      /* We have found a valid UTF-8 character, but we treat it as non-graphic.  */
2e9b04
+	      num_found = 0;
2e9b04
+	      continue;
2e9b04
+	    }
2e9b04
+	}
2e9b04
+
2e9b04
+      if (num_found == 0)
2e9b04
+	/* We have found a potential starting point for a string.  */
2e9b04
+	start_point = i;
2e9b04
+
2e9b04
+      ++ num_found;
2e9b04
+
2e9b04
+      if (num_found >= string_min)
2e9b04
+	break;
2e9b04
+    }
2e9b04
+
2e9b04
+  if (num_found < string_min)
2e9b04
+    return;
2e9b04
+
2e9b04
+  print_filename_and_address (filename, address + start_point);
2e9b04
+  
2e9b04
+  /* We have found string_min characters.  Display them and any
2e9b04
+     more that follow.  */
2e9b04
+  for (i = start_point; i < buflen; i += char_len)
2e9b04
+    {
2e9b04
+      int c = buffer[i];
2e9b04
+
2e9b04
+      char_len = 1;
2e9b04
+
2e9b04
+      if (! STRING_ISGRAPHIC (c))
2e9b04
+	break;
2e9b04
+      else if (c < 127)
2e9b04
+	putchar (c);
2e9b04
+      else if (! is_valid_utf8 (buffer + i, buflen - i))
2e9b04
+	break;
2e9b04
+      else if (unicode_display == unicode_invalid)
2e9b04
+	break;
2e9b04
+      else
2e9b04
+	char_len = display_utf8_char (buffer + i);
2e9b04
+    }
2e9b04
+
2e9b04
+  if (output_separator)
2e9b04
+    fputs (output_separator, stdout);
2e9b04
+  else
2e9b04
+    putchar ('\n');
2e9b04
+
2e9b04
+  /* FIXME: Using tail recursion here is lazy programming...  */
2e9b04
+  print_unicode_buffer (filename, address + i, buffer + i, buflen - i);
2e9b04
+}
2e9b04
+
2e9b04
+static int
2e9b04
+get_unicode_byte (FILE *           stream,
2e9b04
+		  unsigned char *  putback,
2e9b04
+		  unsigned int *   num_putback,
2e9b04
+		  unsigned int *   num_read)
2e9b04
+{
2e9b04
+  if (* num_putback > 0)
2e9b04
+    {
2e9b04
+      * num_putback = * num_putback - 1;
2e9b04
+      return putback [* num_putback];
2e9b04
+    }
2e9b04
+
2e9b04
+  * num_read = * num_read + 1;
2e9b04
+
2e9b04
+#if defined(HAVE_GETC_UNLOCKED) && HAVE_DECL_GETC_UNLOCKED
2e9b04
+  return getc_unlocked (stream);
2e9b04
+#else
2e9b04
+  return getc (stream);
2e9b04
+#endif
2e9b04
+}
2e9b04
+
2e9b04
+/* Helper function for print_unicode_stream.  */
2e9b04
+
2e9b04
+static void
2e9b04
+print_unicode_stream_body (const char *     filename,
2e9b04
+			   file_ptr         address,
2e9b04
+			   FILE *           stream,
2e9b04
+			   unsigned char *  putback_buf,
2e9b04
+			   unsigned int     num_putback,
2e9b04
+			   unsigned char *  print_buf)
2e9b04
+{
2e9b04
+  /* It would be nice if we could just read the stream into a buffer
2e9b04
+     and then process if with print_unicode_buffer.  But the input
2e9b04
+     might be huge or it might time-locked (eg stdin).  So instead
2e9b04
+     we go one byte at a time...  */
2e9b04
+
2e9b04
+  file_ptr start_point = 0;
2e9b04
+  unsigned int num_read = 0;
2e9b04
+  unsigned int num_chars = 0;
2e9b04
+  unsigned int num_print = 0;
2e9b04
+  int c;
2e9b04
+
2e9b04
+  /* Find a series of string_min characters.  Put them into print_buf.  */
2e9b04
+  do
2e9b04
+    {
2e9b04
+      if (num_chars >= string_min)
2e9b04
+	break;
2e9b04
+
2e9b04
+      c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read);
2e9b04
+      if (c == EOF)
2e9b04
+	break;
2e9b04
+
2e9b04
+      if (! STRING_ISGRAPHIC (c))
2e9b04
+	{
2e9b04
+	  num_chars = num_print = 0;
2e9b04
+	  continue;
2e9b04
+	}
2e9b04
+
2e9b04
+      if (num_chars == 0)
2e9b04
+	start_point = num_read - 1;
2e9b04
+
2e9b04
+      if (c < 127)
2e9b04
+	{
2e9b04
+	  print_buf[num_print] = c;
2e9b04
+	  num_chars ++;
2e9b04
+	  num_print ++;
2e9b04
+	  continue;
2e9b04
+	}
2e9b04
+
2e9b04
+      if (c < 0xc0)
2e9b04
+	{
2e9b04
+	  num_chars = num_print = 0;
2e9b04
+	  continue;
2e9b04
+	}
2e9b04
+
2e9b04
+      /* We *might* have a UTF-8 sequence.  Time to start peeking.  */
2e9b04
+      char utf8[4];
2e9b04
+
2e9b04
+      utf8[0] = c;
2e9b04
+      c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read);
2e9b04
+      if (c == EOF)
2e9b04
+	break;
2e9b04
+      utf8[1] = c;
2e9b04
+
2e9b04
+      if ((utf8[1] & 0xc0) != 0x80)
2e9b04
+	{
2e9b04
+	  /* Invalid UTF-8.  */
2e9b04
+	  putback_buf[num_putback++] = utf8[1];
2e9b04
+	  num_chars = num_print = 0;
2e9b04
+	  continue;
2e9b04
+	}
2e9b04
+      else if ((utf8[0] & 0x20) == 0)
2e9b04
+	{
2e9b04
+	  /* A valid 2-byte UTF-8 encoding.  */
2e9b04
+	  if (unicode_display == unicode_invalid)
2e9b04
+	    {
2e9b04
+	      putback_buf[num_putback++] = utf8[1];
2e9b04
+	      num_chars = num_print = 0;
2e9b04
+	    }
2e9b04
+	  else
2e9b04
+	    {
2e9b04
+	      print_buf[num_print ++] = utf8[0];
2e9b04
+	      print_buf[num_print ++] = utf8[1];
2e9b04
+	      num_chars ++;
2e9b04
+	    }
2e9b04
+	  continue;
2e9b04
+	}
2e9b04
+
2e9b04
+      c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read);
2e9b04
+      if (c == EOF)
2e9b04
+	break;
2e9b04
+      utf8[2] = c;
2e9b04
+
2e9b04
+      if ((utf8[2] & 0xc0) != 0x80)
2e9b04
+	{
2e9b04
+	  /* Invalid UTF-8.  */
2e9b04
+	  putback_buf[num_putback++] = utf8[2];
2e9b04
+	  putback_buf[num_putback++] = utf8[1];
2e9b04
+	  num_chars = num_print = 0;
2e9b04
+	  continue;
2e9b04
+	}
2e9b04
+      else if ((utf8[0] & 0x10) == 0)
2e9b04
+	{
2e9b04
+	  /* A valid 3-byte UTF-8 encoding.  */
2e9b04
+	  if (unicode_display == unicode_invalid)
2e9b04
+	    {
2e9b04
+	      putback_buf[num_putback++] = utf8[2];
2e9b04
+	      putback_buf[num_putback++] = utf8[1];
2e9b04
+	      num_chars = num_print = 0;
2e9b04
+	    }
2e9b04
+	  else
2e9b04
+	    {
2e9b04
+	      print_buf[num_print ++] = utf8[0];
2e9b04
+	      print_buf[num_print ++] = utf8[1];
2e9b04
+	      print_buf[num_print ++] = utf8[2];
2e9b04
+	      num_chars ++;
2e9b04
+	    }
2e9b04
+	  continue;
2e9b04
+	}
2e9b04
+
2e9b04
+      c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read);
2e9b04
+      if (c == EOF)
2e9b04
+	break;
2e9b04
+      utf8[3] = c;
2e9b04
+
2e9b04
+      if ((utf8[3] & 0xc0) != 0x80)
2e9b04
+	{
2e9b04
+	  /* Invalid UTF-8.  */
2e9b04
+	  putback_buf[num_putback++] = utf8[3];
2e9b04
+	  putback_buf[num_putback++] = utf8[2];
2e9b04
+	  putback_buf[num_putback++] = utf8[1];
2e9b04
+	  num_chars = num_print = 0;
2e9b04
+	}
2e9b04
+      /* We have a valid 4-byte UTF-8 encoding.  */
2e9b04
+      else if (unicode_display == unicode_invalid)
2e9b04
+	{
2e9b04
+	  putback_buf[num_putback++] = utf8[3];
2e9b04
+	  putback_buf[num_putback++] = utf8[1];
2e9b04
+	  putback_buf[num_putback++] = utf8[2];
2e9b04
+	  num_chars = num_print = 0;
2e9b04
+	}
2e9b04
+      else
2e9b04
+	{
2e9b04
+	  print_buf[num_print ++] = utf8[0];
2e9b04
+	  print_buf[num_print ++] = utf8[1];
2e9b04
+	  print_buf[num_print ++] = utf8[2];
2e9b04
+	  print_buf[num_print ++] = utf8[3];
2e9b04
+	  num_chars ++;
2e9b04
+	}
2e9b04
+    }
2e9b04
+  while (1);
2e9b04
+
2e9b04
+  if (num_chars >= string_min)
2e9b04
+    {
2e9b04
+      /* We know that we have string_min valid characters in print_buf,
2e9b04
+	 and there may be more to come in the stream.  Start displaying
2e9b04
+	 them.  */
2e9b04
+
2e9b04
+      print_filename_and_address (filename, address + start_point);
2e9b04
+
2e9b04
+      unsigned int i;
2e9b04
+      for (i = 0; i < num_print;)
2e9b04
+	{
2e9b04
+	  if (print_buf[i] < 127)
2e9b04
+	    putchar (print_buf[i++]);
2e9b04
+	  else
2e9b04
+	    i += display_utf8_char (print_buf + i);
2e9b04
+	}
2e9b04
+
2e9b04
+      /* OK so now we have to start read unchecked bytes.  */
2e9b04
+
2e9b04
+        /* Find a series of string_min characters.  Put them into print_buf.  */
2e9b04
+      do
2e9b04
+	{
2e9b04
+	  c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read);
2e9b04
+	  if (c == EOF)
2e9b04
+	    break;
2e9b04
+
2e9b04
+	  if (! STRING_ISGRAPHIC (c))
2e9b04
+	    break;
2e9b04
+
2e9b04
+	  if (c < 127)
2e9b04
+	    {
2e9b04
+	      putchar (c);
2e9b04
+	      continue;
2e9b04
+	    }
2e9b04
+
2e9b04
+	  if (c < 0xc0)
2e9b04
+	    break;
2e9b04
+
2e9b04
+	  /* We *might* have a UTF-8 sequence.  Time to start peeking.  */
2e9b04
+	  unsigned char utf8[4];
2e9b04
+
2e9b04
+	  utf8[0] = c;
2e9b04
+	  c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read);
2e9b04
+	  if (c == EOF)
2e9b04
+	    break;
2e9b04
+	  utf8[1] = c;
2e9b04
+
2e9b04
+	  if ((utf8[1] & 0xc0) != 0x80)
2e9b04
+	    {
2e9b04
+	      /* Invalid UTF-8.  */
2e9b04
+	      putback_buf[num_putback++] = utf8[1];
2e9b04
+	      break;
2e9b04
+	    }
2e9b04
+	  else if ((utf8[0] & 0x20) == 0)
2e9b04
+	    {
2e9b04
+	      /* Valid 2-byte UTF-8.  */
2e9b04
+	      if (unicode_display == unicode_invalid)
2e9b04
+		{
2e9b04
+		  putback_buf[num_putback++] = utf8[1];
2e9b04
+		  break;
2e9b04
+		}
2e9b04
+	      else
2e9b04
+		{
2e9b04
+		  (void) display_utf8_char (utf8);
2e9b04
+		  continue;
2e9b04
+		}
2e9b04
+	    }
2e9b04
+
2e9b04
+	  c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read);
2e9b04
+	  if (c == EOF)
2e9b04
+	    break;
2e9b04
+	  utf8[2] = c;
2e9b04
+
2e9b04
+	  if ((utf8[2] & 0xc0) != 0x80)
2e9b04
+	    {
2e9b04
+	      /* Invalid UTF-8.  */
2e9b04
+	      putback_buf[num_putback++] = utf8[2];
2e9b04
+	      putback_buf[num_putback++] = utf8[1];
2e9b04
+	      break;
2e9b04
+	    }
2e9b04
+	  else if ((utf8[0] & 0x10) == 0)
2e9b04
+	    {
2e9b04
+	      /* Valid 3-byte UTF-8.  */
2e9b04
+	      if (unicode_display == unicode_invalid)
2e9b04
+		{
2e9b04
+		  putback_buf[num_putback++] = utf8[2];
2e9b04
+		  putback_buf[num_putback++] = utf8[1];
2e9b04
+		  break;
2e9b04
+		}
2e9b04
+	      else
2e9b04
+		{
2e9b04
+		  (void) display_utf8_char (utf8);
2e9b04
+		  continue;
2e9b04
+		}
2e9b04
+	    }
2e9b04
+
2e9b04
+	  c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read);
2e9b04
+	  if (c == EOF)
2e9b04
+	    break;
2e9b04
+	  utf8[3] = c;
2e9b04
+
2e9b04
+	  if ((utf8[3] & 0xc0) != 0x80)
2e9b04
+	    {
2e9b04
+	      /* Invalid UTF-8.  */
2e9b04
+	      putback_buf[num_putback++] = utf8[3];
2e9b04
+	      putback_buf[num_putback++] = utf8[2];
2e9b04
+	      putback_buf[num_putback++] = utf8[1];
2e9b04
+	      break;
2e9b04
+	    }
2e9b04
+	  else if (unicode_display == unicode_invalid)
2e9b04
+	    {
2e9b04
+	      putback_buf[num_putback++] = utf8[3];
2e9b04
+	      putback_buf[num_putback++] = utf8[2];
2e9b04
+	      putback_buf[num_putback++] = utf8[1];
2e9b04
+	      break;
2e9b04
+	    }
2e9b04
+	  else
2e9b04
+	    /* A valid 4-byte UTF-8 encoding.  */
2e9b04
+	    (void) display_utf8_char (utf8);
2e9b04
+	}
2e9b04
+      while (1);
2e9b04
+
2e9b04
+      if (output_separator)
2e9b04
+	fputs (output_separator, stdout);
2e9b04
+      else
2e9b04
+	putchar ('\n');
2e9b04
+    }
2e9b04
+
2e9b04
+  if (c != EOF)
2e9b04
+    /* FIXME: Using tail recursion here is lazy, but it works.  */
2e9b04
+    print_unicode_stream_body (filename, address + num_read, stream, putback_buf, num_putback, print_buf);
2e9b04
+}
2e9b04
+
2e9b04
+/* Display strings read in from STREAM.  Treat any UTF-8 encoded characters
2e9b04
+   encountered according to the setting of the unicode_display variable.
2e9b04
+   The stream is positioned at ADDRESS and is attached to FILENAME.  */
2e9b04
+
2e9b04
+static void
2e9b04
+print_unicode_stream (const char * filename,
2e9b04
+		      file_ptr     address,
2e9b04
+		      FILE *       stream)
2e9b04
+{
2e9b04
+  /* Paranoia checks...  */
2e9b04
+  if (filename == NULL
2e9b04
+      || stream == NULL
2e9b04
+      || unicode_display == unicode_default
2e9b04
+      || encoding != 'S'
2e9b04
+      || encoding_bytes != 1)
2e9b04
+    {
2e9b04
+      fprintf (stderr, "ICE: bad arguments to print_unicode_stream\n");
2e9b04
+      return;
2e9b04
+    }
2e9b04
+
2e9b04
+  /* Allocate space for string_min 4-byte utf-8 characters.  */
2e9b04
+  unsigned char * print_buf = xmalloc ((4 * string_min) + 1);
2e9b04
+  /* We should never have to put back more than 4 bytes.  */
2e9b04
+  unsigned char putback_buf[5];
2e9b04
+  unsigned int num_putback = 0;
2e9b04
+
2e9b04
+  print_unicode_stream_body (filename, address, stream, putback_buf, num_putback, print_buf);
2e9b04
+  free (print_buf);
2e9b04
+}
2e9b04
 
2e9b04
 /* Find the strings in file FILENAME, read from STREAM.
2e9b04
    Assume that STREAM is positioned so that the next byte read
2e9b04
    is at address ADDRESS in the file.
2e9b04
-   Stop reading at address STOP_POINT in the file, if nonzero.
2e9b04
 
2e9b04
    If STREAM is NULL, do not read from it.
2e9b04
    The caller can supply a buffer of characters
2e9b04
@@ -570,18 +1238,27 @@ static void
2e9b04
 print_strings (const char *filename, FILE *stream, file_ptr address,
2e9b04
 	       int stop_point, int magiccount, char *magic)
2e9b04
 {
2e9b04
+  if (unicode_display != unicode_default)
2e9b04
+    {
2e9b04
+      if (magic != NULL)
2e9b04
+	print_unicode_buffer (filename, address,
2e9b04
+			      (const unsigned char *) magic, magiccount);
2e9b04
+
2e9b04
+      if (stream != NULL)
2e9b04
+	print_unicode_stream (filename, address, stream);
2e9b04
+      return;
2e9b04
+    }
2e9b04
+
2e9b04
   char *buf = (char *) xmalloc (sizeof (char) * (string_min + 1));
2e9b04
 
2e9b04
   while (1)
2e9b04
     {
2e9b04
       file_ptr start;
2e9b04
-      int i;
2e9b04
+      unsigned int i;
2e9b04
       long c;
2e9b04
 
2e9b04
       /* See if the next `string_min' chars are all graphic chars.  */
2e9b04
     tryline:
2e9b04
-      if (stop_point && address >= stop_point)
2e9b04
-	break;
2e9b04
       start = address;
2e9b04
       for (i = 0; i < string_min; i++)
2e9b04
 	{
2e9b04
@@ -718,6 +1395,8 @@ usage (FILE *stream, int status)
2e9b04
   -T --target=<BFDNAME>     Specify the binary file format\n\
2e9b04
   -e --encoding={s,S,b,l,B,L} Select character size and endianness:\n\
2e9b04
                             s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\
2e9b04
+  --unicode={default|show|invalid|hex|escape|highlight}\n\
2e9b04
+  -U {d|s|i|x|e|h}          Specify how to treat UTF-8 encoded unicode characters\n\
2e9b04
   -s --output-separator=<string> String used to separate strings in output.\n\
2e9b04
   @<file>                   Read options from <file>\n\
2e9b04
   -h --help                 Display this information\n\
2e9b04
Only in binutils-2.35.2/binutils/: sysinfo
2e9b04
Only in binutils-2.35.2/binutils/: sysinfo.o
2e9b04
Only in binutils-2.35.2/binutils/: syslex_wrap.o
2e9b04
Only in binutils-2.35.2/binutils/: sysroff.h
2e9b04
Only in binutils-2.35.2/binutils/: version.o