Blame SOURCES/binutils.unicode.patch

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