binutils: Upgrade to 2.38 release
PATCH 1/1 binutils: Upgrade to 2.38 release
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
---
meta/conf/distro/include/tcmode-default.inc | 2 +-
.../binutils/binutils-2.37.inc | 39 -
.../binutils/binutils-2.38.inc | 35 +
....37.bb => binutils-cross-canadian_2.38.bb} | 0
...37.bb => binutils-cross-testsuite_2.38.bb} | 0
...s-cross_2.37.bb => binutils-cross_2.38.bb} | 0
...ssdk_2.37.bb => binutils-crosssdk_2.38.bb} | 0
.../binutils/0001-CVE-2021-42574.patch | 2001 ---------
...s-crosssdk-Generate-relocatable-SDKs.patch | 12 +-
...rd-input-.note.gnu.build-id-sections.patch | 215 -
...o-not-generate-linker-script-directo.patch | 4 +-
...dk-Search-for-alternative-ld.so.conf.patch | 16 +-
...04-Point-scripts-location-to-libdir.patch} | 8 +-
...RPATH-entry-if-LD_RUN_PATH-is-not-e.patch} | 8 +-
...tro-compiler-point-to-the-wrong-ins.patch} | 6 +-
...system-directories-when-cross-linki.patch} | 48 +-
...ct-assembling-for-ppc-wait-mnemonic.patch} | 7 +-
...l-2.4.patch => 0009-Use-libtool-2.4.patch} | 3964 +++++++++++++----
...-in-libtool-when-sysroot-is-enabled.patch} | 2 +-
...> 0011-sync-with-OE-libtool-changes.patch} | 2 +-
...r-clang-before-checking-gcc-version.patch} | 8 +-
...le-descriptor-if-there-is-no-archive.patch | 234 -
...87d12167b1e36193385485c1f6ce92f74f02.patch | 247 -
.../{binutils_2.37.bb => binutils_2.38.bb} | 0
24 files changed, 3132 insertions(+), 3726 deletions(-)
delete mode 100644 meta/recipes-devtools/binutils/binutils-2.37.inc
create mode 100644 meta/recipes-devtools/binutils/binutils-2.38.inc
rename meta/recipes-devtools/binutils/{binutils-cross-canadian_2.37.bb => binutils-cross-canadian_2.38.bb} (100%)
rename meta/recipes-devtools/binutils/{binutils-cross-testsuite_2.37.bb => binutils-cross-testsuite_2.38.bb} (100%)
rename meta/recipes-devtools/binutils/{binutils-cross_2.37.bb => binutils-cross_2.38.bb} (100%)
rename meta/recipes-devtools/binutils/{binutils-crosssdk_2.37.bb => binutils-crosssdk_2.38.bb} (100%)
delete mode 100644 meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch
delete mode 100644 meta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch
rename meta/recipes-devtools/binutils/binutils/{0005-Point-scripts-location-to-libdir.patch => 0004-Point-scripts-location-to-libdir.patch} (85%)
rename meta/recipes-devtools/binutils/binutils/{0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch => 0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch} (82%)
rename meta/recipes-devtools/binutils/binutils/{0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch => 0006-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch} (87%)
rename meta/recipes-devtools/binutils/binutils/{0008-warn-for-uses-of-system-directories-when-cross-linki.patch => 0007-warn-for-uses-of-system-directories-when-cross-linki.patch} (85%)
rename meta/recipes-devtools/binutils/binutils/{0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch => 0008-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch} (93%)
rename meta/recipes-devtools/binutils/binutils/{0013-Use-libtool-2.4.patch => 0009-Use-libtool-2.4.patch} (88%)
rename meta/recipes-devtools/binutils/binutils/{0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch => 0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch} (96%)
rename meta/recipes-devtools/binutils/binutils/{0015-sync-with-OE-libtool-changes.patch => 0011-sync-with-OE-libtool-changes.patch} (97%)
rename meta/recipes-devtools/binutils/binutils/{0016-Check-for-clang-before-checking-gcc-version.patch => 0012-Check-for-clang-before-checking-gcc-version.patch} (87%)
delete mode 100644 meta/recipes-devtools/binutils/binutils/0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch
delete mode 100644 meta/recipes-devtools/binutils/binutils/161e87d12167b1e36193385485c1f6ce92f74f02.patch
rename meta/recipes-devtools/binutils/{binutils_2.37.bb => binutils_2.38.bb} (100%)meta/conf/distro/include/tcmode-default.inc +1 -1
@@ -18,7 +18,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext" GCCVERSION ?= "11.%" SDKGCCVERSION ?= "${GCCVERSION}" -BINUVERSION ?= "2.37%" +BINUVERSION ?= "2.38%" GDBVERSION ?= "11.%" GLIBCVERSION ?= "2.35" LINUXLIBCVERSION ?= "5.16%"
meta/recipes-devtools/binutils/binutils-2.37.inc deleted +0 -39
@@ -1,39 +0,0 @@ -LIC_FILES_CHKSUM="\ - file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ - file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\ - file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\ - file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\ - file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\ - file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ - file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\ - file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\ - file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\ - " - -# When upgrading to 2.37, please make sure there is no trailing .0, so -# that upstream version check can work correctly. -PV = "2.37" -CVE_VERSION = "2.37" -SRCBRANCH ?= "binutils-2_37-branch" - -UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)" - -SRCREV ?= "87d4632d36323091e731eb07b8aa65f90293da66" -BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=git" -SRC_URI = "\ - ${BINUTILS_GIT_URI} \ - file://0005-Point-scripts-location-to-libdir.patch \ - file://0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \ - file://0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \ - file://0008-warn-for-uses-of-system-directories-when-cross-linki.patch \ - file://0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \ - file://0013-Use-libtool-2.4.patch \ - file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \ - file://0015-sync-with-OE-libtool-changes.patch \ - file://0016-Check-for-clang-before-checking-gcc-version.patch \ - file://0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch \ - file://0001-elf-Discard-input-.note.gnu.build-id-sections.patch \ - file://0001-CVE-2021-42574.patch \ - file://161e87d12167b1e36193385485c1f6ce92f74f02.patch \ -" -S = "${WORKDIR}/git"
meta/recipes-devtools/binutils/binutils-2.38.inc new file +35 -0
@@ -0,0 +1,35 @@ +LIC_FILES_CHKSUM="\ + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\ + file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\ + file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + " + +# When upgrading to 2.39, please make sure there is no trailing .0, so +# that upstream version check can work correctly. +PV = "2.38" +CVE_VERSION = "2.38" +SRCBRANCH ?= "binutils-2_38-branch" + +UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)" + +SRCREV ?= "a96f7ba94b69b588bf524624ff2410b31420c957" +BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=git" +SRC_URI = "\ + ${BINUTILS_GIT_URI} \ + file://0004-Point-scripts-location-to-libdir.patch \ + file://0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \ + file://0006-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \ + file://0007-warn-for-uses-of-system-directories-when-cross-linki.patch \ + file://0008-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \ + file://0009-Use-libtool-2.4.patch \ + file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \ + file://0011-sync-with-OE-libtool-changes.patch \ + file://0012-Check-for-clang-before-checking-gcc-version.patch \ +" +S = "${WORKDIR}/git"
meta/recipes-devtools/binutils/binutils-cross-canadian_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-cross-canadian_2.37.bb +0 -0
meta/recipes-devtools/binutils/binutils-cross-testsuite_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-cross-testsuite_2.37.bb +0 -0
meta/recipes-devtools/binutils/binutils-cross_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-cross_2.37.bb +0 -0
meta/recipes-devtools/binutils/binutils-crosssdk_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-crosssdk_2.37.bb +0 -0
meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch deleted +0 -2001
2,001 lines not on this page · raw message
meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch +6 -6
@@ -1,4 +1,4 @@ -From 257ad1ce148417e1cefe2332d8acc5c8216c2522 Mon Sep 17 00:00:00 2001 +From 07bb7fbdacaf9cd6a1a252ffbc98f4e05e305d50 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:58:54 +0000 Subject: [PATCH] binutils-crosssdk: Generate relocatable SDKs
@@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <[email protected]> 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gold/layout.cc b/gold/layout.cc -index a27cb071c75..32b52890b39 100644 +index 3efe8d98ae9..9cc389664a6 100644 --- a/gold/layout.cc +++ b/gold/layout.cc -@@ -5032,7 +5032,7 @@ Layout::create_interp(const Target* target) +@@ -5033,7 +5033,7 @@ Layout::create_interp(const Target* target) gold_assert(interp != NULL); }
@@ -34,7 +34,7 @@ index a27cb071c75..32b52890b39 100644 Output_section_data* odata = new Output_data_const(interp, len, 1); diff --git a/ld/genscripts.sh b/ld/genscripts.sh -index 088417ef2d5..46a2db7005c 100755 +index 278f212bdad..0c52ebee4d0 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -304,6 +304,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
@@ -59,10 +59,10 @@ index 088417ef2d5..46a2db7005c 100755 DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc -index 29a8f0781d5..75e46f4adaf 100644 +index bf2268bb0ad..b1811ef130f 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc -@@ -147,8 +147,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then +@@ -148,8 +148,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi fi
meta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch deleted +0 -215
215 lines not on this page · raw message
meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch +2 -2
@@ -1,4 +1,4 @@ -From 6e93d0328f499569db7ce6396f94f304ce340df8 Mon Sep 17 00:00:00 2001 +From f820ab7ea7e94d4df548be3388163ff2efb2ea96 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 6 Mar 2017 23:37:05 -0800 Subject: [PATCH] binutils-cross: Do not generate linker script directories
@@ -22,7 +22,7 @@ Signed-off-by: Khem Raj <[email protected]> 1 file changed, 25 deletions(-) diff --git a/ld/genscripts.sh b/ld/genscripts.sh -index 46a2db7005c..4bb7c33f560 100755 +index 0c52ebee4d0..1acbe66bd2e 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -235,31 +235,6 @@ append_to_lib_path()
meta/recipes-devtools/binutils/binutils/0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch +8 -8
@@ -1,4 +1,4 @@ -From d49016d3faf684319bf3ac37450558920d70be03 Mon Sep 17 00:00:00 2001 +From b2ccd25828b40310caeb094c0413e3a30a4dc0a5 Mon Sep 17 00:00:00 2001 From: Richard Purdie <[email protected]> Date: Wed, 19 Feb 2020 09:51:16 -0800 Subject: [PATCH] binutils-nativesdk: Search for alternative ld.so.conf in SDK
@@ -29,7 +29,7 @@ Signed-off-by: Khem Raj <[email protected]> 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ld/Makefile.am b/ld/Makefile.am -index f8e99325361..fd196541f59 100644 +index b55a873d927..61db131fb0d 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -42,7 +42,8 @@ ZLIBINC = @zlibinc@
@@ -43,10 +43,10 @@ index f8e99325361..fd196541f59 100644 NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) diff --git a/ld/Makefile.in b/ld/Makefile.in -index ef2e99e08da..cb8f5bfb70e 100644 +index 61e93eeaf1e..860eb21a785 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -555,7 +555,8 @@ ZLIB = @zlibdir@ -lz +@@ -556,7 +556,8 @@ ZLIB = @zlibdir@ -lz ZLIBINC = @zlibinc@ ELF_CLFAGS = -DELF_LIST_OPTIONS=@elf_list_options@ \ -DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \
@@ -57,10 +57,10 @@ index ef2e99e08da..cb8f5bfb70e 100644 AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) diff --git a/ld/ldelf.c b/ld/ldelf.c -index 21e655bb55c..d1615003ede 100644 +index 121c25d948f..34cbc60e5e9 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c -@@ -911,7 +911,7 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force, +@@ -930,7 +930,7 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force, info.path = NULL; info.len = info.alloc = 0;
@@ -70,7 +70,7 @@ index 21e655bb55c..d1615003ede 100644 if (!ldelf_parse_ld_so_conf (&info, tmppath)) { diff --git a/ld/ldmain.c b/ld/ldmain.c -index 42660eb9a3c..5a4a4d5da3d 100644 +index ea72b14a301..1ae90a77749 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -70,6 +70,7 @@ char *program_name;
@@ -82,7 +82,7 @@ index 42660eb9a3c..5a4a4d5da3d 100644 /* The canonical representation of ld_sysroot. */ char *ld_canon_sysroot; diff --git a/ld/ldmain.h b/ld/ldmain.h -index 39d08a6c378..4c3519e7970 100644 +index f6d05a02f59..e60292cd522 100644 --- a/ld/ldmain.h +++ b/ld/ldmain.h @@ -23,6 +23,7 @@
meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch renamed from meta/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch +4 -4
@@ -1,4 +1,4 @@ -From 1a9fcaae50e63b993019bd4dc00219e43421efdc Mon Sep 17 00:00:00 2001 +From 7a7b777cdfded080aab1021fa6bcdb20345f5cfd Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:09:58 +0000 Subject: [PATCH] Point scripts location to libdir
@@ -12,7 +12,7 @@ Signed-off-by: Khem Raj <[email protected]> 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ld/Makefile.am b/ld/Makefile.am -index fd196541f59..d94fa7e64e1 100644 +index 61db131fb0d..5b5ee64d121 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -51,7 +51,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
@@ -25,10 +25,10 @@ index fd196541f59..d94fa7e64e1 100644 EMUL = @EMUL@ EMULATION_OFILES = @EMULATION_OFILES@ diff --git a/ld/Makefile.in b/ld/Makefile.in -index cb8f5bfb70e..9a58879c5ca 100644 +index 860eb21a785..d719747919c 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -563,7 +563,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -564,7 +564,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers.
meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch renamed from meta/recipes-devtools/binutils/binutils/0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch +4 -4
@@ -1,4 +1,4 @@ -From 29517900352336708495d41902b5b7e8cc9a401a Mon Sep 17 00:00:00 2001 +From edddb1f294d667eac94649ba0665fe464990ed18 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:27:17 +0000 Subject: [PATCH] Only generate an RPATH entry if LD_RUN_PATH is not empty
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <[email protected]> 1 file changed, 4 insertions(+) diff --git a/ld/ldelf.c b/ld/ldelf.c -index d1615003ede..6a894285b11 100644 +index 34cbc60e5e9..b1965a9e96f 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c -@@ -1250,6 +1250,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, +@@ -1277,6 +1277,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, && command_line.rpath == NULL) { path = (const char *) getenv ("LD_RUN_PATH");
@@ -26,7 +26,7 @@ index d1615003ede..6a894285b11 100644 if (path && ldelf_search_needed (path, &n, force, is_linux, elfsize)) -@@ -1610,6 +1612,8 @@ ldelf_before_allocation (char *audit, char *depaudit, +@@ -1636,6 +1638,8 @@ ldelf_before_allocation (char *audit, char *depaudit, rpath = command_line.rpath; if (rpath == NULL) rpath = (const char *) getenv ("LD_RUN_PATH");
meta/recipes-devtools/binutils/binutils/0006-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch renamed from meta/recipes-devtools/binutils/binutils/0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch +3 -3
@@ -1,4 +1,4 @@ -From 37581c8ce9d98a1183706e12a2c9a73f7f40462d Mon Sep 17 00:00:00 2001 +From fc9e8b99969bb32a4b009eab763bade6c554ef73 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:39:01 +0000 Subject: [PATCH] don't let the distro compiler point to the wrong installation
@@ -17,10 +17,10 @@ Signed-off-by: Khem Raj <[email protected]> 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in -index 4f1213b983b..2ba18b75cac 100644 +index abef3c4601b..880c8826482 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in -@@ -367,7 +367,8 @@ install-strip: install +@@ -385,7 +385,8 @@ install-strip: install # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the # default multilib, so we have to take CFLAGS into account as well, # since it will be passed the multilib flags.
meta/recipes-devtools/binutils/binutils/0007-warn-for-uses-of-system-directories-when-cross-linki.patch renamed from meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch +33 -15
151 lines not on this page · raw message
meta/recipes-devtools/binutils/binutils/0008-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch renamed from meta/recipes-devtools/binutils/binutils/0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch +3 -4
@@ -1,4 +1,4 @@ -From b77c5a67d4ac2513d0b4bab5e4dd1c33b339689b Mon Sep 17 00:00:00 2001 +From 00ae1ee97ad3ad0624798b28c6bab94a19b3ef39 Mon Sep 17 00:00:00 2001 From: Zhenhua Luo <[email protected]> Date: Sat, 11 Jun 2016 22:08:29 -0500 Subject: [PATCH] fix the incorrect assembling for ppc wait mnemonic
@@ -7,15 +7,14 @@ The wait mnemonic for ppc targets is incorrectly assembled into 0x7c00003c due to duplicated address definition with waitasec instruction. The issue causes kernel boot calltrace for ppc targets when wait instruction is executed. -Signed-off-by: Zhenhua Luo <[email protected]> - Upstream-Status: Pending +Signed-off-by: Zhenhua Luo <[email protected]> --- opcodes/ppc-opc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c -index 13d8b6c3c07..cd979f9c80c 100644 +index a424dd924de..406d5b60917 100644 --- a/opcodes/ppc-opc.c +++ b/opcodes/ppc-opc.c @@ -6378,8 +6378,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
meta/recipes-devtools/binutils/binutils/0009-Use-libtool-2.4.patch renamed from meta/recipes-devtools/binutils/binutils/0013-Use-libtool-2.4.patch +3027 -937
359 lines not on this page · raw message
meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch renamed from meta/recipes-devtools/binutils/binutils/0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch +1 -1
Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0011-sync-with-OE-libtool-changes.patch renamed from meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch +1 -1
Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0012-Check-for-clang-before-checking-gcc-version.patch renamed from meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch +4 -4
Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch deleted +0 -234
234 lines not on this page · raw message
meta/recipes-devtools/binutils/binutils/161e87d12167b1e36193385485c1f6ce92f74f02.patch deleted +0 -247
247 lines not on this page · raw message
meta/recipes-devtools/binutils/binutils_2.38.bb renamed from meta/recipes-devtools/binutils/binutils_2.37.bb +0 -0
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.35.1
Part of the diff is not shown here. View the raw message.
Hi Bruce
We will need https://lkml.org/lkml/2022/1/26/855
in kernel backported to let RV64 kernel compile with this upgrade.
Quoted 12,092 lines · Khem Raj
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>--- meta/conf/distro/include/tcmode-default.inc | 2 +- .../binutils/binutils-2.37.inc | 39 - .../binutils/binutils-2.38.inc | 35 + ....37.bb => binutils-cross-canadian_2.38.bb} | 0 ...37.bb => binutils-cross-testsuite_2.38.bb} | 0 ...s-cross_2.37.bb => binutils-cross_2.38.bb} | 0 ...ssdk_2.37.bb => binutils-crosssdk_2.38.bb} | 0 .../binutils/0001-CVE-2021-42574.patch | 2001 --------- ...s-crosssdk-Generate-relocatable-SDKs.patch | 12 +- ...rd-input-.note.gnu.build-id-sections.patch | 215 - ...o-not-generate-linker-script-directo.patch | 4 +- ...dk-Search-for-alternative-ld.so.conf.patch | 16 +- ...04-Point-scripts-location-to-libdir.patch} | 8 +- ...RPATH-entry-if-LD_RUN_PATH-is-not-e.patch} | 8 +- ...tro-compiler-point-to-the-wrong-ins.patch} | 6 +- ...system-directories-when-cross-linki.patch} | 48 +- ...ct-assembling-for-ppc-wait-mnemonic.patch} | 7 +- ...l-2.4.patch => 0009-Use-libtool-2.4.patch} | 3964 +++++++++++++---- ...-in-libtool-when-sysroot-is-enabled.patch} | 2 +- ...> 0011-sync-with-OE-libtool-changes.patch} | 2 +- ...r-clang-before-checking-gcc-version.patch} | 8 +- ...le-descriptor-if-there-is-no-archive.patch | 234 - ...87d12167b1e36193385485c1f6ce92f74f02.patch | 247 - .../{binutils_2.37.bb => binutils_2.38.bb} | 0 24 files changed, 3132 insertions(+), 3726 deletions(-) delete mode 100644 meta/recipes-devtools/binutils/binutils-2.37.inc create mode 100644 meta/recipes-devtools/binutils/binutils-2.38.inc rename meta/recipes-devtools/binutils/{binutils-cross-canadian_2.37.bb => binutils-cross-canadian_2.38.bb} (100%) rename meta/recipes-devtools/binutils/{binutils-cross-testsuite_2.37.bb => binutils-cross-testsuite_2.38.bb} (100%) rename meta/recipes-devtools/binutils/{binutils-cross_2.37.bb => binutils-cross_2.38.bb} (100%) rename meta/recipes-devtools/binutils/{binutils-crosssdk_2.37.bb => binutils-crosssdk_2.38.bb} (100%) delete mode 100644 meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch delete mode 100644 meta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch rename meta/recipes-devtools/binutils/binutils/{0005-Point-scripts-location-to-libdir.patch => 0004-Point-scripts-location-to-libdir.patch} (85%) rename meta/recipes-devtools/binutils/binutils/{0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch => 0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch} (82%) rename meta/recipes-devtools/binutils/binutils/{0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch => 0006-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch} (87%) rename meta/recipes-devtools/binutils/binutils/{0008-warn-for-uses-of-system-directories-when-cross-linki.patch => 0007-warn-for-uses-of-system-directories-when-cross-linki.patch} (85%) rename meta/recipes-devtools/binutils/binutils/{0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch => 0008-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch} (93%) rename meta/recipes-devtools/binutils/binutils/{0013-Use-libtool-2.4.patch => 0009-Use-libtool-2.4.patch} (88%) rename meta/recipes-devtools/binutils/binutils/{0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch => 0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch} (96%) rename meta/recipes-devtools/binutils/binutils/{0015-sync-with-OE-libtool-changes.patch => 0011-sync-with-OE-libtool-changes.patch} (97%) rename meta/recipes-devtools/binutils/binutils/{0016-Check-for-clang-before-checking-gcc-version.patch => 0012-Check-for-clang-before-checking-gcc-version.patch} (87%) delete mode 100644 meta/recipes-devtools/binutils/binutils/0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch delete mode 100644 meta/recipes-devtools/binutils/binutils/161e87d12167b1e36193385485c1f6ce92f74f02.patch rename meta/recipes-devtools/binutils/{binutils_2.37.bb => binutils_2.38.bb} (100%)meta/conf/distro/include/tcmode-default.inc +1
-1@@ -18,7 +18,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext" GCCVERSION ?= "11.%" SDKGCCVERSION ?= "${GCCVERSION}" -BINUVERSION ?= "2.37%" +BINUVERSION ?= "2.38%" GDBVERSION ?= "11.%" GLIBCVERSION ?= "2.35" LINUXLIBCVERSION ?= "5.16%"meta/recipes-devtools/binutils/binutils-2.37.inc deleted +0
-39@@ -1,39 +0,0 @@ -LIC_FILES_CHKSUM="\ - file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ - file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\ - file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\ - file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\ - file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\ - file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ - file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\ - file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\ - file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\ - " - -# When upgrading to 2.37, please make sure there is no trailing .0, so -# that upstream version check can work correctly. -PV = "2.37" -CVE_VERSION = "2.37" -SRCBRANCH ?= "binutils-2_37-branch" - -UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)" - -SRCREV ?= "87d4632d36323091e731eb07b8aa65f90293da66" -BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=git" -SRC_URI = "\ - ${BINUTILS_GIT_URI} \ - file://0005-Point-scripts-location-to-libdir.patch \ - file://0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \ - file://0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \ - file://0008-warn-for-uses-of-system-directories-when-cross-linki.patch \ - file://0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \ - file://0013-Use-libtool-2.4.patch \ - file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \ - file://0015-sync-with-OE-libtool-changes.patch \ - file://0016-Check-for-clang-before-checking-gcc-version.patch \ - file://0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch \ - file://0001-elf-Discard-input-.note.gnu.build-id-sections.patch \ - file://0001-CVE-2021-42574.patch \ - file://161e87d12167b1e36193385485c1f6ce92f74f02.patch \ -" -S = "${WORKDIR}/git"meta/recipes-devtools/binutils/binutils-2.38.inc new file +35
-0@@ -0,0 +1,35 @@ +LIC_FILES_CHKSUM="\ + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\ + file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\ + file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + " + +# When upgrading to 2.39, please make sure there is no trailing .0, so +# that upstream version check can work correctly. +PV = "2.38" +CVE_VERSION = "2.38" +SRCBRANCH ?= "binutils-2_38-branch" + +UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)" + +SRCREV ?= "a96f7ba94b69b588bf524624ff2410b31420c957" +BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=git" +SRC_URI = "\ + ${BINUTILS_GIT_URI} \ + file://0004-Point-scripts-location-to-libdir.patch \ + file://0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \ + file://0006-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \ + file://0007-warn-for-uses-of-system-directories-when-cross-linki.patch \ + file://0008-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \ + file://0009-Use-libtool-2.4.patch \ + file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \ + file://0011-sync-with-OE-libtool-changes.patch \ + file://0012-Check-for-clang-before-checking-gcc-version.patch \ +" +S = "${WORKDIR}/git"meta/recipes-devtools/binutils/binutils-cross-canadian_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-cross-canadian_2.37.bb +0
-0meta/recipes-devtools/binutils/binutils-cross-testsuite_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-cross-testsuite_2.37.bb +0
-0meta/recipes-devtools/binutils/binutils-cross_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-cross_2.37.bb +0
-0meta/recipes-devtools/binutils/binutils-crosssdk_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-crosssdk_2.37.bb +0
-0meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch deleted +0
-2001@@ -1,2001 +0,0 @@ -From b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5 Mon Sep 17 00:00:00 2001 -From: Nick Clifton <[email protected]> -Date: Tue, 9 Nov 2021 13:25:42 +0000 -Subject: [PATCH] Add --unicode option to control how unicode characters are - handled by display tools. - - * nm.c: Add --unicode option to control how unicode characters are - handled. - * objdump.c: Likewise. - * readelf.c: Likewise. - * strings.c: Likewise. - * binutils.texi: Document the new feature. - * NEWS: Document the new feature. - * testsuite/binutils-all/unicode.exp: New file. - * testsuite/binutils-all/nm.hex.unicode - * testsuite/binutils-all/strings.escape.unicode - * testsuite/binutils-all/objdump.highlight.unicode - * testsuite/binutils-all/readelf.invalid.unicode - -CVE: CVE-2021-42574 -Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5] - -RP: Added tweak uint -> unsigned int partial backport of -https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=795588aec4f894206863c938bd6d716895886009 - -Signed-off-by: pgowda <[email protected]> ---- - binutils/ChangeLog | 15 + - binutils/NEWS | 9 + - binutils/doc/binutils.texi | 78 ++++ - binutils/nm.c | 228 ++++++++++- - binutils/objdump.c | 235 ++++++++++-- - binutils/readelf.c | 190 +++++++++- - binutils/strings.c | 757 ++++++++++++++++++++++++++++++++++--- - 7 files changed, 1409 insertions(+), 103 deletions(-) - -diff --git a/binutils/ChangeLog b/binutils/ChangeLog ---- a/binutils/ChangeLog 2021-12-19 19:00:27.038540406 -0800 -+++ b/binutils/ChangeLog 2021-12-19 19:28:42.733565078 -0800 -@@ -1,3 +1,18 @@ -+2021-11-09 Nick Clifton <[email protected]> -+ -+ * nm.c: Add --unicode option to control how unicode characters are -+ handled. -+ * objdump.c: Likewise. -+ * readelf.c: Likewise. -+ * strings.c: Likewise. -+ * binutils.texi: Document the new feature. -+ * NEWS: Document the new feature. -+ * testsuite/binutils-all/unicode.exp: New file. -+ * testsuite/binutils-all/nm.hex.unicode -+ * testsuite/binutils-all/strings.escape.unicode -+ * testsuite/binutils-all/objdump.highlight.unicode -+ * testsuite/binutils-all/readelf.invalid.unicode -+ - 2021-07-16 Nick Clifton <[email protected]> - - * po/sv.po: Updated Swedish translation. -diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi ---- a/binutils/doc/binutils.texi 2021-12-19 19:00:27.042540338 -0800 -+++ b/binutils/doc/binutils.texi 2021-12-19 19:27:56.526354667 -0800 -@@ -812,6 +812,7 @@ nm [@option{-A}|@option{-o}|@option{--pr - [@option{-s}|@option{--print-armap}] - [@option{-t} @var{radix}|@option{--radix=}@var{radix}] - [@option{-u}|@option{--undefined-only}] -+ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] - [@option{-V}|@option{--version}] - [@option{-X 32_64}] - [@option{--defined-only}] -@@ -1132,6 +1133,21 @@ Use @var{radix} as the radix for printin - @cindex undefined symbols - Display only undefined symbols (those external to each object file). - -+@item -U @var{[d|i|l|e|x|h]} -+@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]} -+Controls the display of UTF-8 encoded mulibyte characters in strings. -+The default (@option{--unicode=default}) is to give them no special -+treatment. The @option{--unicode=locale} option displays the sequence -+in the current locale, which may or may not support them. The options -+@option{--unicode=hex} and @option{--unicode=invalid} display them as -+hex byte sequences enclosed by either angle brackets or curly braces. -+ -+The @option{--unicode=escape} option displays them as escape sequences -+(@var{\uxxxx}) and the @option{--unicode=highlight} option displays -+them as escape sequences highlighted in red (if supported by the -+output device). The colouring is intended to draw attention to the -+presence of unicode sequences where they might not be expected. -+ - @item -V - @itemx --version - Show the version number of @command{nm} and exit. -@@ -2247,6 +2263,7 @@ objdump [@option{-a}|@option{--archive-h - [@option{--prefix-strip=}@var{level}] - [@option{--insn-width=}@var{width}] - [@option{--visualize-jumps[=color|=extended-color|=off]} -+ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] - [@option{-V}|@option{--version}] - [@option{-H}|@option{--help}] - @var{objfile}@dots{} -@@ -2921,6 +2938,21 @@ When displaying symbols include those wh - special in some way and which would not normally be of interest to the - user. - -+@item -U @var{[d|i|l|e|x|h]} -+@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]} -+Controls the display of UTF-8 encoded mulibyte characters in strings. -+The default (@option{--unicode=default}) is to give them no special -+treatment. The @option{--unicode=locale} option displays the sequence -+in the current locale, which may or may not support them. The options -+@option{--unicode=hex} and @option{--unicode=invalid} display them as -+hex byte sequences enclosed by either angle brackets or curly braces. -+ -+The @option{--unicode=escape} option displays them as escape sequences -+(@var{\uxxxx}) and the @option{--unicode=highlight} option displays -+them as escape sequences highlighted in red (if supported by the -+output device). The colouring is intended to draw attention to the -+presence of unicode sequences where they might not be expected. -+ - @item -V - @itemx --version - Print the version number of @command{objdump} and exit. -@@ -3197,6 +3229,7 @@ strings [@option{-afovV}] [@option{-}@va - [@option{-n} @var{min-len}] [@option{--bytes=}@var{min-len}] - [@option{-t} @var{radix}] [@option{--radix=}@var{radix}] - [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}] -+ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] - [@option{-}] [@option{--all}] [@option{--print-file-name}] - [@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}] - [@option{-w}] [@option{--include-all-whitespace}] -@@ -3288,6 +3321,28 @@ single-8-bit-byte characters, @samp{b} = - littleendian. Useful for finding wide character strings. (@samp{l} - and @samp{b} apply to, for example, Unicode UTF-16/UCS-2 encodings). - -+@item -U @var{[d|i|l|e|x|h]} -+@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]} -+Controls the display of UTF-8 encoded mulibyte characters in strings. -+The default (@option{--unicode=default}) is to give them no special -+treatment, and instead rely upon the setting of the -+@option{--encoding} option. The other values for this option -+automatically enable @option{--encoding=S}. -+ -+The @option{--unicode=invalid} option treats them as non-graphic -+characters and hence not part of a valid string. All the remaining -+options treat them as valid string characters. -+ -+The @option{--unicode=locale} option displays them in the current -+locale, which may or may not support UTF-8 encoding. The -+@option{--unicode=hex} option displays them as hex byte sequences -+enclosed between @var{<>} characters. The @option{--unicode=escape} -+option displays them as escape sequences (@var{\uxxxx}) and the -+@option{--unicode=highlight} option displays them as escape sequences -+highlighted in red (if supported by the output device). The colouring -+is intended to draw attention to the presence of unicode sequences -+where they might not be expected. -+ - @item -T @var{bfdname} - @itemx --target=@var{bfdname} - @cindex object code format -@@ -4796,6 +4851,7 @@ readelf [@option{-a}|@option{--all}] - [@option{--demangle@var{=style}}|@option{--no-demangle}] - [@option{--quiet}] - [@option{--recurse-limit}|@option{--no-recurse-limit}] -+ [@option{-U} @var{method}|@option{--unicode=}@var{method}] - [@option{-n}|@option{--notes}] - [@option{-r}|@option{--relocs}] - [@option{-u}|@option{--unwind}] -@@ -4962,6 +5018,28 @@ necessary in order to demangle truly com - that if the recursion limit is disabled then stack exhaustion is - possible and any bug reports about such an event will be rejected. - -+@item -U @var{[d|i|l|e|x|h]} -+@itemx --unicode=[default|invalid|locale|escape|hex|highlight] -+Controls the display of non-ASCII characters in identifier names. -+The default (@option{--unicode=locale} or @option{--unicode=default}) is -+to treat them as multibyte characters and display them in the current -+locale. All other versions of this option treat the bytes as UTF-8 -+encoded values and attempt to interpret them. If they cannot be -+interpreted or if the @option{--unicode=invalid} option is used then -+they are displayed as a sequence of hex bytes, encloses in curly -+parethesis characters. -+ -+Using the @option{--unicode=escape} option will display the characters -+as as unicode escape sequences (@var{\uxxxx}). Using the -+@option{--unicode=hex} will display the characters as hex byte -+sequences enclosed between angle brackets. -+ -+Using the @option{--unicode=highlight} will display the characters as -+unicode escape sequences but it will also highlighted them in red, -+assuming that colouring is supported by the output device. The -+colouring is intended to draw attention to the presence of unicode -+sequences when they might not be expected. -+ - @item -e - @itemx --headers - Display all the headers in the file. Equivalent to @option{-h -l -S}. -diff --git a/binutils/NEWS b/binutils/NEWS ---- a/binutils/NEWS 2021-12-19 19:00:27.038540406 -0800 -+++ b/binutils/NEWS 2021-12-19 19:30:04.764162972 -0800 -@@ -1,5 +1,14 @@ - -*- text -*- - -+* Tools which display symbols or strings (readelf, strings, nm, objdump) -+ have a new command line option which controls how unicode characters are -+ handled. By default they are treated as normal for the tool. Using -+ --unicode=locale will display them according to the current locale. -+ Using --unicode=hex will display them as hex byte values, whilst -+ --unicode=escape will display them as escape sequences. In addition -+ using --unicode=highlight will display them as unicode escape sequences -+ highlighted in red (if supported by the output device). -+ - Changes in 2.37: - - * The readelf tool has a new command line option which can be used to specify -diff --git a/binutils/nm.c b/binutils/nm.c ---- a/binutils/nm.c 2021-12-19 19:00:27.046540270 -0800 -+++ b/binutils/nm.c 2021-12-19 19:36:34.797491555 -0800 -@@ -38,6 +38,11 @@ - #include "bucomm.h" - #include "plugin-api.h" - #include "plugin.h" -+#include "safe-ctype.h" -+ -+#ifndef streq -+#define streq(a,b) (strcmp ((a),(b)) == 0) -+#endif - - /* When sorting by size, we use this structure to hold the size and a - pointer to the minisymbol. */ -@@ -216,6 +221,18 @@ static const char *plugin_target = NULL; - static bfd *lineno_cache_bfd; - static bfd *lineno_cache_rel_bfd; - -+typedef enum unicode_display_type -+{ -+ unicode_default = 0, -+ unicode_locale, -+ unicode_escape, -+ unicode_hex, -+ unicode_highlight, -+ unicode_invalid -+} unicode_display_type; -+ -+static unicode_display_type unicode_display = unicode_default; -+ - enum long_option_values - { - OPTION_TARGET = 200, -@@ -260,6 +277,7 @@ static struct option long_options[] = - {"target", required_argument, 0, OPTION_TARGET}, - {"defined-only", no_argument, &defined_only, 1}, - {"undefined-only", no_argument, &undefined_only, 1}, -+ {"unicode", required_argument, NULL, 'U'}, - {"version", no_argument, &show_version, 1}, - {"with-symbol-versions", no_argument, &with_symbol_versions, 1}, - {"without-symbol-versions", no_argument, &with_symbol_versions, 0}, -@@ -313,6 +331,8 @@ usage (FILE *stream, int status) - -t, --radix=RADIX Use RADIX for printing symbol values\n\ - --target=BFDNAME Specify the target object format as BFDNAME\n\ - -u, --undefined-only Display only undefined symbols\n\ -+ -U {d|s|i|x|e|h} Specify how to treat UTF-8 encoded unicode characters\n\ -+ --unicode={default|show|invalid|hex|escape|highlight}\n\ - --with-symbol-versions Display version strings after symbol names\n\ - -X 32_64 (ignored)\n\ - @FILE Read options from FILE\n\ -@@ -432,6 +452,187 @@ get_coff_symbol_type (const struct inter - return bufp; - } - -+/* Convert a potential UTF-8 encoded sequence in IN into characters in OUT. -+ The conversion format is controlled by the unicode_display variable. -+ Returns the number of characters added to OUT. -+ Returns the number of bytes consumed from IN in CONSUMED. -+ Always consumes at least one byte and displays at least one character. */ -+ -+static unsigned int -+display_utf8 (const unsigned char * in, char * out, unsigned int * consumed) -+{ -+ char * orig_out = out; -+ unsigned int nchars = 0; -+ unsigned int j; -+ -+ if (unicode_display == unicode_default) -+ goto invalid; -+ -+ if (in[0] < 0xc0) -+ goto invalid; -+ -+ if ((in[1] & 0xc0) != 0x80) -+ goto invalid; -+ -+ if ((in[0] & 0x20) == 0) -+ { -+ nchars = 2; -+ goto valid; -+ } -+ -+ if ((in[2] & 0xc0) != 0x80) -+ goto invalid; -+ -+ if ((in[0] & 0x10) == 0) -+ { -+ nchars = 3; -+ goto valid; -+ } -+ -+ if ((in[3] & 0xc0) != 0x80) -+ goto invalid; -+ -+ nchars = 4; -+ -+ valid: -+ switch (unicode_display) -+ { -+ case unicode_locale: -+ /* Copy the bytes into the output buffer as is. */ -+ memcpy (out, in, nchars); -+ out += nchars; -+ break; -+ -+ case unicode_invalid: -+ case unicode_hex: -+ out += sprintf (out, "%c", unicode_display == unicode_hex ? '<' : '{'); -+ out += sprintf (out, "0x"); -+ for (j = 0; j < nchars; j++) -+ out += sprintf (out, "%02x", in [j]); -+ out += sprintf (out, "%c", unicode_display == unicode_hex ? '>' : '}'); -+ break; -+ -+ case unicode_highlight: -+ if (isatty (1)) -+ out += sprintf (out, "\x1B[31;47m"); /* Red. */ -+ /* Fall through. */ -+ case unicode_escape: -+ switch (nchars) -+ { -+ case 2: -+ out += sprintf (out, "\\u%02x%02x", -+ ((in[0] & 0x1c) >> 2), -+ ((in[0] & 0x03) << 6) | (in[1] & 0x3f)); -+ break; -+ -+ case 3: -+ out += sprintf (out, "\\u%02x%02x", -+ ((in[0] & 0x0f) << 4) | ((in[1] & 0x3c) >> 2), -+ ((in[1] & 0x03) << 6) | ((in[2] & 0x3f))); -+ break; -+ -+ case 4: -+ out += sprintf (out, "\\u%02x%02x%02x", -+ ((in[0] & 0x07) << 6) | ((in[1] & 0x3c) >> 2), -+ ((in[1] & 0x03) << 6) | ((in[2] & 0x3c) >> 2), -+ ((in[2] & 0x03) << 6) | ((in[3] & 0x3f))); -+ break; -+ default: -+ /* URG. */ -+ break; -+ } -+ -+ if (unicode_display == unicode_highlight && isatty (1)) -+ out += sprintf (out, "\033[0m"); /* Default colour. */ -+ break; -+ -+ default: -+ /* URG */ -+ break; -+ } -+ -+ * consumed = nchars; -+ return out - orig_out; -+ -+ invalid: -+ /* Not a valid UTF-8 sequence. */ -+ *out = *in; -+ * consumed = 1; -+ return 1; -+} -+ -+/* Convert any UTF-8 encoded characters in NAME into the form specified by -+ unicode_display. Also converts control characters. Returns a static -+ buffer if conversion was necessary. -+ Code stolen from objdump.c:sanitize_string(). */ -+ -+static const char * -+convert_utf8 (const char * in) -+{ -+ static char * buffer = NULL; -+ static size_t buffer_len = 0; -+ const char * original = in; -+ char * out; -+ -+ /* Paranoia. */ -+ if (in == NULL) -+ return ""; -+ -+ /* See if any conversion is necessary. -+ In the majority of cases it will not be needed. */ -+ do -+ { -+ unsigned char c = *in++; -+ -+ if (c == 0) -+ return original; -+ -+ if (ISCNTRL (c)) -+ break; -+ -+ if (unicode_display != unicode_default && c >= 0xc0) -+ break; -+ } -+ while (1); -+ -+ /* Copy the input, translating as needed. */ -+ in = original; -+ if (buffer_len < (strlen (in) * 9)) -+ { -+ free ((void *) buffer); -+ buffer_len = strlen (in) * 9; -+ buffer = xmalloc (buffer_len + 1); -+ } -+ -+ out = buffer; -+ do -+ { -+ unsigned char c = *in++; -+ -+ if (c == 0) -+ break; -+ -+ if (ISCNTRL (c)) -+ { -+ *out++ = '^'; -+ *out++ = c + 0x40; -+ } -+ else if (unicode_display != unicode_default && c >= 0xc0) -+ { -+ unsigned int num_consumed; -+ -+ out += display_utf8 ((const unsigned char *)(in - 1), out, & num_consumed); -+ in += num_consumed - 1; -+ } -+ else -+ *out++ = c; -+ } -+ while (1); -+ -+ *out = 0; -+ return buffer; -+} -+ - /* Print symbol name NAME, read from ABFD, with printf format FORM, - demangling it if requested. */ - -@@ -444,6 +645,7 @@ print_symname (const char *form, struct - - if (name == NULL) - name = info->sinfo->name; -+ - if (!with_symbol_versions - && bfd_get_flavour (abfd) == bfd_target_elf_flavour) - { -@@ -451,6 +653,7 @@ print_symname (const char *form, struct - if (atver) - *atver = 0; - } -+ - if (do_demangle && *name) - { - alloc = bfd_demangle (abfd, name, demangle_flags); -@@ -458,6 +661,11 @@ print_symname (const char *form, struct - name = alloc; - } - -+ if (unicode_display != unicode_default) -+ { -+ name = convert_utf8 (name); -+ } -+ - if (info != NULL && info->elfinfo && with_symbol_versions) - { - const char *version_string; -@@ -1807,7 +2015,7 @@ main (int argc, char **argv) - fatal (_("fatal error: libbfd ABI mismatch")); - set_default_bfd_target (); - -- while ((c = getopt_long (argc, argv, "aABCDef:gHhjJlnopPrSst:uvVvX:", -+ while ((c = getopt_long (argc, argv, "aABCDef:gHhjJlnopPrSst:uU:vVvX:", - long_options, (int *) 0)) != EOF) - { - switch (c) -@@ -1900,6 +2108,24 @@ main (int argc, char **argv) - case 'u': - undefined_only = 1; - break; -+ -+ case 'U': -+ if (streq (optarg, "default") || streq (optarg, "d")) -+ unicode_display = unicode_default; -+ else if (streq (optarg, "locale") || streq (optarg, "l")) -+ unicode_display = unicode_locale; -+ else if (streq (optarg, "escape") || streq (optarg, "e")) -+ unicode_display = unicode_escape; -+ else if (streq (optarg, "invalid") || streq (optarg, "i")) -+ unicode_display = unicode_invalid; -+ else if (streq (optarg, "hex") || streq (optarg, "x")) -+ unicode_display = unicode_hex; -+ else if (streq (optarg, "highlight") || streq (optarg, "h")) -+ unicode_display = unicode_highlight; -+ else -+ fatal (_("invalid argument to -U/--unicode: %s"), optarg); -+ break; -+ - case 'V': - show_version = 1; - break; -diff --git a/binutils/objdump.c b/binutils/objdump.c ---- a/binutils/objdump.c 2021-12-19 19:00:27.046540270 -0800 -+++ b/binutils/objdump.c 2021-12-19 19:43:09.438736729 -0800 -@@ -204,6 +204,18 @@ static const struct objdump_private_desc - - /* The list of detected jumps inside a function. */ - static struct jump_info *detected_jumps = NULL; -+ -+typedef enum unicode_display_type -+{ -+ unicode_default = 0, -+ unicode_locale, -+ unicode_escape, -+ unicode_hex, -+ unicode_highlight, -+ unicode_invalid -+} unicode_display_type; -+ -+static unicode_display_type unicode_display = unicode_default; - - static void usage (FILE *, int) ATTRIBUTE_NORETURN; - static void -@@ -330,6 +342,9 @@ usage (FILE *stream, int status) - fprintf (stream, _("\ - -w, --wide Format output for more than 80 columns\n")); - fprintf (stream, _("\ -+ -U[d|l|i|x|e|h] Controls the display of UTF-8 unicode characters\n\ -+ --unicode=[default|locale|invalid|hex|escape|highlight]\n")); -+ fprintf (stream, _("\ - -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n")); - fprintf (stream, _("\ - --start-address=ADDR Only process data whose address is >= ADDR\n")); -@@ -420,17 +435,23 @@ static struct option long_options[]= - { - {"adjust-vma", required_argument, NULL, OPTION_ADJUST_VMA}, - {"all-headers", no_argument, NULL, 'x'}, -- {"private-headers", no_argument, NULL, 'p'}, -- {"private", required_argument, NULL, 'P'}, - {"architecture", required_argument, NULL, 'm'}, - {"archive-headers", no_argument, NULL, 'a'}, -+#ifdef ENABLE_LIBCTF -+ {"ctf", required_argument, NULL, OPTION_CTF}, -+ {"ctf-parent", required_argument, NULL, OPTION_CTF_PARENT}, -+#endif - {"debugging", no_argument, NULL, 'g'}, - {"debugging-tags", no_argument, NULL, 'e'}, - {"demangle", optional_argument, NULL, 'C'}, - {"disassemble", optional_argument, NULL, 'd'}, - {"disassemble-all", no_argument, NULL, 'D'}, -- {"disassembler-options", required_argument, NULL, 'M'}, - {"disassemble-zeroes", no_argument, NULL, 'z'}, -+ {"disassembler-options", required_argument, NULL, 'M'}, -+ {"dwarf", optional_argument, NULL, OPTION_DWARF}, -+ {"dwarf-check", no_argument, 0, OPTION_DWARF_CHECK}, -+ {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH}, -+ {"dwarf-start", required_argument, 0, OPTION_DWARF_START}, - {"dynamic-reloc", no_argument, NULL, 'R'}, - {"dynamic-syms", no_argument, NULL, 'T'}, - {"endian", required_argument, NULL, OPTION_ENDIAN}, -@@ -440,16 +461,23 @@ static struct option long_options[]= - {"full-contents", no_argument, NULL, 's'}, - {"headers", no_argument, NULL, 'h'}, - {"help", no_argument, NULL, 'H'}, -+ {"include", required_argument, NULL, 'I'}, - {"info", no_argument, NULL, 'i'}, -+ {"inlines", no_argument, 0, OPTION_INLINES}, -+ {"insn-width", required_argument, NULL, OPTION_INSN_WIDTH}, - {"line-numbers", no_argument, NULL, 'l'}, -- {"no-show-raw-insn", no_argument, &show_raw_insn, -1}, - {"no-addresses", no_argument, &no_addresses, 1}, -- {"process-links", no_argument, &process_links, true}, -+ {"no-recurse-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, -+ {"no-recursion-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, -+ {"no-show-raw-insn", no_argument, &show_raw_insn, -1}, -+ {"prefix", required_argument, NULL, OPTION_PREFIX}, - {"prefix-addresses", no_argument, &prefix_addresses, 1}, -+ {"prefix-strip", required_argument, NULL, OPTION_PREFIX_STRIP}, -+ {"private", required_argument, NULL, 'P'}, -+ {"private-headers", no_argument, NULL, 'p'}, -+ {"process-links", no_argument, &process_links, true}, - {"recurse-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, - {"recursion-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, -- {"no-recurse-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, -- {"no-recursion-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, - {"reloc", no_argument, NULL, 'r'}, - {"section", required_argument, NULL, 'j'}, - {"section-headers", no_argument, NULL, 'h'}, -@@ -457,28 +485,16 @@ static struct option long_options[]= - {"source", no_argument, NULL, 'S'}, - {"source-comment", optional_argument, NULL, OPTION_SOURCE_COMMENT}, - {"special-syms", no_argument, &dump_special_syms, 1}, -- {"include", required_argument, NULL, 'I'}, -- {"dwarf", optional_argument, NULL, OPTION_DWARF}, --#ifdef ENABLE_LIBCTF -- {"ctf", required_argument, NULL, OPTION_CTF}, -- {"ctf-parent", required_argument, NULL, OPTION_CTF_PARENT}, --#endif - {"stabs", no_argument, NULL, 'G'}, - {"start-address", required_argument, NULL, OPTION_START_ADDRESS}, - {"stop-address", required_argument, NULL, OPTION_STOP_ADDRESS}, - {"syms", no_argument, NULL, 't'}, - {"target", required_argument, NULL, 'b'}, -+ {"unicode", required_argument, NULL, 'U'}, - {"version", no_argument, NULL, 'V'}, -- {"wide", no_argument, NULL, 'w'}, -- {"prefix", required_argument, NULL, OPTION_PREFIX}, -- {"prefix-strip", required_argument, NULL, OPTION_PREFIX_STRIP}, -- {"insn-width", required_argument, NULL, OPTION_INSN_WIDTH}, -- {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH}, -- {"dwarf-start", required_argument, 0, OPTION_DWARF_START}, -- {"dwarf-check", no_argument, 0, OPTION_DWARF_CHECK}, -- {"inlines", no_argument, 0, OPTION_INLINES}, - {"visualize-jumps", optional_argument, 0, OPTION_VISUALIZE_JUMPS}, -- {0, no_argument, 0, 0} -+ {"wide", no_argument, NULL, 'w'}, -+ {NULL, no_argument, NULL, 0} - }; - - static void -@@ -488,9 +504,121 @@ nonfatal (const char *msg) - exit_status = 1; - } - -+/* Convert a potential UTF-8 encoded sequence in IN into characters in OUT. -+ The conversion format is controlled by the unicode_display variable. -+ Returns the number of characters added to OUT. -+ Returns the number of bytes consumed from IN in CONSUMED. -+ Always consumes at least one byte and displays at least one character. */ -+ -+static unsigned int -+display_utf8 (const unsigned char * in, char * out, unsigned int * consumed) -+{ -+ char * orig_out = out; -+ unsigned int nchars = 0; -+ unsigned int j; -+ -+ if (unicode_display == unicode_default) -+ goto invalid; -+ -+ if (in[0] < 0xc0) -+ goto invalid; -+ -+ if ((in[1] & 0xc0) != 0x80) -+ goto invalid; -+ -+ if ((in[0] & 0x20) == 0) -+ { -+ nchars = 2; -+ goto valid; -+ } -+ -+ if ((in[2] & 0xc0) != 0x80) -+ goto invalid; -+ -+ if ((in[0] & 0x10) == 0) -+ { -+ nchars = 3; -+ goto valid; -+ } -+ -+ if ((in[3] & 0xc0) != 0x80) -+ goto invalid; -+ -+ nchars = 4; -+ -+ valid: -+ switch (unicode_display) -+ { -+ case unicode_locale: -+ /* Copy the bytes into the output buffer as is. */ -+ memcpy (out, in, nchars); -+ out += nchars; -+ break; -+ -+ case unicode_invalid: -+ case unicode_hex: -+ out += sprintf (out, "%c", unicode_display == unicode_hex ? '<' : '{'); -+ out += sprintf (out, "0x"); -+ for (j = 0; j < nchars; j++) -+ out += sprintf (out, "%02x", in [j]); -+ out += sprintf (out, "%c", unicode_display == unicode_hex ? '>' : '}'); -+ break; -+ -+ case unicode_highlight: -+ if (isatty (1)) -+ out += sprintf (out, "\x1B[31;47m"); /* Red. */ -+ /* Fall through. */ -+ case unicode_escape: -+ switch (nchars) -+ { -+ case 2: -+ out += sprintf (out, "\\u%02x%02x", -+ ((in[0] & 0x1c) >> 2), -+ ((in[0] & 0x03) << 6) | (in[1] & 0x3f)); -+ break; -+ -+ case 3: -+ out += sprintf (out, "\\u%02x%02x", -+ ((in[0] & 0x0f) << 4) | ((in[1] & 0x3c) >> 2), -+ ((in[1] & 0x03) << 6) | ((in[2] & 0x3f))); -+ break; -+ -+ case 4: -+ out += sprintf (out, "\\u%02x%02x%02x", -+ ((in[0] & 0x07) << 6) | ((in[1] & 0x3c) >> 2), -+ ((in[1] & 0x03) << 6) | ((in[2] & 0x3c) >> 2), -+ ((in[2] & 0x03) << 6) | ((in[3] & 0x3f))); -+ break; -+ default: -+ /* URG. */ -+ break; -+ } -+ -+ if (unicode_display == unicode_highlight && isatty (1)) -+ out += sprintf (out, "\033[0m"); /* Default colour. */ -+ break; -+ -+ default: -+ /* URG */ -+ break; -+ } -+ -+ * consumed = nchars; -+ return out - orig_out; -+ -+ invalid: -+ /* Not a valid UTF-8 sequence. */ -+ *out = *in; -+ * consumed = 1; -+ return 1; -+} -+ - /* Returns a version of IN with any control characters - replaced by escape sequences. Uses a static buffer -- if necessary. */ -+ if necessary. -+ -+ If unicode display is enabled, then also handles the -+ conversion of unicode characters. */ - - static const char * - sanitize_string (const char * in) -@@ -508,40 +636,50 @@ sanitize_string (const char * in) - of cases it will not be needed. */ - do - { -- char c = *in++; -+ unsigned char c = *in++; - - if (c == 0) - return original; - - if (ISCNTRL (c)) - break; -+ -+ if (unicode_display != unicode_default && c >= 0xc0) -+ break; - } - while (1); - - /* Copy the input, translating as needed. */ - in = original; -- if (buffer_len < (strlen (in) * 2)) -+ if (buffer_len < (strlen (in) * 9)) - { - free ((void *) buffer); -- buffer_len = strlen (in) * 2; -+ buffer_len = strlen (in) * 9; - buffer = xmalloc (buffer_len + 1); - } - - out = buffer; - do - { -- char c = *in++; -+ unsigned char c = *in++; - - if (c == 0) - break; - -- if (!ISCNTRL (c)) -- *out++ = c; -- else -+ if (ISCNTRL (c)) - { - *out++ = '^'; - *out++ = c + 0x40; - } -+ else if (unicode_display != unicode_default && c >= 0xc0) -+ { -+ unsigned int num_consumed; -+ -+ out += display_utf8 ((const unsigned char *)(in - 1), out, & num_consumed); -+ in += num_consumed - 1; -+ } -+ else -+ *out++ = c; - } - while (1); - -@@ -4529,6 +4667,24 @@ dump_symbols (bfd *abfd ATTRIBUTE_UNUSED - free (alloc); - } - } -+ else if (unicode_display != unicode_default -+ && name != NULL && *name != '\0') -+ { -+ const char * sanitized_name; -+ -+ /* If we want to sanitize the name, we do it here, and -+ temporarily clobber it while calling bfd_print_symbol. -+ FIXME: This is a gross hack. */ -+ sanitized_name = sanitize_string (name); -+ if (sanitized_name != name) -+ (*current)->name = sanitized_name; -+ else -+ sanitized_name = NULL; -+ bfd_print_symbol (cur_bfd, stdout, *current, -+ bfd_print_symbol_all); -+ if (sanitized_name != NULL) -+ (*current)->name = name; -+ } - else - bfd_print_symbol (cur_bfd, stdout, *current, - bfd_print_symbol_all); -@@ -5212,7 +5368,7 @@ main (int argc, char **argv) - set_default_bfd_target (); - - while ((c = getopt_long (argc, argv, -- "pP:ib:m:M:VvCdDlfFaHhrRtTxsSI:j:wE:zgeGW::", -+ "CDE:FGHI:LM:P:RSTU:VW::ab:defghij:lm:prstvwxz", - long_options, (int *) 0)) - != EOF) - { -@@ -5495,6 +5651,23 @@ main (int argc, char **argv) - seenflag = true; - break; - -+ case 'U': -+ if (streq (optarg, "default") || streq (optarg, "d")) -+ unicode_display = unicode_default; -+ else if (streq (optarg, "locale") || streq (optarg, "l")) -+ unicode_display = unicode_locale; -+ else if (streq (optarg, "escape") || streq (optarg, "e")) -+ unicode_display = unicode_escape; -+ else if (streq (optarg, "invalid") || streq (optarg, "i")) -+ unicode_display = unicode_invalid; -+ else if (streq (optarg, "hex") || streq (optarg, "x")) -+ unicode_display = unicode_hex; -+ else if (streq (optarg, "highlight") || streq (optarg, "h")) -+ unicode_display = unicode_highlight; -+ else -+ fatal (_("invalid argument to -U/--unicode: %s"), optarg); -+ break; -+ - case 'H': - usage (stdout, 0); - /* No need to set seenflag or to break - usage() does not return. */ -diff --git a/binutils/readelf.c b/binutils/readelf.c ---- a/binutils/readelf.c 2021-12-19 19:00:27.058540065 -0800 -+++ b/binutils/readelf.c 2021-12-19 19:27:56.538354462 -0800 -@@ -328,6 +328,19 @@ typedef enum print_mode - } - print_mode; - -+typedef enum unicode_display_type -+{ -+ unicode_default = 0, -+ unicode_locale, -+ unicode_escape, -+ unicode_hex, -+ unicode_highlight, -+ unicode_invalid -+} unicode_display_type; -+ -+static unicode_display_type unicode_display = unicode_default; -+ -+ - /* Versioned symbol info. */ - enum versioned_symbol_info - { -@@ -632,11 +645,18 @@ print_symbol (signed int width, const ch - if (c == 0) - break; - -- /* Do not print control characters directly as they can affect terminal -- settings. Such characters usually appear in the names generated -- by the assembler for local labels. */ -- if (ISCNTRL (c)) -+ if (ISPRINT (c)) -+ { -+ putchar (c); -+ width_remaining --; -+ num_printed ++; -+ } -+ else if (ISCNTRL (c)) - { -+ /* Do not print control characters directly as they can affect terminal -+ settings. Such characters usually appear in the names generated -+ by the assembler for local labels. */ -+ - if (width_remaining < 2) - break; - -@@ -644,11 +664,137 @@ print_symbol (signed int width, const ch - width_remaining -= 2; - num_printed += 2; - } -- else if (ISPRINT (c)) -+ else if (c == 0x7f) - { -- putchar (c); -- width_remaining --; -- num_printed ++; -+ if (width_remaining < 5) -+ break; -+ printf ("<DEL>"); -+ width_remaining -= 5; -+ num_printed += 5; -+ } -+ else if (unicode_display != unicode_locale -+ && unicode_display != unicode_default) -+ { -+ /* Display unicode characters as something else. */ -+ unsigned char bytes[4]; -+ bool is_utf8; -+ unsigned int nbytes; -+ -+ bytes[0] = c; -+ -+ if (bytes[0] < 0xc0) -+ { -+ nbytes = 1; -+ is_utf8 = false; -+ } -+ else -+ { -+ bytes[1] = *symbol++; -+ -+ if ((bytes[1] & 0xc0) != 0x80) -+ { -+ is_utf8 = false; -+ /* Do not consume this character. It may only -+ be the first byte in the sequence that was -+ corrupt. */ -+ --symbol; -+ nbytes = 1; -+ } -+ else if ((bytes[0] & 0x20) == 0) -+ { -+ is_utf8 = true; -+ nbytes = 2; -+ } -+ else -+ { -+ bytes[2] = *symbol++; -+ -+ if ((bytes[2] & 0xc0) != 0x80) -+ { -+ is_utf8 = false; -+ symbol -= 2; -+ nbytes = 1; -+ } -+ else if ((bytes[0] & 0x10) == 0) -+ { -+ is_utf8 = true; -+ nbytes = 3; -+ } -+ else -+ { -+ bytes[3] = *symbol++; -+ -+ nbytes = 4; -+ -+ if ((bytes[3] & 0xc0) != 0x80) -+ { -+ is_utf8 = false; -+ symbol -= 3; -+ nbytes = 1; -+ } -+ else -+ is_utf8 = true; -+ } -+ } -+ } -+ -+ if (unicode_display == unicode_invalid) -+ is_utf8 = false; -+ -+ if (unicode_display == unicode_hex || ! is_utf8) -+ { -+ unsigned int i; -+ -+ if (width_remaining < (nbytes * 2) + 2) -+ break; -+ -+ putchar (is_utf8 ? '<' : '{'); -+ printf ("0x"); -+ for (i = 0; i < nbytes; i++) -+ printf ("%02x", bytes[i]); -+ putchar (is_utf8 ? '>' : '}'); -+ } -+ else -+ { -+ if (unicode_display == unicode_highlight && isatty (1)) -+ printf ("\x1B[31;47m"); /* Red. */ -+ -+ switch (nbytes) -+ { -+ case 2: -+ if (width_remaining < 6) -+ break; -+ printf ("\\u%02x%02x", -+ (bytes[0] & 0x1c) >> 2, -+ ((bytes[0] & 0x03) << 6) | (bytes[1] & 0x3f)); -+ break; -+ case 3: -+ if (width_remaining < 6) -+ break; -+ printf ("\\u%02x%02x", -+ ((bytes[0] & 0x0f) << 4) | ((bytes[1] & 0x3c) >> 2), -+ ((bytes[1] & 0x03) << 6) | (bytes[2] & 0x3f)); -+ break; -+ case 4: -+ if (width_remaining < 8) -+ break; -+ printf ("\\u%02x%02x%02x", -+ ((bytes[0] & 0x07) << 6) | ((bytes[1] & 0x3c) >> 2), -+ ((bytes[1] & 0x03) << 6) | ((bytes[2] & 0x3c) >> 2), -+ ((bytes[2] & 0x03) << 6) | (bytes[3] & 0x3f)); -+ -+ break; -+ default: -+ /* URG. */ -+ break; -+ } -+ -+ if (unicode_display == unicode_highlight && isatty (1)) -+ printf ("\033[0m"); /* Default colour. */ -+ } -+ -+ if (bytes[nbytes - 1] == 0) -+ break; - } - else - { -@@ -4668,6 +4814,7 @@ static struct option options[] = - {"syms", no_argument, 0, 's'}, - {"silent-truncation",no_argument, 0, 'T'}, - {"section-details", no_argument, 0, 't'}, -+ {"unicode", required_argument, NULL, 'U'}, - {"unwind", no_argument, 0, 'u'}, - {"version-info", no_argument, 0, 'V'}, - {"version", no_argument, 0, 'v'}, -@@ -4744,6 +4891,12 @@ usage (FILE * stream) - fprintf (stream, _("\ - --no-recurse-limit Disable a demangling recursion limit\n")); - fprintf (stream, _("\ -+ -U[dlexhi] --unicode=[default|locale|escape|hex|highlight|invalid]\n\ -+ Display unicode characters as determined by the current locale\n\ -+ (default), escape sequences, \"<hex sequences>\", highlighted\n\ -+ escape sequences, or treat them as invalid and display as\n\ -+ \"{hex sequences}\"\n")); -+ fprintf (stream, _("\ - -n --notes Display the core notes (if present)\n")); - fprintf (stream, _("\ - -r --relocs Display the relocations (if present)\n")); -@@ -4928,7 +5081,7 @@ parse_args (struct dump_data *dumpdata, - usage (stderr); - - while ((c = getopt_long -- (argc, argv, "ACDHILNPR:STVWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF) -+ (argc, argv, "ACDHILNPR:STU:VWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF) - { - switch (c) - { -@@ -5130,6 +5283,25 @@ parse_args (struct dump_data *dumpdata, - /* Ignored for backward compatibility. */ - break; - -+ case 'U': -+ if (optarg == NULL) -+ error (_("Missing arg to -U/--unicode")); /* Can this happen ? */ -+ else if (streq (optarg, "default") || streq (optarg, "d")) -+ unicode_display = unicode_default; -+ else if (streq (optarg, "locale") || streq (optarg, "l")) -+ unicode_display = unicode_locale; -+ else if (streq (optarg, "escape") || streq (optarg, "e")) -+ unicode_display = unicode_escape; -+ else if (streq (optarg, "invalid") || streq (optarg, "i")) -+ unicode_display = unicode_invalid; -+ else if (streq (optarg, "hex") || streq (optarg, "x")) -+ unicode_display = unicode_hex; -+ else if (streq (optarg, "highlight") || streq (optarg, "h")) -+ unicode_display = unicode_highlight; -+ else -+ error (_("invalid argument to -U/--unicode: %s"), optarg); -+ break; -+ - case OPTION_SYM_BASE: - sym_base = 0; - if (optarg != NULL) -diff --git a/binutils/strings.c b/binutils/strings.c ---- a/binutils/strings.c 2021-12-19 19:00:27.058540065 -0800 -+++ b/binutils/strings.c 2021-12-19 19:48:26.205313218 -0800 -@@ -55,6 +55,19 @@ - -T {bfdname} - Specify a non-default object file format. - -+ --unicode={default|locale|invalid|hex|escape|highlight} -+ -u {d|l|i|x|e|h} -+ Determine how to handle UTF-8 unicode characters. The default -+ is no special treatment. All other versions of this option -+ only apply if the encoding is valid and enabling the option -+ implies --encoding=S. -+ The 'locale' option displays the characters according to the -+ current locale. The 'invalid' option treats them as -+ non-string characters. The 'hex' option displays them as hex -+ byte sequences. The 'escape' option displays them as escape -+ sequences and the 'highlight' option displays them as -+ coloured escape sequences. -+ - --output-separator=sep_string - -s sep_string String used to separate parsed strings in output. - Default is newline. -@@ -76,6 +89,22 @@ - #include "safe-ctype.h" - #include "bucomm.h" - -+#ifndef streq -+#define streq(a,b) (strcmp ((a),(b)) == 0) -+#endif -+ -+typedef enum unicode_display_type -+{ -+ unicode_default = 0, -+ unicode_locale, -+ unicode_escape, -+ unicode_hex, -+ unicode_highlight, -+ unicode_invalid -+} unicode_display_type; -+ -+static unicode_display_type unicode_display = unicode_default; -+ - #define STRING_ISGRAPHIC(c) \ - ( (c) >= 0 \ - && (c) <= 255 \ -@@ -94,7 +123,7 @@ extern int errno; - static int address_radix; - - /* Minimum length of sequence of graphic chars to trigger output. */ --static int string_min; -+static unsigned int string_min; - - /* Whether or not we include all whitespace as a graphic char. */ - static bool include_all_whitespace; -@@ -121,21 +150,22 @@ static char *output_separator; - static struct option long_options[] = - { - {"all", no_argument, NULL, 'a'}, -+ {"bytes", required_argument, NULL, 'n'}, - {"data", no_argument, NULL, 'd'}, -+ {"encoding", required_argument, NULL, 'e'}, -+ {"help", no_argument, NULL, 'h'}, -+ {"include-all-whitespace", no_argument, NULL, 'w'}, -+ {"output-separator", required_argument, NULL, 's'}, - {"print-file-name", no_argument, NULL, 'f'}, -- {"bytes", required_argument, NULL, 'n'}, - {"radix", required_argument, NULL, 't'}, -- {"include-all-whitespace", no_argument, NULL, 'w'}, -- {"encoding", required_argument, NULL, 'e'}, - {"target", required_argument, NULL, 'T'}, -- {"output-separator", required_argument, NULL, 's'}, -- {"help", no_argument, NULL, 'h'}, -+ {"unicode", required_argument, NULL, 'U'}, - {"version", no_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} - }; - - static bool strings_file (char *); --static void print_strings (const char *, FILE *, file_ptr, int, int, char *); -+static void print_strings (const char *, FILE *, file_ptr, int, char *); - static void usage (FILE *, int) ATTRIBUTE_NORETURN; - - int main (int, char **); -@@ -171,7 +201,7 @@ main (int argc, char **argv) - encoding = 's'; - output_separator = NULL; - -- while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:Vv0123456789", -+ while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:U:Vv0123456789", - long_options, (int *) 0)) != EOF) - { - switch (optc) -@@ -244,6 +274,23 @@ main (int argc, char **argv) - output_separator = optarg; - break; - -+ case 'U': -+ if (streq (optarg, "default") || streq (optarg, "d")) -+ unicode_display = unicode_default; -+ else if (streq (optarg, "locale") || streq (optarg, "l")) -+ unicode_display = unicode_locale; -+ else if (streq (optarg, "escape") || streq (optarg, "e")) -+ unicode_display = unicode_escape; -+ else if (streq (optarg, "invalid") || streq (optarg, "i")) -+ unicode_display = unicode_invalid; -+ else if (streq (optarg, "hex") || streq (optarg, "x")) -+ unicode_display = unicode_hex; -+ else if (streq (optarg, "highlight") || streq (optarg, "h")) -+ unicode_display = unicode_highlight; -+ else -+ fatal (_("invalid argument to -U/--unicode: %s"), optarg); -+ break; -+ - case 'V': - case 'v': - print_version ("strings"); -@@ -258,6 +305,9 @@ main (int argc, char **argv) - } - } - -+ if (unicode_display != unicode_default) -+ encoding = 'S'; -+ - if (numeric_opt != 0) - { - string_min = (int) strtoul (argv[numeric_opt - 1] + 1, &s, 0); -@@ -293,14 +343,14 @@ main (int argc, char **argv) - { - datasection_only = false; - SET_BINARY (fileno (stdin)); -- print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL); -+ print_strings ("{standard input}", stdin, 0, 0, (char *) NULL); - files_given = true; - } - else - { - for (; optind < argc; ++optind) - { -- if (strcmp (argv[optind], "-") == 0) -+ if (streq (argv[optind], "-")) - datasection_only = false; - else - { -@@ -342,7 +392,7 @@ strings_a_section (bfd *abfd, asection * - } - - *got_a_section = true; -- print_strings (filename, NULL, sect->filepos, 0, sectsize, (char *) mem); -+ print_strings (filename, NULL, sect->filepos, sectsize, (char *) mem); - free (mem); - } - -@@ -427,7 +477,7 @@ strings_file (char *file) - return false; - } - -- print_strings (file, stream, (file_ptr) 0, 0, 0, (char *) 0); -+ print_strings (file, stream, (file_ptr) 0, 0, (char *) NULL); - - if (fclose (stream) == EOF) - { -@@ -551,6 +601,626 @@ unget_part_char (long c, file_ptr *addre - } - } - } -+ -+static void -+print_filename_and_address (const char * filename, file_ptr address) -+{ -+ if (print_filenames) -+ printf ("%s: ", filename); -+ -+ if (! print_addresses) -+ return; -+ -+ switch (address_radix) -+ { -+ case 8: -+ if (sizeof (address) > sizeof (long)) -+ { -+#ifndef __MSVCRT__ -+ printf ("%7llo ", (unsigned long long) address); -+#else -+ printf ("%7I64o ", (unsigned long long) address); -+#endif -+ } -+ else -+ printf ("%7lo ", (unsigned long) address); -+ break; -+ -+ case 10: -+ if (sizeof (address) > sizeof (long)) -+ { -+#ifndef __MSVCRT__ -+ printf ("%7llu ", (unsigned long long) address); -+#else -+ printf ("%7I64d ", (unsigned long long) address); -+#endif -+ } -+ else -+ printf ("%7ld ", (long) address); -+ break; -+ -+ case 16: -+ if (sizeof (address) > sizeof (long)) -+ { -+#ifndef __MSVCRT__ -+ printf ("%7llx ", (unsigned long long) address); -+#else -+ printf ("%7I64x ", (unsigned long long) address); -+#endif -+ } -+ else -+ printf ("%7lx ", (unsigned long) address); -+ break; -+ } -+} -+ -+/* Return non-zero if the bytes starting at BUFFER form a valid UTF-8 encoding. -+ If the encoding is valid then returns the number of bytes it uses. */ -+ -+static unsigned int -+is_valid_utf8 (const unsigned char * buffer, unsigned long buflen) -+{ -+ if (buffer[0] < 0xc0) -+ return 0; -+ -+ if (buflen < 2) -+ return 0; -+ -+ if ((buffer[1] & 0xc0) != 0x80) -+ return 0; -+ -+ if ((buffer[0] & 0x20) == 0) -+ return 2; -+ -+ if (buflen < 3) -+ return 0; -+ -+ if ((buffer[2] & 0xc0) != 0x80) -+ return 0; -+ -+ if ((buffer[0] & 0x10) == 0) -+ return 3; -+ -+ if (buflen < 4) -+ return 0; -+ -+ if ((buffer[3] & 0xc0) != 0x80) -+ return 0; -+ -+ return 4; -+} -+ -+/* Display a UTF-8 encoded character in BUFFER according to the setting -+ of unicode_display. The character is known to be valid. -+ Returns the number of bytes consumed. */ -+ -+static unsigned int -+display_utf8_char (const unsigned char * buffer) -+{ -+ unsigned int j; -+ unsigned int utf8_len; -+ -+ switch (buffer[0] & 0x30) -+ { -+ case 0x00: -+ case 0x10: -+ utf8_len = 2; -+ break; -+ case 0x20: -+ utf8_len = 3; -+ break; -+ default: -+ utf8_len = 4; -+ } -+ -+ switch (unicode_display) -+ { -+ default: -+ fprintf (stderr, "ICE: unexpected unicode display type\n"); -+ break; -+ -+ case unicode_escape: -+ case unicode_highlight: -+ if (unicode_display == unicode_highlight && isatty (1)) -+ printf ("\x1B[31;47m"); /* Red. */ -+ -+ switch (utf8_len) -+ { -+ case 2: -+ printf ("\\u%02x%02x", -+ ((buffer[0] & 0x1c) >> 2), -+ ((buffer[0] & 0x03) << 6) | (buffer[1] & 0x3f)); -+ break; -+ -+ case 3: -+ printf ("\\u%02x%02x", -+ ((buffer[0] & 0x0f) << 4) | ((buffer[1] & 0x3c) >> 2), -+ ((buffer[1] & 0x03) << 6) | ((buffer[2] & 0x3f))); -+ break; -+ -+ case 4: -+ printf ("\\u%02x%02x%02x", -+ ((buffer[0] & 0x07) << 6) | ((buffer[1] & 0x3c) >> 2), -+ ((buffer[1] & 0x03) << 6) | ((buffer[2] & 0x3c) >> 2), -+ ((buffer[2] & 0x03) << 6) | ((buffer[3] & 0x3f))); -+ break; -+ default: -+ /* URG. */ -+ break; -+ } -+ -+ if (unicode_display == unicode_highlight && isatty (1)) -+ printf ("\033[0m"); /* Default colour. */ -+ break; -+ -+ case unicode_hex: -+ putchar ('<'); -+ printf ("0x"); -+ for (j = 0; j < utf8_len; j++) -+ printf ("%02x", buffer [j]); -+ putchar ('>'); -+ break; -+ -+ case unicode_locale: -+ printf ("%.1s", buffer); -+ break; -+ } -+ -+ return utf8_len; -+} -+ -+/* Display strings in BUFFER. Treat any UTF-8 encoded characters encountered -+ according to the setting of the unicode_display variable. The buffer -+ contains BUFLEN bytes. -+ -+ Display the characters as if they started at ADDRESS and are contained in -+ FILENAME. */ -+ -+static void -+print_unicode_buffer (const char * filename, -+ file_ptr address, -+ const unsigned char * buffer, -+ unsigned long buflen) -+{ -+ /* Paranoia checks... */ -+ if (filename == NULL -+ || buffer == NULL -+ || unicode_display == unicode_default -+ || encoding != 'S' -+ || encoding_bytes != 1) -+ { -+ fprintf (stderr, "ICE: bad arguments to print_unicode_buffer\n"); -+ return; -+ } -+ -+ if (buflen == 0) -+ return; -+ -+ /* We must only display strings that are at least string_min *characters* -+ long. So we scan the buffer in two stages. First we locate the start -+ of a potential string. Then we walk along it until we have found -+ string_min characters. Then we go back to the start point and start -+ displaying characters according to the unicode_display setting. */ -+ -+ unsigned long start_point = 0; -+ unsigned long i = 0; -+ unsigned int char_len = 1; -+ unsigned int num_found = 0; -+ -+ for (i = 0; i < buflen; i += char_len) -+ { -+ int c = buffer[i]; -+ -+ char_len = 1; -+ -+ /* Find the first potential character of a string. */ -+ if (! STRING_ISGRAPHIC (c)) -+ { -+ num_found = 0; -+ continue; -+ } -+ -+ if (c > 126) -+ { -+ if (c < 0xc0) -+ { -+ num_found = 0; -+ continue; -+ } -+ -+ if ((char_len = is_valid_utf8 (buffer + i, buflen - i)) == 0) -+ { -+ char_len = 1; -+ num_found = 0; -+ continue; -+ } -+ -+ if (unicode_display == unicode_invalid) -+ { -+ /* We have found a valid UTF-8 character, but we treat it as non-graphic. */ -+ num_found = 0; -+ continue; -+ } -+ } -+ -+ if (num_found == 0) -+ /* We have found a potential starting point for a string. */ -+ start_point = i; -+ -+ ++ num_found; -+ -+ if (num_found >= string_min) -+ break; -+ } -+ -+ if (num_found < string_min) -+ return; -+ -+ print_filename_and_address (filename, address + start_point); -+ -+ /* We have found string_min characters. Display them and any -+ more that follow. */ -+ for (i = start_point; i < buflen; i += char_len) -+ { -+ int c = buffer[i]; -+ -+ char_len = 1; -+ -+ if (! STRING_ISGRAPHIC (c)) -+ break; -+ else if (c < 127) -+ putchar (c); -+ else if (! is_valid_utf8 (buffer + i, buflen - i)) -+ break; -+ else if (unicode_display == unicode_invalid) -+ break; -+ else -+ char_len = display_utf8_char (buffer + i); -+ } -+ -+ if (output_separator) -+ fputs (output_separator, stdout); -+ else -+ putchar ('\n'); -+ -+ /* FIXME: Using tail recursion here is lazy programming... */ -+ print_unicode_buffer (filename, address + i, buffer + i, buflen - i); -+} -+ -+static int -+get_unicode_byte (FILE * stream, -+ unsigned char * putback, -+ unsigned int * num_putback, -+ unsigned int * num_read) -+{ -+ if (* num_putback > 0) -+ { -+ * num_putback = * num_putback - 1; -+ return putback [* num_putback]; -+ } -+ -+ * num_read = * num_read + 1; -+ -+#if defined(HAVE_GETC_UNLOCKED) && HAVE_DECL_GETC_UNLOCKED -+ return getc_unlocked (stream); -+#else -+ return getc (stream); -+#endif -+} -+ -+/* Helper function for print_unicode_stream. */ -+ -+static void -+print_unicode_stream_body (const char * filename, -+ file_ptr address, -+ FILE * stream, -+ unsigned char * putback_buf, -+ unsigned int num_putback, -+ unsigned char * print_buf) -+{ -+ /* It would be nice if we could just read the stream into a buffer -+ and then process if with print_unicode_buffer. But the input -+ might be huge or it might time-locked (eg stdin). So instead -+ we go one byte at a time... */ -+ -+ file_ptr start_point = 0; -+ unsigned int num_read = 0; -+ unsigned int num_chars = 0; -+ unsigned int num_print = 0; -+ int c = 0; -+ -+ /* Find a series of string_min characters. Put them into print_buf. */ -+ do -+ { -+ if (num_chars >= string_min) -+ break; -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ -+ if (! STRING_ISGRAPHIC (c)) -+ { -+ num_chars = num_print = 0; -+ continue; -+ } -+ -+ if (num_chars == 0) -+ start_point = num_read - 1; -+ -+ if (c < 127) -+ { -+ print_buf[num_print] = c; -+ num_chars ++; -+ num_print ++; -+ continue; -+ } -+ -+ if (c < 0xc0) -+ { -+ num_chars = num_print = 0; -+ continue; -+ } -+ -+ /* We *might* have a UTF-8 sequence. Time to start peeking. */ -+ char utf8[4]; -+ -+ utf8[0] = c; -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[1] = c; -+ -+ if ((utf8[1] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ continue; -+ } -+ else if ((utf8[0] & 0x20) == 0) -+ { -+ /* A valid 2-byte UTF-8 encoding. */ -+ if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ } -+ else -+ { -+ print_buf[num_print ++] = utf8[0]; -+ print_buf[num_print ++] = utf8[1]; -+ num_chars ++; -+ } -+ continue; -+ } -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[2] = c; -+ -+ if ((utf8[2] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ continue; -+ } -+ else if ((utf8[0] & 0x10) == 0) -+ { -+ /* A valid 3-byte UTF-8 encoding. */ -+ if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ } -+ else -+ { -+ print_buf[num_print ++] = utf8[0]; -+ print_buf[num_print ++] = utf8[1]; -+ print_buf[num_print ++] = utf8[2]; -+ num_chars ++; -+ } -+ continue; -+ } -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[3] = c; -+ -+ if ((utf8[3] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[3]; -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ } -+ /* We have a valid 4-byte UTF-8 encoding. */ -+ else if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[3]; -+ putback_buf[num_putback++] = utf8[1]; -+ putback_buf[num_putback++] = utf8[2]; -+ num_chars = num_print = 0; -+ } -+ else -+ { -+ print_buf[num_print ++] = utf8[0]; -+ print_buf[num_print ++] = utf8[1]; -+ print_buf[num_print ++] = utf8[2]; -+ print_buf[num_print ++] = utf8[3]; -+ num_chars ++; -+ } -+ } -+ while (1); -+ -+ if (num_chars >= string_min) -+ { -+ /* We know that we have string_min valid characters in print_buf, -+ and there may be more to come in the stream. Start displaying -+ them. */ -+ -+ print_filename_and_address (filename, address + start_point); -+ -+ unsigned int i; -+ for (i = 0; i < num_print;) -+ { -+ if (print_buf[i] < 127) -+ putchar (print_buf[i++]); -+ else -+ i += display_utf8_char (print_buf + i); -+ } -+ -+ /* OK so now we have to start read unchecked bytes. */ -+ -+ /* Find a series of string_min characters. Put them into print_buf. */ -+ do -+ { -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ -+ if (! STRING_ISGRAPHIC (c)) -+ break; -+ -+ if (c < 127) -+ { -+ putchar (c); -+ continue; -+ } -+ -+ if (c < 0xc0) -+ break; -+ -+ /* We *might* have a UTF-8 sequence. Time to start peeking. */ -+ unsigned char utf8[4]; -+ -+ utf8[0] = c; -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[1] = c; -+ -+ if ((utf8[1] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else if ((utf8[0] & 0x20) == 0) -+ { -+ /* Valid 2-byte UTF-8. */ -+ if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else -+ { -+ (void) display_utf8_char (utf8); -+ continue; -+ } -+ } -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[2] = c; -+ -+ if ((utf8[2] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else if ((utf8[0] & 0x10) == 0) -+ { -+ /* Valid 3-byte UTF-8. */ -+ if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else -+ { -+ (void) display_utf8_char (utf8); -+ continue; -+ } -+ } -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[3] = c; -+ -+ if ((utf8[3] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[3]; -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[3]; -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else -+ /* A valid 4-byte UTF-8 encoding. */ -+ (void) display_utf8_char (utf8); -+ } -+ while (1); -+ -+ if (output_separator) -+ fputs (output_separator, stdout); -+ else -+ putchar ('\n'); -+ } -+ -+ if (c != EOF) -+ /* FIXME: Using tail recursion here is lazy, but it works. */ -+ print_unicode_stream_body (filename, address + num_read, stream, putback_buf, num_putback, print_buf); -+} -+ -+/* Display strings read in from STREAM. Treat any UTF-8 encoded characters -+ encountered according to the setting of the unicode_display variable. -+ The stream is positioned at ADDRESS and is attached to FILENAME. */ -+ -+static void -+print_unicode_stream (const char * filename, -+ file_ptr address, -+ FILE * stream) -+{ -+ /* Paranoia checks... */ -+ if (filename == NULL -+ || stream == NULL -+ || unicode_display == unicode_default -+ || encoding != 'S' -+ || encoding_bytes != 1) -+ { -+ fprintf (stderr, "ICE: bad arguments to print_unicode_stream\n"); -+ return; -+ } -+ -+ /* Allocate space for string_min 4-byte utf-8 characters. */ -+ unsigned char * print_buf = xmalloc ((4 * string_min) + 1); -+ /* We should never have to put back more than 4 bytes. */ -+ unsigned char putback_buf[5]; -+ unsigned int num_putback = 0; -+ -+ print_unicode_stream_body (filename, address, stream, putback_buf, num_putback, print_buf); -+ free (print_buf); -+} - - /* Find the strings in file FILENAME, read from STREAM. - Assume that STREAM is positioned so that the next byte read -@@ -566,20 +1236,29 @@ unget_part_char (long c, file_ptr *addre - - static void - print_strings (const char *filename, FILE *stream, file_ptr address, -- int stop_point, int magiccount, char *magic) -+ int magiccount, char *magic) - { -+ if (unicode_display != unicode_default) -+ { -+ if (magic != NULL) -+ print_unicode_buffer (filename, address, -+ (const unsigned char *) magic, magiccount); -+ -+ if (stream != NULL) -+ print_unicode_stream (filename, address, stream); -+ return; -+ } -+ - char *buf = (char *) xmalloc (sizeof (char) * (string_min + 1)); - - while (1) - { - file_ptr start; -- int i; -+ unsigned int i; - long c; - - /* See if the next `string_min' chars are all graphic chars. */ - tryline: -- if (stop_point && address >= stop_point) -- break; - start = address; - for (i = 0; i < string_min; i++) - { -@@ -601,51 +1280,7 @@ print_strings (const char *filename, FIL - - /* We found a run of `string_min' graphic characters. Print up - to the next non-graphic character. */ -- -- if (print_filenames) -- printf ("%s: ", filename); -- if (print_addresses) -- switch (address_radix) -- { -- case 8: -- if (sizeof (start) > sizeof (long)) -- { --#ifndef __MSVCRT__ -- printf ("%7llo ", (unsigned long long) start); --#else -- printf ("%7I64o ", (unsigned long long) start); --#endif -- } -- else -- printf ("%7lo ", (unsigned long) start); -- break; -- -- case 10: -- if (sizeof (start) > sizeof (long)) -- { --#ifndef __MSVCRT__ -- printf ("%7llu ", (unsigned long long) start); --#else -- printf ("%7I64d ", (unsigned long long) start); --#endif -- } -- else -- printf ("%7ld ", (long) start); -- break; -- -- case 16: -- if (sizeof (start) > sizeof (long)) -- { --#ifndef __MSVCRT__ -- printf ("%7llx ", (unsigned long long) start); --#else -- printf ("%7I64x ", (unsigned long long) start); --#endif -- } -- else -- printf ("%7lx ", (unsigned long) start); -- break; -- } -+ print_filename_and_address (filename, start); - - buf[i] = '\0'; - fputs (buf, stdout); -@@ -697,6 +1332,8 @@ usage (FILE *stream, int status) - -T --target=<BFDNAME> Specify the binary file format\n\ - -e --encoding={s,S,b,l,B,L} Select character size and endianness:\n\ - s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\ -+ --unicode={default|show|invalid|hex|escape|highlight}\n\ -+ -u {d|s|i|x|e|h} Specify how to treat UTF-8 encoded unicode characters\n\ - -s --output-separator=<string> String used to separate strings in output.\n\ - @<file> Read options from <file>\n\ - -h --help Display this information\n\meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch +6
-6@@ -1,4 +1,4 @@ -From 257ad1ce148417e1cefe2332d8acc5c8216c2522 Mon Sep 17 00:00:00 2001 +From 07bb7fbdacaf9cd6a1a252ffbc98f4e05e305d50 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:58:54 +0000 Subject: [PATCH] binutils-crosssdk: Generate relocatable SDKs@@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <[email protected]> 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gold/layout.cc b/gold/layout.cc -index a27cb071c75..32b52890b39 100644 +index 3efe8d98ae9..9cc389664a6 100644 --- a/gold/layout.cc +++ b/gold/layout.cc -@@ -5032,7 +5032,7 @@ Layout::create_interp(const Target* target) +@@ -5033,7 +5033,7 @@ Layout::create_interp(const Target* target) gold_assert(interp != NULL); }@@ -34,7 +34,7 @@ index a27cb071c75..32b52890b39 100644 Output_section_data* odata = new Output_data_const(interp, len, 1); diff --git a/ld/genscripts.sh b/ld/genscripts.sh -index 088417ef2d5..46a2db7005c 100755 +index 278f212bdad..0c52ebee4d0 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -304,6 +304,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"@@ -59,10 +59,10 @@ index 088417ef2d5..46a2db7005c 100755 DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc -index 29a8f0781d5..75e46f4adaf 100644 +index bf2268bb0ad..b1811ef130f 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc -@@ -147,8 +147,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then +@@ -148,8 +148,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi fimeta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch deleted +0
-215@@ -1,215 +0,0 @@ -From b2e18d3ea300f7491705b6e86a7cc3d6366e3b1f Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" <[email protected]> -Date: Tue, 30 Nov 2021 20:40:38 -0800 -Subject: [PATCH] elf: Discard input .note.gnu.build-id sections - -1. Discard input .note.gnu.build-id sections. -2. Clear the build ID field before writing. -3. Use bfd_make_section_anyway_with_flags to create the output -.note.gnu.build-id section. - - PR ld/28639 - * ldelf.c (ldelf_after_open): Discard input .note.gnu.build-id - sections, excluding the first one. - (write_build_id): Clear the build ID field before writing. - (ldelf_setup_build_id): Use bfd_make_section_anyway_with_flags - to create the output .note.gnu.build-id section. - * testsuite/ld-elf/build-id.exp: New file. - * testsuite/ld-elf/pr28639a.rd: Likewise. - * testsuite/ld-elf/pr28639b.rd: Likewise. - * testsuite/ld-elf/pr28639c.rd: Likewise. - * testsuite/ld-elf/pr28639d.rd: Likewise. - -Upstream-Status: Backport - -Reference to upstream patch: -[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1f1d0f8888a6c944e612b416a2a6e11abcf5199f] ---- - ld/ldelf.c | 15 ++++++- - ld/testsuite/ld-elf/build-id.exp | 77 ++++++++++++++++++++++++++++++++ - ld/testsuite/ld-elf/pr28639a.rd | 6 +++ - ld/testsuite/ld-elf/pr28639b.rd | 6 +++ - ld/testsuite/ld-elf/pr28639c.rd | 10 +++++ - ld/testsuite/ld-elf/pr28639d.rd | 4 ++ - 6 files changed, 117 insertions(+), 1 deletion(-) - create mode 100644 ld/testsuite/ld-elf/build-id.exp - create mode 100644 ld/testsuite/ld-elf/pr28639a.rd - create mode 100644 ld/testsuite/ld-elf/pr28639b.rd - create mode 100644 ld/testsuite/ld-elf/pr28639c.rd - create mode 100644 ld/testsuite/ld-elf/pr28639d.rd - -diff --git a/ld/ldelf.c b/ld/ldelf.c -index 21e655bb55c..8501d98b48f 100644 ---- a/ld/ldelf.c -+++ b/ld/ldelf.c -@@ -1043,6 +1043,15 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, - /* Do not allow executable files to be used as inputs to the link. */ - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - { -+ /* Discard input .note.gnu.build-id sections. */ -+ s = bfd_get_section_by_name (abfd, ".note.gnu.build-id"); -+ while (s != NULL) -+ { -+ if (s != elf_tdata (link_info.output_bfd)->o->build_id.sec) -+ s->flags |= SEC_EXCLUDE; -+ s = bfd_get_next_section_by_name (NULL, s); -+ } -+ - if (abfd->xvec->flavour == bfd_target_elf_flavour - && !bfd_input_just_syms (abfd) - && elf_tdata (abfd) != NULL -@@ -1387,6 +1396,9 @@ write_build_id (bfd *abfd) - id_bits = contents + size; - size = asec->size - size; - -+ /* Clear the build ID field. */ -+ memset (id_bits, 0, size); -+ - bfd_h_put_32 (abfd, sizeof "GNU", &e_note->namesz); - bfd_h_put_32 (abfd, size, &e_note->descsz); - bfd_h_put_32 (abfd, NT_GNU_BUILD_ID, &e_note->type); -@@ -1418,7 +1430,8 @@ ldelf_setup_build_id (bfd *ibfd) - - flags = (SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY - | SEC_LINKER_CREATED | SEC_READONLY | SEC_DATA); -- s = bfd_make_section_with_flags (ibfd, ".note.gnu.build-id", flags); -+ s = bfd_make_section_anyway_with_flags (ibfd, ".note.gnu.build-id", -+ flags); - if (s != NULL && bfd_set_section_alignment (s, 2)) - { - struct elf_obj_tdata *t = elf_tdata (link_info.output_bfd); -diff --git a/ld/testsuite/ld-elf/build-id.exp b/ld/testsuite/ld-elf/build-id.exp -new file mode 100644 -index 00000000000..19c22a75c4d ---- /dev/null -+++ b/ld/testsuite/ld-elf/build-id.exp -@@ -0,0 +1,77 @@ -+# Expect script for --build-id tests. -+# Copyright (C) 2021 Free Software Foundation, Inc. -+# -+# This file is part of the GNU Binutils. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+# MA 02110-1301, USA. -+# -+ -+# Exclude non-ELF targets. -+ -+if ![is_elf_format] { -+ return -+} -+ -+if { [istarget frv-*-*] || [istarget lm32-*-*] } { -+ return -+} -+ -+if { !([istarget *-*-linux*] -+ || [istarget arm*-*-uclinuxfdpiceabi] -+ || [istarget *-*-nacl*] -+ || [istarget *-*-gnu*]) } then { -+ return -+} -+ -+run_ld_link_tests [list \ -+ [list \ -+ "pr28639a.o" \ -+ "-r --build-id=md5" \ -+ "" \ -+ "" \ -+ {start.s} \ -+ {{readelf {--notes} pr28639a.rd}} \ -+ "pr28639a.o" \ -+ ] \ -+ [list \ -+ "pr28639a.o" \ -+ "-r --build-id" \ -+ "" \ -+ "" \ -+ {dummy.s} \ -+ {{readelf {--notes} pr28639b.rd}} \ -+ "pr28639b.o" \ -+ ] \ -+ [list \ -+ "pr28639a" \ -+ "--build-id tmpdir/pr28639a.o tmpdir/pr28639b.o" \ -+ "" \ -+ "" \ -+ {dummy.s} \ -+ {{readelf {--notes} pr28639b.rd} \ -+ {readelf {--notes} pr28639c.rd}} \ -+ "pr28639a" \ -+ ] \ -+ [list \ -+ "pr28639b" \ -+ "--build-id=none tmpdir/pr28639a.o tmpdir/pr28639b.o" \ -+ "" \ -+ "" \ -+ {dummy.s} \ -+ {{readelf {--notes} pr28639d.rd}} \ -+ "pr28639b" \ -+ ] \ -+] -diff --git a/ld/testsuite/ld-elf/pr28639a.rd b/ld/testsuite/ld-elf/pr28639a.rd -new file mode 100644 -index 00000000000..e85087064d0 ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr28639a.rd -@@ -0,0 +1,6 @@ -+#... -+Displaying notes found in: \.note\.gnu\.build-id -+ Owner Data size Description -+ GNU 0x00000010 NT_GNU_BUILD_ID \(unique build ID bitstring\) -+ Build ID: [0-9a-f]+ -+#pass -diff --git a/ld/testsuite/ld-elf/pr28639b.rd b/ld/testsuite/ld-elf/pr28639b.rd -new file mode 100644 -index 00000000000..04dcb04bec2 ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr28639b.rd -@@ -0,0 +1,6 @@ -+#... -+Displaying notes found in: \.note\.gnu\.build-id -+ Owner Data size Description -+ GNU 0x00000014 NT_GNU_BUILD_ID \(unique build ID bitstring\) -+ Build ID: [0-9a-f]+ -+#pass -diff --git a/ld/testsuite/ld-elf/pr28639c.rd b/ld/testsuite/ld-elf/pr28639c.rd -new file mode 100644 -index 00000000000..64221e5fa51 ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr28639c.rd -@@ -0,0 +1,10 @@ -+#failif -+#... -+Displaying notes found in: \.note\.gnu\.build-id -+ Owner Data size Description -+ GNU 0x[0-9a-f]+ NT_GNU_BUILD_ID \(unique build ID bitstring\) -+ Build ID: [0-9a-f]+ -+ Owner Data size Description -+ GNU 0x[0-9a-f]+ NT_GNU_BUILD_ID \(unique build ID bitstring\) -+ Build ID: [0-9a-f]+ -+#... -diff --git a/ld/testsuite/ld-elf/pr28639d.rd b/ld/testsuite/ld-elf/pr28639d.rd -new file mode 100644 -index 00000000000..897c8493efa ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr28639d.rd -@@ -0,0 +1,4 @@ -+#failif -+#... -+Displaying notes found in: \.note\.gnu\.build-id -+#... --- -meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch +2
-2@@ -1,4 +1,4 @@ -From 6e93d0328f499569db7ce6396f94f304ce340df8 Mon Sep 17 00:00:00 2001 +From f820ab7ea7e94d4df548be3388163ff2efb2ea96 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 6 Mar 2017 23:37:05 -0800 Subject: [PATCH] binutils-cross: Do not generate linker script directories@@ -22,7 +22,7 @@ Signed-off-by: Khem Raj <[email protected]> 1 file changed, 25 deletions(-) diff --git a/ld/genscripts.sh b/ld/genscripts.sh -index 46a2db7005c..4bb7c33f560 100755 +index 0c52ebee4d0..1acbe66bd2e 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -235,31 +235,6 @@ append_to_lib_path()meta/recipes-devtools/binutils/binutils/0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch +8
-8@@ -1,4 +1,4 @@ -From d49016d3faf684319bf3ac37450558920d70be03 Mon Sep 17 00:00:00 2001 +From b2ccd25828b40310caeb094c0413e3a30a4dc0a5 Mon Sep 17 00:00:00 2001 From: Richard Purdie <[email protected]> Date: Wed, 19 Feb 2020 09:51:16 -0800 Subject: [PATCH] binutils-nativesdk: Search for alternative ld.so.conf in SDK@@ -29,7 +29,7 @@ Signed-off-by: Khem Raj <[email protected]> 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ld/Makefile.am b/ld/Makefile.am -index f8e99325361..fd196541f59 100644 +index b55a873d927..61db131fb0d 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -42,7 +42,8 @@ ZLIBINC = @zlibinc@@@ -43,10 +43,10 @@ index f8e99325361..fd196541f59 100644 NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) diff --git a/ld/Makefile.in b/ld/Makefile.in -index ef2e99e08da..cb8f5bfb70e 100644 +index 61e93eeaf1e..860eb21a785 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -555,7 +555,8 @@ ZLIB = @zlibdir@ -lz +@@ -556,7 +556,8 @@ ZLIB = @zlibdir@ -lz ZLIBINC = @zlibinc@ ELF_CLFAGS = -DELF_LIST_OPTIONS=@elf_list_options@ \ -DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \@@ -57,10 +57,10 @@ index ef2e99e08da..cb8f5bfb70e 100644 AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) diff --git a/ld/ldelf.c b/ld/ldelf.c -index 21e655bb55c..d1615003ede 100644 +index 121c25d948f..34cbc60e5e9 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c -@@ -911,7 +911,7 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force, +@@ -930,7 +930,7 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force, info.path = NULL; info.len = info.alloc = 0;@@ -70,7 +70,7 @@ index 21e655bb55c..d1615003ede 100644 if (!ldelf_parse_ld_so_conf (&info, tmppath)) { diff --git a/ld/ldmain.c b/ld/ldmain.c -index 42660eb9a3c..5a4a4d5da3d 100644 +index ea72b14a301..1ae90a77749 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -70,6 +70,7 @@ char *program_name;@@ -82,7 +82,7 @@ index 42660eb9a3c..5a4a4d5da3d 100644 /* The canonical representation of ld_sysroot. */ char *ld_canon_sysroot; diff --git a/ld/ldmain.h b/ld/ldmain.h -index 39d08a6c378..4c3519e7970 100644 +index f6d05a02f59..e60292cd522 100644 --- a/ld/ldmain.h +++ b/ld/ldmain.h @@ -23,6 +23,7 @@meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch renamed from meta/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch +4
-4@@ -1,4 +1,4 @@ -From 1a9fcaae50e63b993019bd4dc00219e43421efdc Mon Sep 17 00:00:00 2001 +From 7a7b777cdfded080aab1021fa6bcdb20345f5cfd Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:09:58 +0000 Subject: [PATCH] Point scripts location to libdir@@ -12,7 +12,7 @@ Signed-off-by: Khem Raj <[email protected]> 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ld/Makefile.am b/ld/Makefile.am -index fd196541f59..d94fa7e64e1 100644 +index 61db131fb0d..5b5ee64d121 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -51,7 +51,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)@@ -25,10 +25,10 @@ index fd196541f59..d94fa7e64e1 100644 EMUL = @EMUL@ EMULATION_OFILES = @EMULATION_OFILES@ diff --git a/ld/Makefile.in b/ld/Makefile.in -index cb8f5bfb70e..9a58879c5ca 100644 +index 860eb21a785..d719747919c 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -563,7 +563,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -564,7 +564,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers.meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch renamed from meta/recipes-devtools/binutils/binutils/0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch +4
-4@@ -1,4 +1,4 @@ -From 29517900352336708495d41902b5b7e8cc9a401a Mon Sep 17 00:00:00 2001 +From edddb1f294d667eac94649ba0665fe464990ed18 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:27:17 +0000 Subject: [PATCH] Only generate an RPATH entry if LD_RUN_PATH is not empty@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <[email protected]> 1 file changed, 4 insertions(+) diff --git a/ld/ldelf.c b/ld/ldelf.c -index d1615003ede..6a894285b11 100644 +index 34cbc60e5e9..b1965a9e96f 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c -@@ -1250,6 +1250,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, +@@ -1277,6 +1277,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, && command_line.rpath == NULL) { path = (const char *) getenv ("LD_RUN_PATH");@@ -26,7 +26,7 @@ index d1615003ede..6a894285b11 100644 if (path && ldelf_search_needed (path, &n, force, is_linux, elfsize)) -@@ -1610,6 +1612,8 @@ ldelf_before_allocation (char *audit, char *depaudit, +@@ -1636,6 +1638,8 @@ ldelf_before_allocation (char *audit, char *depaudit, rpath = command_line.rpath; if (rpath == NULL) rpath = (const char *) getenv ("LD_RUN_PATH");meta/recipes-devtools/binutils/binutils/0006-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch renamed from meta/recipes-devtools/binutils/binutils/0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch +3
-3@@ -1,4 +1,4 @@ -From 37581c8ce9d98a1183706e12a2c9a73f7f40462d Mon Sep 17 00:00:00 2001 +From fc9e8b99969bb32a4b009eab763bade6c554ef73 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:39:01 +0000 Subject: [PATCH] don't let the distro compiler point to the wrong installation@@ -17,10 +17,10 @@ Signed-off-by: Khem Raj <[email protected]> 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in -index 4f1213b983b..2ba18b75cac 100644 +index abef3c4601b..880c8826482 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in -@@ -367,7 +367,8 @@ install-strip: install +@@ -385,7 +385,8 @@ install-strip: install # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the # default multilib, so we have to take CFLAGS into account as well, # since it will be passed the multilib flags.meta/recipes-devtools/binutils/binutils/0007-warn-for-uses-of-system-directories-when-cross-linki.patch renamed from meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch +33
-15@@ -1,4 +1,4 @@ -From 99e1565b9d2b929d4ee4e9da6f63766b22b23fc3 Mon Sep 17 00:00:00 2001 +From 9fb1bafb20371d82b674778d2a8b5c9444fed417 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Fri, 15 Jan 2016 06:31:09 +0000 Subject: [PATCH] warn for uses of system directories when cross linking@@ -58,10 +58,12 @@ Signed-off-by: Khem Raj <[email protected]> ld/ld.texi | 12 ++++++++++++ ld/ldfile.c | 17 +++++++++++++++++ ld/ldlex.h | 2 ++ - ld/ldmain.c | 2 ++ + ld/ldmain.c | 6 ++++-- ld/lexsup.c | 16 ++++++++++++++++ - 9 files changed, 86 insertions(+) + 9 files changed, 88 insertions(+), 2 deletions(-) +diff --git a/ld/config.in b/ld/config.in +index 26d55a00d47..ffad464783c 100644 --- a/ld/config.in +++ b/ld/config.in @@ -43,6 +43,9 @@@@ -74,9 +76,11 @@ Signed-off-by: Khem Raj <[email protected]> /* Additional extension a shared object might have. */ #undef EXTRA_SHLIB_EXTENSION +diff --git a/ld/configure b/ld/configure +index 26150d62898..1f9ec8ec580 100755 --- a/ld/configure +++ b/ld/configure -@@ -829,6 +829,7 @@ with_lib_path +@@ -831,6 +831,7 @@ with_lib_path enable_targets enable_64_bit_bfd with_sysroot@@ -84,7 +88,7 @@ Signed-off-by: Khem Raj <[email protected]> enable_gold enable_got enable_compressed_debug_sections -@@ -1498,6 +1499,8 @@ Optional Features: +@@ -1500,6 +1501,8 @@ Optional Features: --enable-checking enable run-time checks --enable-targets alternative target configurations --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)@@ -93,7 +97,7 @@ Signed-off-by: Khem Raj <[email protected]> --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-got=<type> GOT handling scheme (target, single, negative, multigot) -@@ -15215,6 +15218,19 @@ fi +@@ -15312,6 +15315,19 @@ fi@@ -113,9 +117,11 @@ Signed-off-by: Khem Raj <[email protected]> # Check whether --enable-gold was given. if test "${enable_gold+set}" = set; then : enableval=$enable_gold; case "${enableval}" in +diff --git a/ld/configure.ac b/ld/configure.ac +index 7f4cff079b7..57d1abff870 100644 --- a/ld/configure.ac +++ b/ld/configure.ac -@@ -106,6 +106,16 @@ AC_SUBST(use_sysroot) +@@ -102,6 +102,16 @@ AC_SUBST(use_sysroot) AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)@@ -132,6 +138,8 @@ Signed-off-by: Khem Raj <[email protected]> dnl Use --enable-gold to decide if this linker should be the default. dnl "install_as_default" is set to false if gold is the default linker. dnl "installed_linker" is the installed BFD linker name. +diff --git a/ld/ld.h b/ld/ld.h +index f3086bf30de..db5064243c7 100644 --- a/ld/ld.h +++ b/ld/ld.h @@ -162,6 +162,14 @@ typedef struct@@ -149,9 +157,11 @@ Signed-off-by: Khem Raj <[email protected]> /* Big or little endian as set on command line. */ enum endian_enum endian; +diff --git a/ld/ld.texi b/ld/ld.texi +index fc75e9b3625..dca697d626e 100644 --- a/ld/ld.texi +++ b/ld/ld.texi -@@ -2863,6 +2863,18 @@ string identifying the original linked f +@@ -2892,6 +2892,18 @@ string identifying the original linked file does not change. Passing @code{none} for @var{style} disables the setting from any @code{--build-id} options earlier on the command line.@@ -170,9 +180,11 @@ Signed-off-by: Khem Raj <[email protected]> @end table @c man end +diff --git a/ld/ldfile.c b/ld/ldfile.c +index 731ae5f7aed..dd8f03fd960 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c -@@ -117,6 +117,23 @@ ldfile_add_library_path (const char *nam +@@ -117,6 +117,23 @@ ldfile_add_library_path (const char *name, bool cmdline) new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); else new_dirs->name = xstrdup (name);@@ -196,9 +208,11 @@ Signed-off-by: Khem Raj <[email protected]> } /* Try to open a BFD for a lang_input_statement. */ +diff --git a/ld/ldlex.h b/ld/ldlex.h +index bc58fea73cc..a1595589197 100644 --- a/ld/ldlex.h +++ b/ld/ldlex.h -@@ -163,6 +163,8 @@ enum option_values +@@ -164,6 +164,8 @@ enum option_values OPTION_CTF_VARIABLES, OPTION_NO_CTF_VARIABLES, OPTION_CTF_SHARE_TYPES,@@ -207,9 +221,11 @@ Signed-off-by: Khem Raj <[email protected]> }; /* The initial parser states. */ +diff --git a/ld/ldmain.c b/ld/ldmain.c +index 1ae90a77749..f40750fd816 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c -@@ -321,6 +321,8 @@ main (int argc, char **argv) +@@ -322,6 +322,8 @@ main (int argc, char **argv) command_line.warn_mismatch = true; command_line.warn_search_mismatch = true; command_line.check_section_addresses = -1;@@ -218,7 +234,7 @@ Signed-off-by: Khem Raj <[email protected]> /* We initialize DEMANGLING based on the environment variable COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the -@@ -1444,7 +1446,7 @@ undefined_symbol (struct bfd_link_info * +@@ -1447,7 +1449,7 @@ undefined_symbol (struct bfd_link_info *info, argv[1] = "undefined-symbol"; argv[2] = (char *) name; argv[3] = NULL;@@ -227,7 +243,7 @@ Signed-off-by: Khem Raj <[email protected]> if (verbose) einfo (_("%P: About to run error handling script '%s' with arguments: '%s' '%s'\n"), argv[0], argv[1], argv[2]); -@@ -1465,7 +1467,7 @@ undefined_symbol (struct bfd_link_info * +@@ -1468,7 +1470,7 @@ undefined_symbol (struct bfd_link_info *info, carry on to issue the normal error message. */ } #endif /* SUPPORT_ERROR_HANDLING_SCRIPT */@@ -236,9 +252,11 @@ Signed-off-by: Khem Raj <[email protected]> if (section != NULL) { if (error_count < MAX_ERRORS_IN_A_ROW) +diff --git a/ld/lexsup.c b/ld/lexsup.c +index 5acc47ed5a0..d03c6136ccf 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c -@@ -595,6 +595,14 @@ static const struct ld_option ld_options +@@ -600,6 +600,14 @@ static const struct ld_option ld_options[] = " <method> is: share-unconflicted (default),\n" " share-duplicated"), TWO_DASHES },@@ -253,7 +271,7 @@ Signed-off-by: Khem Raj <[email protected]> }; #define OPTION_COUNT ARRAY_SIZE (ld_options) -@@ -1686,6 +1694,14 @@ parse_args (unsigned argc, char **argv) +@@ -1702,6 +1710,14 @@ parse_args (unsigned argc, char **argv) config.print_map_discarded = true; break;meta/recipes-devtools/binutils/binutils/0008-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch renamed from meta/recipes-devtools/binutils/binutils/0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch +3
-4@@ -1,4 +1,4 @@ -From b77c5a67d4ac2513d0b4bab5e4dd1c33b339689b Mon Sep 17 00:00:00 2001 +From 00ae1ee97ad3ad0624798b28c6bab94a19b3ef39 Mon Sep 17 00:00:00 2001 From: Zhenhua Luo <[email protected]> Date: Sat, 11 Jun 2016 22:08:29 -0500 Subject: [PATCH] fix the incorrect assembling for ppc wait mnemonic@@ -7,15 +7,14 @@ The wait mnemonic for ppc targets is incorrectly assembled into 0x7c00003c due to duplicated address definition with waitasec instruction. The issue causes kernel boot calltrace for ppc targets when wait instruction is executed. -Signed-off-by: Zhenhua Luo <[email protected]> - Upstream-Status: Pending +Signed-off-by: Zhenhua Luo <[email protected]> --- opcodes/ppc-opc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c -index 13d8b6c3c07..cd979f9c80c 100644 +index a424dd924de..406d5b60917 100644 --- a/opcodes/ppc-opc.c +++ b/opcodes/ppc-opc.c @@ -6378,8 +6378,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {meta/recipes-devtools/binutils/binutils/0009-Use-libtool-2.4.patch renamed from meta/recipes-devtools/binutils/binutils/0013-Use-libtool-2.4.patch +3027
-937@@ -1,4 +1,4 @@ -From fd34d57c9e2a0bff1283a6707062ed4a42476b10 Mon Sep 17 00:00:00 2001 +From 9a0dea4d2f1f0f2c71f519e6195ef9cfacd9fda9 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Sun, 14 Feb 2016 17:04:07 +0000 Subject: [PATCH] Use libtool 2.4@@ -9,27 +9,28 @@ Upstream-Status: Pending Signed-off-by: Khem Raj <[email protected]> --- - bfd/configure | 1340 +++++++++++++++----- - bfd/configure.ac | 2 +- - binutils/configure | 1338 +++++++++++++++----- - gas/configure | 1338 +++++++++++++++----- - gprof/configure | 1338 +++++++++++++++----- - ld/configure | 1713 +++++++++++++++++++------- - libctf/configure | 1337 +++++++++++++++----- - libtool.m4 | 1100 +++++++++++------ - ltmain.sh | 2925 +++++++++++++++++++++++++++++--------------- - ltoptions.m4 | 2 +- - ltversion.m4 | 12 +- - lt~obsolete.m4 | 2 +- - opcodes/configure | 1338 +++++++++++++++----- - zlib/configure | 1338 +++++++++++++++----- - 14 files changed, 10995 insertions(+), 4128 deletions(-) + bfd/configure | 1333 +++++++++++++----- + bfd/configure.ac | 2 +- + binutils/configure | 1331 +++++++++++++----- + gas/configure | 1331 +++++++++++++----- + gprof/configure | 1331 +++++++++++++----- + ld/configure | 1704 +++++++++++++++++------ + libbacktrace/configure | 1534 +++++++++++++++------ + libctf/configure | 1330 +++++++++++++----- + libtool.m4 | 1093 ++++++++++----- + ltmain.sh | 2925 +++++++++++++++++++++++++++------------- + ltoptions.m4 | 2 +- + ltversion.m4 | 12 +- + lt~obsolete.m4 | 2 +- + opcodes/configure | 1331 +++++++++++++----- + zlib/configure | 1331 +++++++++++++----- + 15 files changed, 12067 insertions(+), 4525 deletions(-) diff --git a/bfd/configure b/bfd/configure -index daa51244369..79d0c4b4623 100755 +index b23c9eebfd7..fb25d046cd2 100755 --- a/bfd/configure +++ b/bfd/configure -@@ -705,6 +705,9 @@ OTOOL +@@ -707,6 +707,9 @@ OTOOL LIPO NMEDIT DSYMUTIL@@ -39,7 +40,7 @@ index daa51244369..79d0c4b4623 100755 OBJDUMP LN_S NM -@@ -823,6 +826,7 @@ enable_static +@@ -825,6 +828,7 @@ enable_static with_pic enable_fast_install with_gnu_ld@@ -47,7 +48,7 @@ index daa51244369..79d0c4b4623 100755 enable_libtool_lock enable_plugins enable_largefile -@@ -1507,6 +1511,8 @@ Optional Packages: +@@ -1509,6 +1513,8 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no]@@ -56,7 +57,7 @@ index daa51244369..79d0c4b4623 100755 --with-mmap try using mmap for BFD input files if available --with-separate-debug-dir=DIR Look for global separate debug info in DIR -@@ -4988,8 +4994,8 @@ esac +@@ -5029,8 +5035,8 @@ esac@@ -67,7 +68,7 @@ index daa51244369..79d0c4b4623 100755 -@@ -5029,7 +5035,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO +@@ -5070,7 +5076,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present.@@ -76,7 +77,7 @@ index daa51244369..79d0c4b4623 100755 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then -@@ -5715,8 +5721,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; +@@ -5757,8 +5763,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c"@@ -87,7 +88,7 @@ index daa51244369..79d0c4b4623 100755 && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes -@@ -5765,6 +5771,80 @@ esac +@@ -5807,6 +5813,80 @@ esac@@ -168,7 +169,7 @@ index daa51244369..79d0c4b4623 100755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : -@@ -5781,6 +5861,11 @@ case $reload_flag in +@@ -5823,6 +5903,11 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in@@ -180,7 +181,7 @@ index daa51244369..79d0c4b4623 100755 darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' -@@ -5949,7 +6034,8 @@ mingw* | pw32*) +@@ -5991,7 +6076,8 @@ mingw* | pw32*) lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else@@ -190,7 +191,7 @@ index daa51244369..79d0c4b4623 100755 lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -@@ -6103,6 +6189,21 @@ esac +@@ -6145,6 +6231,21 @@ esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; }@@ -212,7 +213,7 @@ index daa51244369..79d0c4b4623 100755 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown -@@ -6118,6 +6219,157 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -6160,6 +6261,157 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown@@ -370,7 +371,7 @@ index daa51244369..79d0c4b4623 100755 plugin_option= plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" for plugin in $plugin_names; do -@@ -6132,8 +6384,10 @@ for plugin in $plugin_names; do +@@ -6174,8 +6426,10 @@ for plugin in $plugin_names; do done if test -n "$ac_tool_prefix"; then@@ -383,7 +384,7 @@ index daa51244369..79d0c4b4623 100755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : -@@ -6149,7 +6403,7 @@ do +@@ -6191,7 +6445,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then@@ -392,7 +393,7 @@ index daa51244369..79d0c4b4623 100755 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi -@@ -6169,11 +6423,15 @@ $as_echo "no" >&6; } +@@ -6211,11 +6465,15 @@ $as_echo "no" >&6; } fi@@ -411,7 +412,7 @@ index daa51244369..79d0c4b4623 100755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : -@@ -6189,7 +6447,7 @@ do +@@ -6231,7 +6489,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then@@ -420,7 +421,7 @@ index daa51244369..79d0c4b4623 100755 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi -@@ -6208,6 +6466,10 @@ else +@@ -6250,6 +6508,10 @@ else $as_echo "no" >&6; } fi@@ -431,7 +432,7 @@ index daa51244369..79d0c4b4623 100755 if test "x$ac_ct_AR" = x; then AR="false" else -@@ -6219,25 +6481,20 @@ ac_tool_warned=yes ;; +@@ -6261,25 +6523,20 @@ ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi@@ -467,7 +468,7 @@ index daa51244369..79d0c4b4623 100755 -@@ -6248,6 +6505,63 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru +@@ -6290,6 +6547,63 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru@@ -531,7 +532,7 @@ index daa51244369..79d0c4b4623 100755 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -@@ -6588,8 +6902,8 @@ esac +@@ -6630,8 +6944,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address@@ -542,7 +543,7 @@ index daa51244369..79d0c4b4623 100755 # Handle CRLF in mingw tool chain opt_cr= -@@ -6625,6 +6939,7 @@ for ac_symprfx in "" "_"; do +@@ -6667,6 +6981,7 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi@@ -550,7 +551,7 @@ index daa51244369..79d0c4b4623 100755 # Check to see that the pipe works correctly. pipe_works=no -@@ -6666,6 +6981,18 @@ _LT_EOF +@@ -6708,6 +7023,18 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext@@ -569,7 +570,7 @@ index daa51244369..79d0c4b4623 100755 #ifdef __cplusplus extern "C" { #endif -@@ -6677,7 +7004,7 @@ _LT_EOF +@@ -6719,7 +7046,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */@@ -578,7 +579,7 @@ index daa51244369..79d0c4b4623 100755 const char *name; void *address; } -@@ -6703,8 +7030,8 @@ static const void *lt_preloaded_setup() { +@@ -6745,8 +7072,8 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext@@ -589,7 +590,7 @@ index daa51244369..79d0c4b4623 100755 LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 -@@ -6714,8 +7041,8 @@ _LT_EOF +@@ -6756,8 +7083,8 @@ _LT_EOF test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi@@ -600,7 +601,7 @@ index daa51244369..79d0c4b4623 100755 else echo "cannot find nm_test_func in $nlist" >&5 fi -@@ -6752,6 +7079,14 @@ else +@@ -6794,6 +7121,14 @@ else $as_echo "ok" >&6; } fi@@ -615,7 +616,7 @@ index daa51244369..79d0c4b4623 100755 -@@ -6770,6 +7105,47 @@ fi +@@ -6812,6 +7147,47 @@ fi@@ -663,7 +664,7 @@ index daa51244369..79d0c4b4623 100755 -@@ -6979,6 +7355,123 @@ esac +@@ -7021,6 +7397,123 @@ esac need_locks="$enable_libtool_lock"@@ -787,7 +788,7 @@ index daa51244369..79d0c4b4623 100755 case $host_os in rhapsody* | darwin*) -@@ -7542,6 +8035,8 @@ _LT_EOF +@@ -7584,6 +8077,8 @@ _LT_EOF $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5@@ -796,7 +797,7 @@ index daa51244369..79d0c4b4623 100755 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF -@@ -8093,8 +8589,6 @@ fi +@@ -8135,8 +8630,6 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static=@@ -805,7 +806,7 @@ index daa51244369..79d0c4b4623 100755 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' -@@ -8260,6 +8754,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } +@@ -8302,6 +8795,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;;@@ -818,7 +819,7 @@ index daa51244369..79d0c4b4623 100755 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) -@@ -8322,7 +8822,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } +@@ -8364,7 +8863,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in@@ -827,7 +828,7 @@ index daa51244369..79d0c4b4623 100755 lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; -@@ -8379,13 +8879,17 @@ case $host_os in +@@ -8421,13 +8920,17 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac@@ -851,7 +852,7 @@ index daa51244369..79d0c4b4623 100755 # # Check to make sure the PIC flag actually works. -@@ -8446,6 +8950,11 @@ fi +@@ -8488,6 +8991,11 @@ fi@@ -863,7 +864,7 @@ index daa51244369..79d0c4b4623 100755 # # Check to make sure the static flag actually works. # -@@ -8796,7 +9305,8 @@ _LT_EOF +@@ -8838,7 +9346,8 @@ _LT_EOF allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes@@ -873,7 +874,7 @@ index daa51244369..79d0c4b4623 100755 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' -@@ -8895,12 +9405,12 @@ _LT_EOF +@@ -8937,12 +9446,12 @@ _LT_EOF whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir'@@ -888,7 +889,7 @@ index daa51244369..79d0c4b4623 100755 fi ;; esac -@@ -8914,8 +9424,8 @@ _LT_EOF +@@ -8956,8 +9465,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else@@ -899,7 +900,7 @@ index daa51244369..79d0c4b4623 100755 fi ;; -@@ -8933,8 +9443,8 @@ _LT_EOF +@@ -8975,8 +9484,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then@@ -910,7 +911,7 @@ index daa51244369..79d0c4b4623 100755 else ld_shlibs=no fi -@@ -8980,8 +9490,8 @@ _LT_EOF +@@ -9022,8 +9531,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then@@ -921,7 +922,7 @@ index daa51244369..79d0c4b4623 100755 else ld_shlibs=no fi -@@ -9111,7 +9621,13 @@ _LT_EOF +@@ -9153,7 +9662,13 @@ _LT_EOF allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable.@@ -936,7 +937,7 @@ index daa51244369..79d0c4b4623 100755 /* end confdefs.h. */ int -@@ -9124,22 +9640,29 @@ main () +@@ -9166,22 +9681,29 @@ main ()Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch renamed from meta/recipes-devtools/binutils/binutils/0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch +1
-1Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0011-sync-with-OE-libtool-changes.patch renamed from meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch +1
-1Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0012-Check-for-clang-before-checking-gcc-version.patch renamed from meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch +4
-4Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch deleted +0
-234Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/161e87d12167b1e36193385485c1f6ce92f74f02.patch deleted +0
-247Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils_2.38.bb renamed from meta/recipes-devtools/binutils/binutils_2.37.bb +0
-1Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
2.35.1
Part of the diff is not shown here. View the raw message.
Quoted 5 lines · Khem Raj
Hi Bruce
We will need https://lkml.org/lkml/2022/1/26/855
in kernel backported to let RV64 kernel compile with this upgrade.
I see that greg has indicated it can/will be backported through the -stable process, so I can stage this shortly, and send a SRCREV bump tomorrow (I have some other kernel changes anyway).
Bruce
Quoted 12,086 lines · Khem Raj
Quoted 12,084 lines
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>--- meta/conf/distro/include/tcmode-default.inc | 2 +- .../binutils/binutils-2.37.inc | 39 - .../binutils/binutils-2.38.inc | 35 + ....37.bb => binutils-cross-canadian_2.38.bb} | 0 ...37.bb => binutils-cross-testsuite_2.38.bb} | 0 ...s-cross_2.37.bb => binutils-cross_2.38.bb} | 0 ...ssdk_2.37.bb => binutils-crosssdk_2.38.bb} | 0 .../binutils/0001-CVE-2021-42574.patch | 2001 --------- ...s-crosssdk-Generate-relocatable-SDKs.patch | 12 +- ...rd-input-.note.gnu.build-id-sections.patch | 215 - ...o-not-generate-linker-script-directo.patch | 4 +- ...dk-Search-for-alternative-ld.so.conf.patch | 16 +- ...04-Point-scripts-location-to-libdir.patch} | 8 +- ...RPATH-entry-if-LD_RUN_PATH-is-not-e.patch} | 8 +- ...tro-compiler-point-to-the-wrong-ins.patch} | 6 +- ...system-directories-when-cross-linki.patch} | 48 +- ...ct-assembling-for-ppc-wait-mnemonic.patch} | 7 +- ...l-2.4.patch => 0009-Use-libtool-2.4.patch} | 3964 +++++++++++++---- ...-in-libtool-when-sysroot-is-enabled.patch} | 2 +- ...> 0011-sync-with-OE-libtool-changes.patch} | 2 +- ...r-clang-before-checking-gcc-version.patch} | 8 +- ...le-descriptor-if-there-is-no-archive.patch | 234 - ...87d12167b1e36193385485c1f6ce92f74f02.patch | 247 - .../{binutils_2.37.bb => binutils_2.38.bb} | 0 24 files changed, 3132 insertions(+), 3726 deletions(-) delete mode 100644 meta/recipes-devtools/binutils/binutils-2.37.inc create mode 100644 meta/recipes-devtools/binutils/binutils-2.38.inc rename meta/recipes-devtools/binutils/{binutils-cross-canadian_2.37.bb => binutils-cross-canadian_2.38.bb} (100%) rename meta/recipes-devtools/binutils/{binutils-cross-testsuite_2.37.bb => binutils-cross-testsuite_2.38.bb} (100%) rename meta/recipes-devtools/binutils/{binutils-cross_2.37.bb => binutils-cross_2.38.bb} (100%) rename meta/recipes-devtools/binutils/{binutils-crosssdk_2.37.bb => binutils-crosssdk_2.38.bb} (100%) delete mode 100644 meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch delete mode 100644 meta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch rename meta/recipes-devtools/binutils/binutils/{0005-Point-scripts-location-to-libdir.patch => 0004-Point-scripts-location-to-libdir.patch} (85%) rename meta/recipes-devtools/binutils/binutils/{0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch => 0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch} (82%) rename meta/recipes-devtools/binutils/binutils/{0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch => 0006-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch} (87%) rename meta/recipes-devtools/binutils/binutils/{0008-warn-for-uses-of-system-directories-when-cross-linki.patch => 0007-warn-for-uses-of-system-directories-when-cross-linki.patch} (85%) rename meta/recipes-devtools/binutils/binutils/{0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch => 0008-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch} (93%) rename meta/recipes-devtools/binutils/binutils/{0013-Use-libtool-2.4.patch => 0009-Use-libtool-2.4.patch} (88%) rename meta/recipes-devtools/binutils/binutils/{0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch => 0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch} (96%) rename meta/recipes-devtools/binutils/binutils/{0015-sync-with-OE-libtool-changes.patch => 0011-sync-with-OE-libtool-changes.patch} (97%) rename meta/recipes-devtools/binutils/binutils/{0016-Check-for-clang-before-checking-gcc-version.patch => 0012-Check-for-clang-before-checking-gcc-version.patch} (87%) delete mode 100644 meta/recipes-devtools/binutils/binutils/0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch delete mode 100644 meta/recipes-devtools/binutils/binutils/161e87d12167b1e36193385485c1f6ce92f74f02.patch rename meta/recipes-devtools/binutils/{binutils_2.37.bb => binutils_2.38.bb} (100%)meta/conf/distro/include/tcmode-default.inc +1
-1@@ -18,7 +18,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext" GCCVERSION ?= "11.%" SDKGCCVERSION ?= "${GCCVERSION}" -BINUVERSION ?= "2.37%" +BINUVERSION ?= "2.38%" GDBVERSION ?= "11.%" GLIBCVERSION ?= "2.35" LINUXLIBCVERSION ?= "5.16%"meta/recipes-devtools/binutils/binutils-2.37.inc deleted +0
-39@@ -1,39 +0,0 @@ -LIC_FILES_CHKSUM="\ - file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ - file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\ - file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\ - file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\ - file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\ - file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ - file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\ - file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\ - file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\ - " - -# When upgrading to 2.37, please make sure there is no trailing .0, so -# that upstream version check can work correctly. -PV = "2.37" -CVE_VERSION = "2.37" -SRCBRANCH ?= "binutils-2_37-branch" - -UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)" - -SRCREV ?= "87d4632d36323091e731eb07b8aa65f90293da66" -BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=git" -SRC_URI = "\ - ${BINUTILS_GIT_URI} \ - file://0005-Point-scripts-location-to-libdir.patch \ - file://0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \ - file://0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \ - file://0008-warn-for-uses-of-system-directories-when-cross-linki.patch \ - file://0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \ - file://0013-Use-libtool-2.4.patch \ - file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \ - file://0015-sync-with-OE-libtool-changes.patch \ - file://0016-Check-for-clang-before-checking-gcc-version.patch \ - file://0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch \ - file://0001-elf-Discard-input-.note.gnu.build-id-sections.patch \ - file://0001-CVE-2021-42574.patch \ - file://161e87d12167b1e36193385485c1f6ce92f74f02.patch \ -" -S = "${WORKDIR}/git"meta/recipes-devtools/binutils/binutils-2.38.inc new file +35
-0@@ -0,0 +1,35 @@ +LIC_FILES_CHKSUM="\ + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\ + file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\ + file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + " + +# When upgrading to 2.39, please make sure there is no trailing .0, so +# that upstream version check can work correctly. +PV = "2.38" +CVE_VERSION = "2.38" +SRCBRANCH ?= "binutils-2_38-branch" + +UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)" + +SRCREV ?= "a96f7ba94b69b588bf524624ff2410b31420c957" +BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=git" +SRC_URI = "\ + ${BINUTILS_GIT_URI} \ + file://0004-Point-scripts-location-to-libdir.patch \ + file://0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \ + file://0006-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \ + file://0007-warn-for-uses-of-system-directories-when-cross-linki.patch \ + file://0008-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \ + file://0009-Use-libtool-2.4.patch \ + file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \ + file://0011-sync-with-OE-libtool-changes.patch \ + file://0012-Check-for-clang-before-checking-gcc-version.patch \ +" +S = "${WORKDIR}/git"meta/recipes-devtools/binutils/binutils-cross-canadian_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-cross-canadian_2.37.bb +0
-0meta/recipes-devtools/binutils/binutils-cross-testsuite_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-cross-testsuite_2.37.bb +0
-0meta/recipes-devtools/binutils/binutils-cross_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-cross_2.37.bb +0
-0meta/recipes-devtools/binutils/binutils-crosssdk_2.38.bb renamed from meta/recipes-devtools/binutils/binutils-crosssdk_2.37.bb +0
-0meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch deleted +0
-2001@@ -1,2001 +0,0 @@ -From b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5 Mon Sep 17 00:00:00 2001 -From: Nick Clifton <[email protected]> -Date: Tue, 9 Nov 2021 13:25:42 +0000 -Subject: [PATCH] Add --unicode option to control how unicode characters are - handled by display tools. - - * nm.c: Add --unicode option to control how unicode characters are - handled. - * objdump.c: Likewise. - * readelf.c: Likewise. - * strings.c: Likewise. - * binutils.texi: Document the new feature. - * NEWS: Document the new feature. - * testsuite/binutils-all/unicode.exp: New file. - * testsuite/binutils-all/nm.hex.unicode - * testsuite/binutils-all/strings.escape.unicode - * testsuite/binutils-all/objdump.highlight.unicode - * testsuite/binutils-all/readelf.invalid.unicode - -CVE: CVE-2021-42574 -Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5] - -RP: Added tweak uint -> unsigned int partial backport of -https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=795588aec4f894206863c938bd6d716895886009 - -Signed-off-by: pgowda <[email protected]> ---- - binutils/ChangeLog | 15 + - binutils/NEWS | 9 + - binutils/doc/binutils.texi | 78 ++++ - binutils/nm.c | 228 ++++++++++- - binutils/objdump.c | 235 ++++++++++-- - binutils/readelf.c | 190 +++++++++- - binutils/strings.c | 757 ++++++++++++++++++++++++++++++++++--- - 7 files changed, 1409 insertions(+), 103 deletions(-) - -diff --git a/binutils/ChangeLog b/binutils/ChangeLog ---- a/binutils/ChangeLog 2021-12-19 19:00:27.038540406 -0800 -+++ b/binutils/ChangeLog 2021-12-19 19:28:42.733565078 -0800 -@@ -1,3 +1,18 @@ -+2021-11-09 Nick Clifton <[email protected]> -+ -+ * nm.c: Add --unicode option to control how unicode characters are -+ handled. -+ * objdump.c: Likewise. -+ * readelf.c: Likewise. -+ * strings.c: Likewise. -+ * binutils.texi: Document the new feature. -+ * NEWS: Document the new feature. -+ * testsuite/binutils-all/unicode.exp: New file. -+ * testsuite/binutils-all/nm.hex.unicode -+ * testsuite/binutils-all/strings.escape.unicode -+ * testsuite/binutils-all/objdump.highlight.unicode -+ * testsuite/binutils-all/readelf.invalid.unicode -+ - 2021-07-16 Nick Clifton <[email protected]> - - * po/sv.po: Updated Swedish translation. -diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi ---- a/binutils/doc/binutils.texi 2021-12-19 19:00:27.042540338 -0800 -+++ b/binutils/doc/binutils.texi 2021-12-19 19:27:56.526354667 -0800 -@@ -812,6 +812,7 @@ nm [@option{-A}|@option{-o}|@option{--pr - [@option{-s}|@option{--print-armap}] - [@option{-t} @var{radix}|@option{--radix=}@var{radix}] - [@option{-u}|@option{--undefined-only}] -+ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] - [@option{-V}|@option{--version}] - [@option{-X 32_64}] - [@option{--defined-only}] -@@ -1132,6 +1133,21 @@ Use @var{radix} as the radix for printin - @cindex undefined symbols - Display only undefined symbols (those external to each object file). - -+@item -U @var{[d|i|l|e|x|h]} -+@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]} -+Controls the display of UTF-8 encoded mulibyte characters in strings. -+The default (@option{--unicode=default}) is to give them no special -+treatment. The @option{--unicode=locale} option displays the sequence -+in the current locale, which may or may not support them. The options -+@option{--unicode=hex} and @option{--unicode=invalid} display them as -+hex byte sequences enclosed by either angle brackets or curly braces. -+ -+The @option{--unicode=escape} option displays them as escape sequences -+(@var{\uxxxx}) and the @option{--unicode=highlight} option displays -+them as escape sequences highlighted in red (if supported by the -+output device). The colouring is intended to draw attention to the -+presence of unicode sequences where they might not be expected. -+ - @item -V - @itemx --version - Show the version number of @command{nm} and exit. -@@ -2247,6 +2263,7 @@ objdump [@option{-a}|@option{--archive-h - [@option{--prefix-strip=}@var{level}] - [@option{--insn-width=}@var{width}] - [@option{--visualize-jumps[=color|=extended-color|=off]} -+ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] - [@option{-V}|@option{--version}] - [@option{-H}|@option{--help}] - @var{objfile}@dots{} -@@ -2921,6 +2938,21 @@ When displaying symbols include those wh - special in some way and which would not normally be of interest to the - user. - -+@item -U @var{[d|i|l|e|x|h]} -+@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]} -+Controls the display of UTF-8 encoded mulibyte characters in strings. -+The default (@option{--unicode=default}) is to give them no special -+treatment. The @option{--unicode=locale} option displays the sequence -+in the current locale, which may or may not support them. The options -+@option{--unicode=hex} and @option{--unicode=invalid} display them as -+hex byte sequences enclosed by either angle brackets or curly braces. -+ -+The @option{--unicode=escape} option displays them as escape sequences -+(@var{\uxxxx}) and the @option{--unicode=highlight} option displays -+them as escape sequences highlighted in red (if supported by the -+output device). The colouring is intended to draw attention to the -+presence of unicode sequences where they might not be expected. -+ - @item -V - @itemx --version - Print the version number of @command{objdump} and exit. -@@ -3197,6 +3229,7 @@ strings [@option{-afovV}] [@option{-}@va - [@option{-n} @var{min-len}] [@option{--bytes=}@var{min-len}] - [@option{-t} @var{radix}] [@option{--radix=}@var{radix}] - [@option{-e} @var{encoding}] [@option{--encoding=}@var{encoding}] -+ [@option{-U} @var{method}] [@option{--unicode=}@var{method}] - [@option{-}] [@option{--all}] [@option{--print-file-name}] - [@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}] - [@option{-w}] [@option{--include-all-whitespace}] -@@ -3288,6 +3321,28 @@ single-8-bit-byte characters, @samp{b} = - littleendian. Useful for finding wide character strings. (@samp{l} - and @samp{b} apply to, for example, Unicode UTF-16/UCS-2 encodings). - -+@item -U @var{[d|i|l|e|x|h]} -+@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]} -+Controls the display of UTF-8 encoded mulibyte characters in strings. -+The default (@option{--unicode=default}) is to give them no special -+treatment, and instead rely upon the setting of the -+@option{--encoding} option. The other values for this option -+automatically enable @option{--encoding=S}. -+ -+The @option{--unicode=invalid} option treats them as non-graphic -+characters and hence not part of a valid string. All the remaining -+options treat them as valid string characters. -+ -+The @option{--unicode=locale} option displays them in the current -+locale, which may or may not support UTF-8 encoding. The -+@option{--unicode=hex} option displays them as hex byte sequences -+enclosed between @var{<>} characters. The @option{--unicode=escape} -+option displays them as escape sequences (@var{\uxxxx}) and the -+@option{--unicode=highlight} option displays them as escape sequences -+highlighted in red (if supported by the output device). The colouring -+is intended to draw attention to the presence of unicode sequences -+where they might not be expected. -+ - @item -T @var{bfdname} - @itemx --target=@var{bfdname} - @cindex object code format -@@ -4796,6 +4851,7 @@ readelf [@option{-a}|@option{--all}] - [@option{--demangle@var{=style}}|@option{--no-demangle}] - [@option{--quiet}] - [@option{--recurse-limit}|@option{--no-recurse-limit}] -+ [@option{-U} @var{method}|@option{--unicode=}@var{method}] - [@option{-n}|@option{--notes}] - [@option{-r}|@option{--relocs}] - [@option{-u}|@option{--unwind}] -@@ -4962,6 +5018,28 @@ necessary in order to demangle truly com - that if the recursion limit is disabled then stack exhaustion is - possible and any bug reports about such an event will be rejected. - -+@item -U @var{[d|i|l|e|x|h]} -+@itemx --unicode=[default|invalid|locale|escape|hex|highlight] -+Controls the display of non-ASCII characters in identifier names. -+The default (@option{--unicode=locale} or @option{--unicode=default}) is -+to treat them as multibyte characters and display them in the current -+locale. All other versions of this option treat the bytes as UTF-8 -+encoded values and attempt to interpret them. If they cannot be -+interpreted or if the @option{--unicode=invalid} option is used then -+they are displayed as a sequence of hex bytes, encloses in curly -+parethesis characters. -+ -+Using the @option{--unicode=escape} option will display the characters -+as as unicode escape sequences (@var{\uxxxx}). Using the -+@option{--unicode=hex} will display the characters as hex byte -+sequences enclosed between angle brackets. -+ -+Using the @option{--unicode=highlight} will display the characters as -+unicode escape sequences but it will also highlighted them in red, -+assuming that colouring is supported by the output device. The -+colouring is intended to draw attention to the presence of unicode -+sequences when they might not be expected. -+ - @item -e - @itemx --headers - Display all the headers in the file. Equivalent to @option{-h -l -S}. -diff --git a/binutils/NEWS b/binutils/NEWS ---- a/binutils/NEWS 2021-12-19 19:00:27.038540406 -0800 -+++ b/binutils/NEWS 2021-12-19 19:30:04.764162972 -0800 -@@ -1,5 +1,14 @@ - -*- text -*- - -+* Tools which display symbols or strings (readelf, strings, nm, objdump) -+ have a new command line option which controls how unicode characters are -+ handled. By default they are treated as normal for the tool. Using -+ --unicode=locale will display them according to the current locale. -+ Using --unicode=hex will display them as hex byte values, whilst -+ --unicode=escape will display them as escape sequences. In addition -+ using --unicode=highlight will display them as unicode escape sequences -+ highlighted in red (if supported by the output device). -+ - Changes in 2.37: - - * The readelf tool has a new command line option which can be used to specify -diff --git a/binutils/nm.c b/binutils/nm.c ---- a/binutils/nm.c 2021-12-19 19:00:27.046540270 -0800 -+++ b/binutils/nm.c 2021-12-19 19:36:34.797491555 -0800 -@@ -38,6 +38,11 @@ - #include "bucomm.h" - #include "plugin-api.h" - #include "plugin.h" -+#include "safe-ctype.h" -+ -+#ifndef streq -+#define streq(a,b) (strcmp ((a),(b)) == 0) -+#endif - - /* When sorting by size, we use this structure to hold the size and a - pointer to the minisymbol. */ -@@ -216,6 +221,18 @@ static const char *plugin_target = NULL; - static bfd *lineno_cache_bfd; - static bfd *lineno_cache_rel_bfd; - -+typedef enum unicode_display_type -+{ -+ unicode_default = 0, -+ unicode_locale, -+ unicode_escape, -+ unicode_hex, -+ unicode_highlight, -+ unicode_invalid -+} unicode_display_type; -+ -+static unicode_display_type unicode_display = unicode_default; -+ - enum long_option_values - { - OPTION_TARGET = 200, -@@ -260,6 +277,7 @@ static struct option long_options[] = - {"target", required_argument, 0, OPTION_TARGET}, - {"defined-only", no_argument, &defined_only, 1}, - {"undefined-only", no_argument, &undefined_only, 1}, -+ {"unicode", required_argument, NULL, 'U'}, - {"version", no_argument, &show_version, 1}, - {"with-symbol-versions", no_argument, &with_symbol_versions, 1}, - {"without-symbol-versions", no_argument, &with_symbol_versions, 0}, -@@ -313,6 +331,8 @@ usage (FILE *stream, int status) - -t, --radix=RADIX Use RADIX for printing symbol values\n\ - --target=BFDNAME Specify the target object format as BFDNAME\n\ - -u, --undefined-only Display only undefined symbols\n\ -+ -U {d|s|i|x|e|h} Specify how to treat UTF-8 encoded unicode characters\n\ -+ --unicode={default|show|invalid|hex|escape|highlight}\n\ - --with-symbol-versions Display version strings after symbol names\n\ - -X 32_64 (ignored)\n\ - @FILE Read options from FILE\n\ -@@ -432,6 +452,187 @@ get_coff_symbol_type (const struct inter - return bufp; - } - -+/* Convert a potential UTF-8 encoded sequence in IN into characters in OUT. -+ The conversion format is controlled by the unicode_display variable. -+ Returns the number of characters added to OUT. -+ Returns the number of bytes consumed from IN in CONSUMED. -+ Always consumes at least one byte and displays at least one character. */ -+ -+static unsigned int -+display_utf8 (const unsigned char * in, char * out, unsigned int * consumed) -+{ -+ char * orig_out = out; -+ unsigned int nchars = 0; -+ unsigned int j; -+ -+ if (unicode_display == unicode_default) -+ goto invalid; -+ -+ if (in[0] < 0xc0) -+ goto invalid; -+ -+ if ((in[1] & 0xc0) != 0x80) -+ goto invalid; -+ -+ if ((in[0] & 0x20) == 0) -+ { -+ nchars = 2; -+ goto valid; -+ } -+ -+ if ((in[2] & 0xc0) != 0x80) -+ goto invalid; -+ -+ if ((in[0] & 0x10) == 0) -+ { -+ nchars = 3; -+ goto valid; -+ } -+ -+ if ((in[3] & 0xc0) != 0x80) -+ goto invalid; -+ -+ nchars = 4; -+ -+ valid: -+ switch (unicode_display) -+ { -+ case unicode_locale: -+ /* Copy the bytes into the output buffer as is. */ -+ memcpy (out, in, nchars); -+ out += nchars; -+ break; -+ -+ case unicode_invalid: -+ case unicode_hex: -+ out += sprintf (out, "%c", unicode_display == unicode_hex ? '<' : '{'); -+ out += sprintf (out, "0x"); -+ for (j = 0; j < nchars; j++) -+ out += sprintf (out, "%02x", in [j]); -+ out += sprintf (out, "%c", unicode_display == unicode_hex ? '>' : '}'); -+ break; -+ -+ case unicode_highlight: -+ if (isatty (1)) -+ out += sprintf (out, "\x1B[31;47m"); /* Red. */ -+ /* Fall through. */ -+ case unicode_escape: -+ switch (nchars) -+ { -+ case 2: -+ out += sprintf (out, "\\u%02x%02x", -+ ((in[0] & 0x1c) >> 2), -+ ((in[0] & 0x03) << 6) | (in[1] & 0x3f)); -+ break; -+ -+ case 3: -+ out += sprintf (out, "\\u%02x%02x", -+ ((in[0] & 0x0f) << 4) | ((in[1] & 0x3c) >> 2), -+ ((in[1] & 0x03) << 6) | ((in[2] & 0x3f))); -+ break; -+ -+ case 4: -+ out += sprintf (out, "\\u%02x%02x%02x", -+ ((in[0] & 0x07) << 6) | ((in[1] & 0x3c) >> 2), -+ ((in[1] & 0x03) << 6) | ((in[2] & 0x3c) >> 2), -+ ((in[2] & 0x03) << 6) | ((in[3] & 0x3f))); -+ break; -+ default: -+ /* URG. */ -+ break; -+ } -+ -+ if (unicode_display == unicode_highlight && isatty (1)) -+ out += sprintf (out, "\033[0m"); /* Default colour. */ -+ break; -+ -+ default: -+ /* URG */ -+ break; -+ } -+ -+ * consumed = nchars; -+ return out - orig_out; -+ -+ invalid: -+ /* Not a valid UTF-8 sequence. */ -+ *out = *in; -+ * consumed = 1; -+ return 1; -+} -+ -+/* Convert any UTF-8 encoded characters in NAME into the form specified by -+ unicode_display. Also converts control characters. Returns a static -+ buffer if conversion was necessary. -+ Code stolen from objdump.c:sanitize_string(). */ -+ -+static const char * -+convert_utf8 (const char * in) -+{ -+ static char * buffer = NULL; -+ static size_t buffer_len = 0; -+ const char * original = in; -+ char * out; -+ -+ /* Paranoia. */ -+ if (in == NULL) -+ return ""; -+ -+ /* See if any conversion is necessary. -+ In the majority of cases it will not be needed. */ -+ do -+ { -+ unsigned char c = *in++; -+ -+ if (c == 0) -+ return original; -+ -+ if (ISCNTRL (c)) -+ break; -+ -+ if (unicode_display != unicode_default && c >= 0xc0) -+ break; -+ } -+ while (1); -+ -+ /* Copy the input, translating as needed. */ -+ in = original; -+ if (buffer_len < (strlen (in) * 9)) -+ { -+ free ((void *) buffer); -+ buffer_len = strlen (in) * 9; -+ buffer = xmalloc (buffer_len + 1); -+ } -+ -+ out = buffer; -+ do -+ { -+ unsigned char c = *in++; -+ -+ if (c == 0) -+ break; -+ -+ if (ISCNTRL (c)) -+ { -+ *out++ = '^'; -+ *out++ = c + 0x40; -+ } -+ else if (unicode_display != unicode_default && c >= 0xc0) -+ { -+ unsigned int num_consumed; -+ -+ out += display_utf8 ((const unsigned char *)(in - 1), out, & num_consumed); -+ in += num_consumed - 1; -+ } -+ else -+ *out++ = c; -+ } -+ while (1); -+ -+ *out = 0; -+ return buffer; -+} -+ - /* Print symbol name NAME, read from ABFD, with printf format FORM, - demangling it if requested. */ - -@@ -444,6 +645,7 @@ print_symname (const char *form, struct - - if (name == NULL) - name = info->sinfo->name; -+ - if (!with_symbol_versions - && bfd_get_flavour (abfd) == bfd_target_elf_flavour) - { -@@ -451,6 +653,7 @@ print_symname (const char *form, struct - if (atver) - *atver = 0; - } -+ - if (do_demangle && *name) - { - alloc = bfd_demangle (abfd, name, demangle_flags); -@@ -458,6 +661,11 @@ print_symname (const char *form, struct - name = alloc; - } - -+ if (unicode_display != unicode_default) -+ { -+ name = convert_utf8 (name); -+ } -+ - if (info != NULL && info->elfinfo && with_symbol_versions) - { - const char *version_string; -@@ -1807,7 +2015,7 @@ main (int argc, char **argv) - fatal (_("fatal error: libbfd ABI mismatch")); - set_default_bfd_target (); - -- while ((c = getopt_long (argc, argv, "aABCDef:gHhjJlnopPrSst:uvVvX:", -+ while ((c = getopt_long (argc, argv, "aABCDef:gHhjJlnopPrSst:uU:vVvX:", - long_options, (int *) 0)) != EOF) - { - switch (c) -@@ -1900,6 +2108,24 @@ main (int argc, char **argv) - case 'u': - undefined_only = 1; - break; -+ -+ case 'U': -+ if (streq (optarg, "default") || streq (optarg, "d")) -+ unicode_display = unicode_default; -+ else if (streq (optarg, "locale") || streq (optarg, "l")) -+ unicode_display = unicode_locale; -+ else if (streq (optarg, "escape") || streq (optarg, "e")) -+ unicode_display = unicode_escape; -+ else if (streq (optarg, "invalid") || streq (optarg, "i")) -+ unicode_display = unicode_invalid; -+ else if (streq (optarg, "hex") || streq (optarg, "x")) -+ unicode_display = unicode_hex; -+ else if (streq (optarg, "highlight") || streq (optarg, "h")) -+ unicode_display = unicode_highlight; -+ else -+ fatal (_("invalid argument to -U/--unicode: %s"), optarg); -+ break; -+ - case 'V': - show_version = 1; - break; -diff --git a/binutils/objdump.c b/binutils/objdump.c ---- a/binutils/objdump.c 2021-12-19 19:00:27.046540270 -0800 -+++ b/binutils/objdump.c 2021-12-19 19:43:09.438736729 -0800 -@@ -204,6 +204,18 @@ static const struct objdump_private_desc - - /* The list of detected jumps inside a function. */ - static struct jump_info *detected_jumps = NULL; -+ -+typedef enum unicode_display_type -+{ -+ unicode_default = 0, -+ unicode_locale, -+ unicode_escape, -+ unicode_hex, -+ unicode_highlight, -+ unicode_invalid -+} unicode_display_type; -+ -+static unicode_display_type unicode_display = unicode_default; - - static void usage (FILE *, int) ATTRIBUTE_NORETURN; - static void -@@ -330,6 +342,9 @@ usage (FILE *stream, int status) - fprintf (stream, _("\ - -w, --wide Format output for more than 80 columns\n")); - fprintf (stream, _("\ -+ -U[d|l|i|x|e|h] Controls the display of UTF-8 unicode characters\n\ -+ --unicode=[default|locale|invalid|hex|escape|highlight]\n")); -+ fprintf (stream, _("\ - -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n")); - fprintf (stream, _("\ - --start-address=ADDR Only process data whose address is >= ADDR\n")); -@@ -420,17 +435,23 @@ static struct option long_options[]= - { - {"adjust-vma", required_argument, NULL, OPTION_ADJUST_VMA}, - {"all-headers", no_argument, NULL, 'x'}, -- {"private-headers", no_argument, NULL, 'p'}, -- {"private", required_argument, NULL, 'P'}, - {"architecture", required_argument, NULL, 'm'}, - {"archive-headers", no_argument, NULL, 'a'}, -+#ifdef ENABLE_LIBCTF -+ {"ctf", required_argument, NULL, OPTION_CTF}, -+ {"ctf-parent", required_argument, NULL, OPTION_CTF_PARENT}, -+#endif - {"debugging", no_argument, NULL, 'g'}, - {"debugging-tags", no_argument, NULL, 'e'}, - {"demangle", optional_argument, NULL, 'C'}, - {"disassemble", optional_argument, NULL, 'd'}, - {"disassemble-all", no_argument, NULL, 'D'}, -- {"disassembler-options", required_argument, NULL, 'M'}, - {"disassemble-zeroes", no_argument, NULL, 'z'}, -+ {"disassembler-options", required_argument, NULL, 'M'}, -+ {"dwarf", optional_argument, NULL, OPTION_DWARF}, -+ {"dwarf-check", no_argument, 0, OPTION_DWARF_CHECK}, -+ {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH}, -+ {"dwarf-start", required_argument, 0, OPTION_DWARF_START}, - {"dynamic-reloc", no_argument, NULL, 'R'}, - {"dynamic-syms", no_argument, NULL, 'T'}, - {"endian", required_argument, NULL, OPTION_ENDIAN}, -@@ -440,16 +461,23 @@ static struct option long_options[]= - {"full-contents", no_argument, NULL, 's'}, - {"headers", no_argument, NULL, 'h'}, - {"help", no_argument, NULL, 'H'}, -+ {"include", required_argument, NULL, 'I'}, - {"info", no_argument, NULL, 'i'}, -+ {"inlines", no_argument, 0, OPTION_INLINES}, -+ {"insn-width", required_argument, NULL, OPTION_INSN_WIDTH}, - {"line-numbers", no_argument, NULL, 'l'}, -- {"no-show-raw-insn", no_argument, &show_raw_insn, -1}, - {"no-addresses", no_argument, &no_addresses, 1}, -- {"process-links", no_argument, &process_links, true}, -+ {"no-recurse-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, -+ {"no-recursion-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, -+ {"no-show-raw-insn", no_argument, &show_raw_insn, -1}, -+ {"prefix", required_argument, NULL, OPTION_PREFIX}, - {"prefix-addresses", no_argument, &prefix_addresses, 1}, -+ {"prefix-strip", required_argument, NULL, OPTION_PREFIX_STRIP}, -+ {"private", required_argument, NULL, 'P'}, -+ {"private-headers", no_argument, NULL, 'p'}, -+ {"process-links", no_argument, &process_links, true}, - {"recurse-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, - {"recursion-limit", no_argument, NULL, OPTION_RECURSE_LIMIT}, -- {"no-recurse-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, -- {"no-recursion-limit", no_argument, NULL, OPTION_NO_RECURSE_LIMIT}, - {"reloc", no_argument, NULL, 'r'}, - {"section", required_argument, NULL, 'j'}, - {"section-headers", no_argument, NULL, 'h'}, -@@ -457,28 +485,16 @@ static struct option long_options[]= - {"source", no_argument, NULL, 'S'}, - {"source-comment", optional_argument, NULL, OPTION_SOURCE_COMMENT}, - {"special-syms", no_argument, &dump_special_syms, 1}, -- {"include", required_argument, NULL, 'I'}, -- {"dwarf", optional_argument, NULL, OPTION_DWARF}, --#ifdef ENABLE_LIBCTF -- {"ctf", required_argument, NULL, OPTION_CTF}, -- {"ctf-parent", required_argument, NULL, OPTION_CTF_PARENT}, --#endif - {"stabs", no_argument, NULL, 'G'}, - {"start-address", required_argument, NULL, OPTION_START_ADDRESS}, - {"stop-address", required_argument, NULL, OPTION_STOP_ADDRESS}, - {"syms", no_argument, NULL, 't'}, - {"target", required_argument, NULL, 'b'}, -+ {"unicode", required_argument, NULL, 'U'}, - {"version", no_argument, NULL, 'V'}, -- {"wide", no_argument, NULL, 'w'}, -- {"prefix", required_argument, NULL, OPTION_PREFIX}, -- {"prefix-strip", required_argument, NULL, OPTION_PREFIX_STRIP}, -- {"insn-width", required_argument, NULL, OPTION_INSN_WIDTH}, -- {"dwarf-depth", required_argument, 0, OPTION_DWARF_DEPTH}, -- {"dwarf-start", required_argument, 0, OPTION_DWARF_START}, -- {"dwarf-check", no_argument, 0, OPTION_DWARF_CHECK}, -- {"inlines", no_argument, 0, OPTION_INLINES}, - {"visualize-jumps", optional_argument, 0, OPTION_VISUALIZE_JUMPS}, -- {0, no_argument, 0, 0} -+ {"wide", no_argument, NULL, 'w'}, -+ {NULL, no_argument, NULL, 0} - }; - - static void -@@ -488,9 +504,121 @@ nonfatal (const char *msg) - exit_status = 1; - } - -+/* Convert a potential UTF-8 encoded sequence in IN into characters in OUT. -+ The conversion format is controlled by the unicode_display variable. -+ Returns the number of characters added to OUT. -+ Returns the number of bytes consumed from IN in CONSUMED. -+ Always consumes at least one byte and displays at least one character. */ -+ -+static unsigned int -+display_utf8 (const unsigned char * in, char * out, unsigned int * consumed) -+{ -+ char * orig_out = out; -+ unsigned int nchars = 0; -+ unsigned int j; -+ -+ if (unicode_display == unicode_default) -+ goto invalid; -+ -+ if (in[0] < 0xc0) -+ goto invalid; -+ -+ if ((in[1] & 0xc0) != 0x80) -+ goto invalid; -+ -+ if ((in[0] & 0x20) == 0) -+ { -+ nchars = 2; -+ goto valid; -+ } -+ -+ if ((in[2] & 0xc0) != 0x80) -+ goto invalid; -+ -+ if ((in[0] & 0x10) == 0) -+ { -+ nchars = 3; -+ goto valid; -+ } -+ -+ if ((in[3] & 0xc0) != 0x80) -+ goto invalid; -+ -+ nchars = 4; -+ -+ valid: -+ switch (unicode_display) -+ { -+ case unicode_locale: -+ /* Copy the bytes into the output buffer as is. */ -+ memcpy (out, in, nchars); -+ out += nchars; -+ break; -+ -+ case unicode_invalid: -+ case unicode_hex: -+ out += sprintf (out, "%c", unicode_display == unicode_hex ? '<' : '{'); -+ out += sprintf (out, "0x"); -+ for (j = 0; j < nchars; j++) -+ out += sprintf (out, "%02x", in [j]); -+ out += sprintf (out, "%c", unicode_display == unicode_hex ? '>' : '}'); -+ break; -+ -+ case unicode_highlight: -+ if (isatty (1)) -+ out += sprintf (out, "\x1B[31;47m"); /* Red. */ -+ /* Fall through. */ -+ case unicode_escape: -+ switch (nchars) -+ { -+ case 2: -+ out += sprintf (out, "\\u%02x%02x", -+ ((in[0] & 0x1c) >> 2), -+ ((in[0] & 0x03) << 6) | (in[1] & 0x3f)); -+ break; -+ -+ case 3: -+ out += sprintf (out, "\\u%02x%02x", -+ ((in[0] & 0x0f) << 4) | ((in[1] & 0x3c) >> 2), -+ ((in[1] & 0x03) << 6) | ((in[2] & 0x3f))); -+ break; -+ -+ case 4: -+ out += sprintf (out, "\\u%02x%02x%02x", -+ ((in[0] & 0x07) << 6) | ((in[1] & 0x3c) >> 2), -+ ((in[1] & 0x03) << 6) | ((in[2] & 0x3c) >> 2), -+ ((in[2] & 0x03) << 6) | ((in[3] & 0x3f))); -+ break; -+ default: -+ /* URG. */ -+ break; -+ } -+ -+ if (unicode_display == unicode_highlight && isatty (1)) -+ out += sprintf (out, "\033[0m"); /* Default colour. */ -+ break; -+ -+ default: -+ /* URG */ -+ break; -+ } -+ -+ * consumed = nchars; -+ return out - orig_out; -+ -+ invalid: -+ /* Not a valid UTF-8 sequence. */ -+ *out = *in; -+ * consumed = 1; -+ return 1; -+} -+ - /* Returns a version of IN with any control characters - replaced by escape sequences. Uses a static buffer -- if necessary. */ -+ if necessary. -+ -+ If unicode display is enabled, then also handles the -+ conversion of unicode characters. */ - - static const char * - sanitize_string (const char * in) -@@ -508,40 +636,50 @@ sanitize_string (const char * in) - of cases it will not be needed. */ - do - { -- char c = *in++; -+ unsigned char c = *in++; - - if (c == 0) - return original; - - if (ISCNTRL (c)) - break; -+ -+ if (unicode_display != unicode_default && c >= 0xc0) -+ break; - } - while (1); - - /* Copy the input, translating as needed. */ - in = original; -- if (buffer_len < (strlen (in) * 2)) -+ if (buffer_len < (strlen (in) * 9)) - { - free ((void *) buffer); -- buffer_len = strlen (in) * 2; -+ buffer_len = strlen (in) * 9; - buffer = xmalloc (buffer_len + 1); - } - - out = buffer; - do - { -- char c = *in++; -+ unsigned char c = *in++; - - if (c == 0) - break; - -- if (!ISCNTRL (c)) -- *out++ = c; -- else -+ if (ISCNTRL (c)) - { - *out++ = '^'; - *out++ = c + 0x40; - } -+ else if (unicode_display != unicode_default && c >= 0xc0) -+ { -+ unsigned int num_consumed; -+ -+ out += display_utf8 ((const unsigned char *)(in - 1), out, & num_consumed); -+ in += num_consumed - 1; -+ } -+ else -+ *out++ = c; - } - while (1); - -@@ -4529,6 +4667,24 @@ dump_symbols (bfd *abfd ATTRIBUTE_UNUSED - free (alloc); - } - } -+ else if (unicode_display != unicode_default -+ && name != NULL && *name != '\0') -+ { -+ const char * sanitized_name; -+ -+ /* If we want to sanitize the name, we do it here, and -+ temporarily clobber it while calling bfd_print_symbol. -+ FIXME: This is a gross hack. */ -+ sanitized_name = sanitize_string (name); -+ if (sanitized_name != name) -+ (*current)->name = sanitized_name; -+ else -+ sanitized_name = NULL; -+ bfd_print_symbol (cur_bfd, stdout, *current, -+ bfd_print_symbol_all); -+ if (sanitized_name != NULL) -+ (*current)->name = name; -+ } - else - bfd_print_symbol (cur_bfd, stdout, *current, - bfd_print_symbol_all); -@@ -5212,7 +5368,7 @@ main (int argc, char **argv) - set_default_bfd_target (); - - while ((c = getopt_long (argc, argv, -- "pP:ib:m:M:VvCdDlfFaHhrRtTxsSI:j:wE:zgeGW::", -+ "CDE:FGHI:LM:P:RSTU:VW::ab:defghij:lm:prstvwxz", - long_options, (int *) 0)) - != EOF) - { -@@ -5495,6 +5651,23 @@ main (int argc, char **argv) - seenflag = true; - break; - -+ case 'U': -+ if (streq (optarg, "default") || streq (optarg, "d")) -+ unicode_display = unicode_default; -+ else if (streq (optarg, "locale") || streq (optarg, "l")) -+ unicode_display = unicode_locale; -+ else if (streq (optarg, "escape") || streq (optarg, "e")) -+ unicode_display = unicode_escape; -+ else if (streq (optarg, "invalid") || streq (optarg, "i")) -+ unicode_display = unicode_invalid; -+ else if (streq (optarg, "hex") || streq (optarg, "x")) -+ unicode_display = unicode_hex; -+ else if (streq (optarg, "highlight") || streq (optarg, "h")) -+ unicode_display = unicode_highlight; -+ else -+ fatal (_("invalid argument to -U/--unicode: %s"), optarg); -+ break; -+ - case 'H': - usage (stdout, 0); - /* No need to set seenflag or to break - usage() does not return. */ -diff --git a/binutils/readelf.c b/binutils/readelf.c ---- a/binutils/readelf.c 2021-12-19 19:00:27.058540065 -0800 -+++ b/binutils/readelf.c 2021-12-19 19:27:56.538354462 -0800 -@@ -328,6 +328,19 @@ typedef enum print_mode - } - print_mode; - -+typedef enum unicode_display_type -+{ -+ unicode_default = 0, -+ unicode_locale, -+ unicode_escape, -+ unicode_hex, -+ unicode_highlight, -+ unicode_invalid -+} unicode_display_type; -+ -+static unicode_display_type unicode_display = unicode_default; -+ -+ - /* Versioned symbol info. */ - enum versioned_symbol_info - { -@@ -632,11 +645,18 @@ print_symbol (signed int width, const ch - if (c == 0) - break; - -- /* Do not print control characters directly as they can affect terminal -- settings. Such characters usually appear in the names generated -- by the assembler for local labels. */ -- if (ISCNTRL (c)) -+ if (ISPRINT (c)) -+ { -+ putchar (c); -+ width_remaining --; -+ num_printed ++; -+ } -+ else if (ISCNTRL (c)) - { -+ /* Do not print control characters directly as they can affect terminal -+ settings. Such characters usually appear in the names generated -+ by the assembler for local labels. */ -+ - if (width_remaining < 2) - break; - -@@ -644,11 +664,137 @@ print_symbol (signed int width, const ch - width_remaining -= 2; - num_printed += 2; - } -- else if (ISPRINT (c)) -+ else if (c == 0x7f) - { -- putchar (c); -- width_remaining --; -- num_printed ++; -+ if (width_remaining < 5) -+ break; -+ printf ("<DEL>"); -+ width_remaining -= 5; -+ num_printed += 5; -+ } -+ else if (unicode_display != unicode_locale -+ && unicode_display != unicode_default) -+ { -+ /* Display unicode characters as something else. */ -+ unsigned char bytes[4]; -+ bool is_utf8; -+ unsigned int nbytes; -+ -+ bytes[0] = c; -+ -+ if (bytes[0] < 0xc0) -+ { -+ nbytes = 1; -+ is_utf8 = false; -+ } -+ else -+ { -+ bytes[1] = *symbol++; -+ -+ if ((bytes[1] & 0xc0) != 0x80) -+ { -+ is_utf8 = false; -+ /* Do not consume this character. It may only -+ be the first byte in the sequence that was -+ corrupt. */ -+ --symbol; -+ nbytes = 1; -+ } -+ else if ((bytes[0] & 0x20) == 0) -+ { -+ is_utf8 = true; -+ nbytes = 2; -+ } -+ else -+ { -+ bytes[2] = *symbol++; -+ -+ if ((bytes[2] & 0xc0) != 0x80) -+ { -+ is_utf8 = false; -+ symbol -= 2; -+ nbytes = 1; -+ } -+ else if ((bytes[0] & 0x10) == 0) -+ { -+ is_utf8 = true; -+ nbytes = 3; -+ } -+ else -+ { -+ bytes[3] = *symbol++; -+ -+ nbytes = 4; -+ -+ if ((bytes[3] & 0xc0) != 0x80) -+ { -+ is_utf8 = false; -+ symbol -= 3; -+ nbytes = 1; -+ } -+ else -+ is_utf8 = true; -+ } -+ } -+ } -+ -+ if (unicode_display == unicode_invalid) -+ is_utf8 = false; -+ -+ if (unicode_display == unicode_hex || ! is_utf8) -+ { -+ unsigned int i; -+ -+ if (width_remaining < (nbytes * 2) + 2) -+ break; -+ -+ putchar (is_utf8 ? '<' : '{'); -+ printf ("0x"); -+ for (i = 0; i < nbytes; i++) -+ printf ("%02x", bytes[i]); -+ putchar (is_utf8 ? '>' : '}'); -+ } -+ else -+ { -+ if (unicode_display == unicode_highlight && isatty (1)) -+ printf ("\x1B[31;47m"); /* Red. */ -+ -+ switch (nbytes) -+ { -+ case 2: -+ if (width_remaining < 6) -+ break; -+ printf ("\\u%02x%02x", -+ (bytes[0] & 0x1c) >> 2, -+ ((bytes[0] & 0x03) << 6) | (bytes[1] & 0x3f)); -+ break; -+ case 3: -+ if (width_remaining < 6) -+ break; -+ printf ("\\u%02x%02x", -+ ((bytes[0] & 0x0f) << 4) | ((bytes[1] & 0x3c) >> 2), -+ ((bytes[1] & 0x03) << 6) | (bytes[2] & 0x3f)); -+ break; -+ case 4: -+ if (width_remaining < 8) -+ break; -+ printf ("\\u%02x%02x%02x", -+ ((bytes[0] & 0x07) << 6) | ((bytes[1] & 0x3c) >> 2), -+ ((bytes[1] & 0x03) << 6) | ((bytes[2] & 0x3c) >> 2), -+ ((bytes[2] & 0x03) << 6) | (bytes[3] & 0x3f)); -+ -+ break; -+ default: -+ /* URG. */ -+ break; -+ } -+ -+ if (unicode_display == unicode_highlight && isatty (1)) -+ printf ("\033[0m"); /* Default colour. */ -+ } -+ -+ if (bytes[nbytes - 1] == 0) -+ break; - } - else - { -@@ -4668,6 +4814,7 @@ static struct option options[] = - {"syms", no_argument, 0, 's'}, - {"silent-truncation",no_argument, 0, 'T'}, - {"section-details", no_argument, 0, 't'}, -+ {"unicode", required_argument, NULL, 'U'}, - {"unwind", no_argument, 0, 'u'}, - {"version-info", no_argument, 0, 'V'}, - {"version", no_argument, 0, 'v'}, -@@ -4744,6 +4891,12 @@ usage (FILE * stream) - fprintf (stream, _("\ - --no-recurse-limit Disable a demangling recursion limit\n")); - fprintf (stream, _("\ -+ -U[dlexhi] --unicode=[default|locale|escape|hex|highlight|invalid]\n\ -+ Display unicode characters as determined by the current locale\n\ -+ (default), escape sequences, \"<hex sequences>\", highlighted\n\ -+ escape sequences, or treat them as invalid and display as\n\ -+ \"{hex sequences}\"\n")); -+ fprintf (stream, _("\ - -n --notes Display the core notes (if present)\n")); - fprintf (stream, _("\ - -r --relocs Display the relocations (if present)\n")); -@@ -4928,7 +5081,7 @@ parse_args (struct dump_data *dumpdata, - usage (stderr); - - while ((c = getopt_long -- (argc, argv, "ACDHILNPR:STVWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF) -+ (argc, argv, "ACDHILNPR:STU:VWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF) - { - switch (c) - { -@@ -5130,6 +5283,25 @@ parse_args (struct dump_data *dumpdata, - /* Ignored for backward compatibility. */ - break; - -+ case 'U': -+ if (optarg == NULL) -+ error (_("Missing arg to -U/--unicode")); /* Can this happen ? */ -+ else if (streq (optarg, "default") || streq (optarg, "d")) -+ unicode_display = unicode_default; -+ else if (streq (optarg, "locale") || streq (optarg, "l")) -+ unicode_display = unicode_locale; -+ else if (streq (optarg, "escape") || streq (optarg, "e")) -+ unicode_display = unicode_escape; -+ else if (streq (optarg, "invalid") || streq (optarg, "i")) -+ unicode_display = unicode_invalid; -+ else if (streq (optarg, "hex") || streq (optarg, "x")) -+ unicode_display = unicode_hex; -+ else if (streq (optarg, "highlight") || streq (optarg, "h")) -+ unicode_display = unicode_highlight; -+ else -+ error (_("invalid argument to -U/--unicode: %s"), optarg); -+ break; -+ - case OPTION_SYM_BASE: - sym_base = 0; - if (optarg != NULL) -diff --git a/binutils/strings.c b/binutils/strings.c ---- a/binutils/strings.c 2021-12-19 19:00:27.058540065 -0800 -+++ b/binutils/strings.c 2021-12-19 19:48:26.205313218 -0800 -@@ -55,6 +55,19 @@ - -T {bfdname} - Specify a non-default object file format. - -+ --unicode={default|locale|invalid|hex|escape|highlight} -+ -u {d|l|i|x|e|h} -+ Determine how to handle UTF-8 unicode characters. The default -+ is no special treatment. All other versions of this option -+ only apply if the encoding is valid and enabling the option -+ implies --encoding=S. -+ The 'locale' option displays the characters according to the -+ current locale. The 'invalid' option treats them as -+ non-string characters. The 'hex' option displays them as hex -+ byte sequences. The 'escape' option displays them as escape -+ sequences and the 'highlight' option displays them as -+ coloured escape sequences. -+ - --output-separator=sep_string - -s sep_string String used to separate parsed strings in output. - Default is newline. -@@ -76,6 +89,22 @@ - #include "safe-ctype.h" - #include "bucomm.h" - -+#ifndef streq -+#define streq(a,b) (strcmp ((a),(b)) == 0) -+#endif -+ -+typedef enum unicode_display_type -+{ -+ unicode_default = 0, -+ unicode_locale, -+ unicode_escape, -+ unicode_hex, -+ unicode_highlight, -+ unicode_invalid -+} unicode_display_type; -+ -+static unicode_display_type unicode_display = unicode_default; -+ - #define STRING_ISGRAPHIC(c) \ - ( (c) >= 0 \ - && (c) <= 255 \ -@@ -94,7 +123,7 @@ extern int errno; - static int address_radix; - - /* Minimum length of sequence of graphic chars to trigger output. */ --static int string_min; -+static unsigned int string_min; - - /* Whether or not we include all whitespace as a graphic char. */ - static bool include_all_whitespace; -@@ -121,21 +150,22 @@ static char *output_separator; - static struct option long_options[] = - { - {"all", no_argument, NULL, 'a'}, -+ {"bytes", required_argument, NULL, 'n'}, - {"data", no_argument, NULL, 'd'}, -+ {"encoding", required_argument, NULL, 'e'}, -+ {"help", no_argument, NULL, 'h'}, -+ {"include-all-whitespace", no_argument, NULL, 'w'}, -+ {"output-separator", required_argument, NULL, 's'}, - {"print-file-name", no_argument, NULL, 'f'}, -- {"bytes", required_argument, NULL, 'n'}, - {"radix", required_argument, NULL, 't'}, -- {"include-all-whitespace", no_argument, NULL, 'w'}, -- {"encoding", required_argument, NULL, 'e'}, - {"target", required_argument, NULL, 'T'}, -- {"output-separator", required_argument, NULL, 's'}, -- {"help", no_argument, NULL, 'h'}, -+ {"unicode", required_argument, NULL, 'U'}, - {"version", no_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} - }; - - static bool strings_file (char *); --static void print_strings (const char *, FILE *, file_ptr, int, int, char *); -+static void print_strings (const char *, FILE *, file_ptr, int, char *); - static void usage (FILE *, int) ATTRIBUTE_NORETURN; - - int main (int, char **); -@@ -171,7 +201,7 @@ main (int argc, char **argv) - encoding = 's'; - output_separator = NULL; - -- while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:Vv0123456789", -+ while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:U:Vv0123456789", - long_options, (int *) 0)) != EOF) - { - switch (optc) -@@ -244,6 +274,23 @@ main (int argc, char **argv) - output_separator = optarg; - break; - -+ case 'U': -+ if (streq (optarg, "default") || streq (optarg, "d")) -+ unicode_display = unicode_default; -+ else if (streq (optarg, "locale") || streq (optarg, "l")) -+ unicode_display = unicode_locale; -+ else if (streq (optarg, "escape") || streq (optarg, "e")) -+ unicode_display = unicode_escape; -+ else if (streq (optarg, "invalid") || streq (optarg, "i")) -+ unicode_display = unicode_invalid; -+ else if (streq (optarg, "hex") || streq (optarg, "x")) -+ unicode_display = unicode_hex; -+ else if (streq (optarg, "highlight") || streq (optarg, "h")) -+ unicode_display = unicode_highlight; -+ else -+ fatal (_("invalid argument to -U/--unicode: %s"), optarg); -+ break; -+ - case 'V': - case 'v': - print_version ("strings"); -@@ -258,6 +305,9 @@ main (int argc, char **argv) - } - } - -+ if (unicode_display != unicode_default) -+ encoding = 'S'; -+ - if (numeric_opt != 0) - { - string_min = (int) strtoul (argv[numeric_opt - 1] + 1, &s, 0); -@@ -293,14 +343,14 @@ main (int argc, char **argv) - { - datasection_only = false; - SET_BINARY (fileno (stdin)); -- print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL); -+ print_strings ("{standard input}", stdin, 0, 0, (char *) NULL); - files_given = true; - } - else - { - for (; optind < argc; ++optind) - { -- if (strcmp (argv[optind], "-") == 0) -+ if (streq (argv[optind], "-")) - datasection_only = false; - else - { -@@ -342,7 +392,7 @@ strings_a_section (bfd *abfd, asection * - } - - *got_a_section = true; -- print_strings (filename, NULL, sect->filepos, 0, sectsize, (char *) mem); -+ print_strings (filename, NULL, sect->filepos, sectsize, (char *) mem); - free (mem); - } - -@@ -427,7 +477,7 @@ strings_file (char *file) - return false; - } - -- print_strings (file, stream, (file_ptr) 0, 0, 0, (char *) 0); -+ print_strings (file, stream, (file_ptr) 0, 0, (char *) NULL); - - if (fclose (stream) == EOF) - { -@@ -551,6 +601,626 @@ unget_part_char (long c, file_ptr *addre - } - } - } -+ -+static void -+print_filename_and_address (const char * filename, file_ptr address) -+{ -+ if (print_filenames) -+ printf ("%s: ", filename); -+ -+ if (! print_addresses) -+ return; -+ -+ switch (address_radix) -+ { -+ case 8: -+ if (sizeof (address) > sizeof (long)) -+ { -+#ifndef __MSVCRT__ -+ printf ("%7llo ", (unsigned long long) address); -+#else -+ printf ("%7I64o ", (unsigned long long) address); -+#endif -+ } -+ else -+ printf ("%7lo ", (unsigned long) address); -+ break; -+ -+ case 10: -+ if (sizeof (address) > sizeof (long)) -+ { -+#ifndef __MSVCRT__ -+ printf ("%7llu ", (unsigned long long) address); -+#else -+ printf ("%7I64d ", (unsigned long long) address); -+#endif -+ } -+ else -+ printf ("%7ld ", (long) address); -+ break; -+ -+ case 16: -+ if (sizeof (address) > sizeof (long)) -+ { -+#ifndef __MSVCRT__ -+ printf ("%7llx ", (unsigned long long) address); -+#else -+ printf ("%7I64x ", (unsigned long long) address); -+#endif -+ } -+ else -+ printf ("%7lx ", (unsigned long) address); -+ break; -+ } -+} -+ -+/* Return non-zero if the bytes starting at BUFFER form a valid UTF-8 encoding. -+ If the encoding is valid then returns the number of bytes it uses. */ -+ -+static unsigned int -+is_valid_utf8 (const unsigned char * buffer, unsigned long buflen) -+{ -+ if (buffer[0] < 0xc0) -+ return 0; -+ -+ if (buflen < 2) -+ return 0; -+ -+ if ((buffer[1] & 0xc0) != 0x80) -+ return 0; -+ -+ if ((buffer[0] & 0x20) == 0) -+ return 2; -+ -+ if (buflen < 3) -+ return 0; -+ -+ if ((buffer[2] & 0xc0) != 0x80) -+ return 0; -+ -+ if ((buffer[0] & 0x10) == 0) -+ return 3; -+ -+ if (buflen < 4) -+ return 0; -+ -+ if ((buffer[3] & 0xc0) != 0x80) -+ return 0; -+ -+ return 4; -+} -+ -+/* Display a UTF-8 encoded character in BUFFER according to the setting -+ of unicode_display. The character is known to be valid. -+ Returns the number of bytes consumed. */ -+ -+static unsigned int -+display_utf8_char (const unsigned char * buffer) -+{ -+ unsigned int j; -+ unsigned int utf8_len; -+ -+ switch (buffer[0] & 0x30) -+ { -+ case 0x00: -+ case 0x10: -+ utf8_len = 2; -+ break; -+ case 0x20: -+ utf8_len = 3; -+ break; -+ default: -+ utf8_len = 4; -+ } -+ -+ switch (unicode_display) -+ { -+ default: -+ fprintf (stderr, "ICE: unexpected unicode display type\n"); -+ break; -+ -+ case unicode_escape: -+ case unicode_highlight: -+ if (unicode_display == unicode_highlight && isatty (1)) -+ printf ("\x1B[31;47m"); /* Red. */ -+ -+ switch (utf8_len) -+ { -+ case 2: -+ printf ("\\u%02x%02x", -+ ((buffer[0] & 0x1c) >> 2), -+ ((buffer[0] & 0x03) << 6) | (buffer[1] & 0x3f)); -+ break; -+ -+ case 3: -+ printf ("\\u%02x%02x", -+ ((buffer[0] & 0x0f) << 4) | ((buffer[1] & 0x3c) >> 2), -+ ((buffer[1] & 0x03) << 6) | ((buffer[2] & 0x3f))); -+ break; -+ -+ case 4: -+ printf ("\\u%02x%02x%02x", -+ ((buffer[0] & 0x07) << 6) | ((buffer[1] & 0x3c) >> 2), -+ ((buffer[1] & 0x03) << 6) | ((buffer[2] & 0x3c) >> 2), -+ ((buffer[2] & 0x03) << 6) | ((buffer[3] & 0x3f))); -+ break; -+ default: -+ /* URG. */ -+ break; -+ } -+ -+ if (unicode_display == unicode_highlight && isatty (1)) -+ printf ("\033[0m"); /* Default colour. */ -+ break; -+ -+ case unicode_hex: -+ putchar ('<'); -+ printf ("0x"); -+ for (j = 0; j < utf8_len; j++) -+ printf ("%02x", buffer [j]); -+ putchar ('>'); -+ break; -+ -+ case unicode_locale: -+ printf ("%.1s", buffer); -+ break; -+ } -+ -+ return utf8_len; -+} -+ -+/* Display strings in BUFFER. Treat any UTF-8 encoded characters encountered -+ according to the setting of the unicode_display variable. The buffer -+ contains BUFLEN bytes. -+ -+ Display the characters as if they started at ADDRESS and are contained in -+ FILENAME. */ -+ -+static void -+print_unicode_buffer (const char * filename, -+ file_ptr address, -+ const unsigned char * buffer, -+ unsigned long buflen) -+{ -+ /* Paranoia checks... */ -+ if (filename == NULL -+ || buffer == NULL -+ || unicode_display == unicode_default -+ || encoding != 'S' -+ || encoding_bytes != 1) -+ { -+ fprintf (stderr, "ICE: bad arguments to print_unicode_buffer\n"); -+ return; -+ } -+ -+ if (buflen == 0) -+ return; -+ -+ /* We must only display strings that are at least string_min *characters* -+ long. So we scan the buffer in two stages. First we locate the start -+ of a potential string. Then we walk along it until we have found -+ string_min characters. Then we go back to the start point and start -+ displaying characters according to the unicode_display setting. */ -+ -+ unsigned long start_point = 0; -+ unsigned long i = 0; -+ unsigned int char_len = 1; -+ unsigned int num_found = 0; -+ -+ for (i = 0; i < buflen; i += char_len) -+ { -+ int c = buffer[i]; -+ -+ char_len = 1; -+ -+ /* Find the first potential character of a string. */ -+ if (! STRING_ISGRAPHIC (c)) -+ { -+ num_found = 0; -+ continue; -+ } -+ -+ if (c > 126) -+ { -+ if (c < 0xc0) -+ { -+ num_found = 0; -+ continue; -+ } -+ -+ if ((char_len = is_valid_utf8 (buffer + i, buflen - i)) == 0) -+ { -+ char_len = 1; -+ num_found = 0; -+ continue; -+ } -+ -+ if (unicode_display == unicode_invalid) -+ { -+ /* We have found a valid UTF-8 character, but we treat it as non-graphic. */ -+ num_found = 0; -+ continue; -+ } -+ } -+ -+ if (num_found == 0) -+ /* We have found a potential starting point for a string. */ -+ start_point = i; -+ -+ ++ num_found; -+ -+ if (num_found >= string_min) -+ break; -+ } -+ -+ if (num_found < string_min) -+ return; -+ -+ print_filename_and_address (filename, address + start_point); -+ -+ /* We have found string_min characters. Display them and any -+ more that follow. */ -+ for (i = start_point; i < buflen; i += char_len) -+ { -+ int c = buffer[i]; -+ -+ char_len = 1; -+ -+ if (! STRING_ISGRAPHIC (c)) -+ break; -+ else if (c < 127) -+ putchar (c); -+ else if (! is_valid_utf8 (buffer + i, buflen - i)) -+ break; -+ else if (unicode_display == unicode_invalid) -+ break; -+ else -+ char_len = display_utf8_char (buffer + i); -+ } -+ -+ if (output_separator) -+ fputs (output_separator, stdout); -+ else -+ putchar ('\n'); -+ -+ /* FIXME: Using tail recursion here is lazy programming... */ -+ print_unicode_buffer (filename, address + i, buffer + i, buflen - i); -+} -+ -+static int -+get_unicode_byte (FILE * stream, -+ unsigned char * putback, -+ unsigned int * num_putback, -+ unsigned int * num_read) -+{ -+ if (* num_putback > 0) -+ { -+ * num_putback = * num_putback - 1; -+ return putback [* num_putback]; -+ } -+ -+ * num_read = * num_read + 1; -+ -+#if defined(HAVE_GETC_UNLOCKED) && HAVE_DECL_GETC_UNLOCKED -+ return getc_unlocked (stream); -+#else -+ return getc (stream); -+#endif -+} -+ -+/* Helper function for print_unicode_stream. */ -+ -+static void -+print_unicode_stream_body (const char * filename, -+ file_ptr address, -+ FILE * stream, -+ unsigned char * putback_buf, -+ unsigned int num_putback, -+ unsigned char * print_buf) -+{ -+ /* It would be nice if we could just read the stream into a buffer -+ and then process if with print_unicode_buffer. But the input -+ might be huge or it might time-locked (eg stdin). So instead -+ we go one byte at a time... */ -+ -+ file_ptr start_point = 0; -+ unsigned int num_read = 0; -+ unsigned int num_chars = 0; -+ unsigned int num_print = 0; -+ int c = 0; -+ -+ /* Find a series of string_min characters. Put them into print_buf. */ -+ do -+ { -+ if (num_chars >= string_min) -+ break; -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ -+ if (! STRING_ISGRAPHIC (c)) -+ { -+ num_chars = num_print = 0; -+ continue; -+ } -+ -+ if (num_chars == 0) -+ start_point = num_read - 1; -+ -+ if (c < 127) -+ { -+ print_buf[num_print] = c; -+ num_chars ++; -+ num_print ++; -+ continue; -+ } -+ -+ if (c < 0xc0) -+ { -+ num_chars = num_print = 0; -+ continue; -+ } -+ -+ /* We *might* have a UTF-8 sequence. Time to start peeking. */ -+ char utf8[4]; -+ -+ utf8[0] = c; -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[1] = c; -+ -+ if ((utf8[1] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ continue; -+ } -+ else if ((utf8[0] & 0x20) == 0) -+ { -+ /* A valid 2-byte UTF-8 encoding. */ -+ if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ } -+ else -+ { -+ print_buf[num_print ++] = utf8[0]; -+ print_buf[num_print ++] = utf8[1]; -+ num_chars ++; -+ } -+ continue; -+ } -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[2] = c; -+ -+ if ((utf8[2] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ continue; -+ } -+ else if ((utf8[0] & 0x10) == 0) -+ { -+ /* A valid 3-byte UTF-8 encoding. */ -+ if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ } -+ else -+ { -+ print_buf[num_print ++] = utf8[0]; -+ print_buf[num_print ++] = utf8[1]; -+ print_buf[num_print ++] = utf8[2]; -+ num_chars ++; -+ } -+ continue; -+ } -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[3] = c; -+ -+ if ((utf8[3] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[3]; -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ num_chars = num_print = 0; -+ } -+ /* We have a valid 4-byte UTF-8 encoding. */ -+ else if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[3]; -+ putback_buf[num_putback++] = utf8[1]; -+ putback_buf[num_putback++] = utf8[2]; -+ num_chars = num_print = 0; -+ } -+ else -+ { -+ print_buf[num_print ++] = utf8[0]; -+ print_buf[num_print ++] = utf8[1]; -+ print_buf[num_print ++] = utf8[2]; -+ print_buf[num_print ++] = utf8[3]; -+ num_chars ++; -+ } -+ } -+ while (1); -+ -+ if (num_chars >= string_min) -+ { -+ /* We know that we have string_min valid characters in print_buf, -+ and there may be more to come in the stream. Start displaying -+ them. */ -+ -+ print_filename_and_address (filename, address + start_point); -+ -+ unsigned int i; -+ for (i = 0; i < num_print;) -+ { -+ if (print_buf[i] < 127) -+ putchar (print_buf[i++]); -+ else -+ i += display_utf8_char (print_buf + i); -+ } -+ -+ /* OK so now we have to start read unchecked bytes. */ -+ -+ /* Find a series of string_min characters. Put them into print_buf. */ -+ do -+ { -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ -+ if (! STRING_ISGRAPHIC (c)) -+ break; -+ -+ if (c < 127) -+ { -+ putchar (c); -+ continue; -+ } -+ -+ if (c < 0xc0) -+ break; -+ -+ /* We *might* have a UTF-8 sequence. Time to start peeking. */ -+ unsigned char utf8[4]; -+ -+ utf8[0] = c; -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[1] = c; -+ -+ if ((utf8[1] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else if ((utf8[0] & 0x20) == 0) -+ { -+ /* Valid 2-byte UTF-8. */ -+ if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else -+ { -+ (void) display_utf8_char (utf8); -+ continue; -+ } -+ } -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[2] = c; -+ -+ if ((utf8[2] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else if ((utf8[0] & 0x10) == 0) -+ { -+ /* Valid 3-byte UTF-8. */ -+ if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else -+ { -+ (void) display_utf8_char (utf8); -+ continue; -+ } -+ } -+ -+ c = get_unicode_byte (stream, putback_buf, & num_putback, & num_read); -+ if (c == EOF) -+ break; -+ utf8[3] = c; -+ -+ if ((utf8[3] & 0xc0) != 0x80) -+ { -+ /* Invalid UTF-8. */ -+ putback_buf[num_putback++] = utf8[3]; -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else if (unicode_display == unicode_invalid) -+ { -+ putback_buf[num_putback++] = utf8[3]; -+ putback_buf[num_putback++] = utf8[2]; -+ putback_buf[num_putback++] = utf8[1]; -+ break; -+ } -+ else -+ /* A valid 4-byte UTF-8 encoding. */ -+ (void) display_utf8_char (utf8); -+ } -+ while (1); -+ -+ if (output_separator) -+ fputs (output_separator, stdout); -+ else -+ putchar ('\n'); -+ } -+ -+ if (c != EOF) -+ /* FIXME: Using tail recursion here is lazy, but it works. */ -+ print_unicode_stream_body (filename, address + num_read, stream, putback_buf, num_putback, print_buf); -+} -+ -+/* Display strings read in from STREAM. Treat any UTF-8 encoded characters -+ encountered according to the setting of the unicode_display variable. -+ The stream is positioned at ADDRESS and is attached to FILENAME. */ -+ -+static void -+print_unicode_stream (const char * filename, -+ file_ptr address, -+ FILE * stream) -+{ -+ /* Paranoia checks... */ -+ if (filename == NULL -+ || stream == NULL -+ || unicode_display == unicode_default -+ || encoding != 'S' -+ || encoding_bytes != 1) -+ { -+ fprintf (stderr, "ICE: bad arguments to print_unicode_stream\n"); -+ return; -+ } -+ -+ /* Allocate space for string_min 4-byte utf-8 characters. */ -+ unsigned char * print_buf = xmalloc ((4 * string_min) + 1); -+ /* We should never have to put back more than 4 bytes. */ -+ unsigned char putback_buf[5]; -+ unsigned int num_putback = 0; -+ -+ print_unicode_stream_body (filename, address, stream, putback_buf, num_putback, print_buf); -+ free (print_buf); -+} - - /* Find the strings in file FILENAME, read from STREAM. - Assume that STREAM is positioned so that the next byte read -@@ -566,20 +1236,29 @@ unget_part_char (long c, file_ptr *addre - - static void - print_strings (const char *filename, FILE *stream, file_ptr address, -- int stop_point, int magiccount, char *magic) -+ int magiccount, char *magic) - { -+ if (unicode_display != unicode_default) -+ { -+ if (magic != NULL) -+ print_unicode_buffer (filename, address, -+ (const unsigned char *) magic, magiccount); -+ -+ if (stream != NULL) -+ print_unicode_stream (filename, address, stream); -+ return; -+ } -+ - char *buf = (char *) xmalloc (sizeof (char) * (string_min + 1)); - - while (1) - { - file_ptr start; -- int i; -+ unsigned int i; - long c; - - /* See if the next `string_min' chars are all graphic chars. */ - tryline: -- if (stop_point && address >= stop_point) -- break; - start = address; - for (i = 0; i < string_min; i++) - { -@@ -601,51 +1280,7 @@ print_strings (const char *filename, FIL - - /* We found a run of `string_min' graphic characters. Print up - to the next non-graphic character. */ -- -- if (print_filenames) -- printf ("%s: ", filename); -- if (print_addresses) -- switch (address_radix) -- { -- case 8: -- if (sizeof (start) > sizeof (long)) -- { --#ifndef __MSVCRT__ -- printf ("%7llo ", (unsigned long long) start); --#else -- printf ("%7I64o ", (unsigned long long) start); --#endif -- } -- else -- printf ("%7lo ", (unsigned long) start); -- break; -- -- case 10: -- if (sizeof (start) > sizeof (long)) -- { --#ifndef __MSVCRT__ -- printf ("%7llu ", (unsigned long long) start); --#else -- printf ("%7I64d ", (unsigned long long) start); --#endif -- } -- else -- printf ("%7ld ", (long) start); -- break; -- -- case 16: -- if (sizeof (start) > sizeof (long)) -- { --#ifndef __MSVCRT__ -- printf ("%7llx ", (unsigned long long) start); --#else -- printf ("%7I64x ", (unsigned long long) start); --#endif -- } -- else -- printf ("%7lx ", (unsigned long) start); -- break; -- } -+ print_filename_and_address (filename, start); - - buf[i] = '\0'; - fputs (buf, stdout); -@@ -697,6 +1332,8 @@ usage (FILE *stream, int status) - -T --target=<BFDNAME> Specify the binary file format\n\ - -e --encoding={s,S,b,l,B,L} Select character size and endianness:\n\ - s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\ -+ --unicode={default|show|invalid|hex|escape|highlight}\n\ -+ -u {d|s|i|x|e|h} Specify how to treat UTF-8 encoded unicode characters\n\ - -s --output-separator=<string> String used to separate strings in output.\n\ - @<file> Read options from <file>\n\ - -h --help Display this information\n\meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch +6
-6@@ -1,4 +1,4 @@ -From 257ad1ce148417e1cefe2332d8acc5c8216c2522 Mon Sep 17 00:00:00 2001 +From 07bb7fbdacaf9cd6a1a252ffbc98f4e05e305d50 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:58:54 +0000 Subject: [PATCH] binutils-crosssdk: Generate relocatable SDKs@@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <[email protected]> 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gold/layout.cc b/gold/layout.cc -index a27cb071c75..32b52890b39 100644 +index 3efe8d98ae9..9cc389664a6 100644 --- a/gold/layout.cc +++ b/gold/layout.cc -@@ -5032,7 +5032,7 @@ Layout::create_interp(const Target* target) +@@ -5033,7 +5033,7 @@ Layout::create_interp(const Target* target) gold_assert(interp != NULL); }@@ -34,7 +34,7 @@ index a27cb071c75..32b52890b39 100644 Output_section_data* odata = new Output_data_const(interp, len, 1); diff --git a/ld/genscripts.sh b/ld/genscripts.sh -index 088417ef2d5..46a2db7005c 100755 +index 278f212bdad..0c52ebee4d0 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -304,6 +304,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"@@ -59,10 +59,10 @@ index 088417ef2d5..46a2db7005c 100755 DATA_ALIGNMENT=${DATA_ALIGNMENT_} RELOCATING=" " diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc -index 29a8f0781d5..75e46f4adaf 100644 +index bf2268bb0ad..b1811ef130f 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc -@@ -147,8 +147,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then +@@ -148,8 +148,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" fi fimeta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch deleted +0
-215@@ -1,215 +0,0 @@ -From b2e18d3ea300f7491705b6e86a7cc3d6366e3b1f Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" <[email protected]> -Date: Tue, 30 Nov 2021 20:40:38 -0800 -Subject: [PATCH] elf: Discard input .note.gnu.build-id sections - -1. Discard input .note.gnu.build-id sections. -2. Clear the build ID field before writing. -3. Use bfd_make_section_anyway_with_flags to create the output -.note.gnu.build-id section. - - PR ld/28639 - * ldelf.c (ldelf_after_open): Discard input .note.gnu.build-id - sections, excluding the first one. - (write_build_id): Clear the build ID field before writing. - (ldelf_setup_build_id): Use bfd_make_section_anyway_with_flags - to create the output .note.gnu.build-id section. - * testsuite/ld-elf/build-id.exp: New file. - * testsuite/ld-elf/pr28639a.rd: Likewise. - * testsuite/ld-elf/pr28639b.rd: Likewise. - * testsuite/ld-elf/pr28639c.rd: Likewise. - * testsuite/ld-elf/pr28639d.rd: Likewise. - -Upstream-Status: Backport - -Reference to upstream patch: -[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1f1d0f8888a6c944e612b416a2a6e11abcf5199f] ---- - ld/ldelf.c | 15 ++++++- - ld/testsuite/ld-elf/build-id.exp | 77 ++++++++++++++++++++++++++++++++ - ld/testsuite/ld-elf/pr28639a.rd | 6 +++ - ld/testsuite/ld-elf/pr28639b.rd | 6 +++ - ld/testsuite/ld-elf/pr28639c.rd | 10 +++++ - ld/testsuite/ld-elf/pr28639d.rd | 4 ++ - 6 files changed, 117 insertions(+), 1 deletion(-) - create mode 100644 ld/testsuite/ld-elf/build-id.exp - create mode 100644 ld/testsuite/ld-elf/pr28639a.rd - create mode 100644 ld/testsuite/ld-elf/pr28639b.rd - create mode 100644 ld/testsuite/ld-elf/pr28639c.rd - create mode 100644 ld/testsuite/ld-elf/pr28639d.rd - -diff --git a/ld/ldelf.c b/ld/ldelf.c -index 21e655bb55c..8501d98b48f 100644 ---- a/ld/ldelf.c -+++ b/ld/ldelf.c -@@ -1043,6 +1043,15 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, - /* Do not allow executable files to be used as inputs to the link. */ - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - { -+ /* Discard input .note.gnu.build-id sections. */ -+ s = bfd_get_section_by_name (abfd, ".note.gnu.build-id"); -+ while (s != NULL) -+ { -+ if (s != elf_tdata (link_info.output_bfd)->o->build_id.sec) -+ s->flags |= SEC_EXCLUDE; -+ s = bfd_get_next_section_by_name (NULL, s); -+ } -+ - if (abfd->xvec->flavour == bfd_target_elf_flavour - && !bfd_input_just_syms (abfd) - && elf_tdata (abfd) != NULL -@@ -1387,6 +1396,9 @@ write_build_id (bfd *abfd) - id_bits = contents + size; - size = asec->size - size; - -+ /* Clear the build ID field. */ -+ memset (id_bits, 0, size); -+ - bfd_h_put_32 (abfd, sizeof "GNU", &e_note->namesz); - bfd_h_put_32 (abfd, size, &e_note->descsz); - bfd_h_put_32 (abfd, NT_GNU_BUILD_ID, &e_note->type); -@@ -1418,7 +1430,8 @@ ldelf_setup_build_id (bfd *ibfd) - - flags = (SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY - | SEC_LINKER_CREATED | SEC_READONLY | SEC_DATA); -- s = bfd_make_section_with_flags (ibfd, ".note.gnu.build-id", flags); -+ s = bfd_make_section_anyway_with_flags (ibfd, ".note.gnu.build-id", -+ flags); - if (s != NULL && bfd_set_section_alignment (s, 2)) - { - struct elf_obj_tdata *t = elf_tdata (link_info.output_bfd); -diff --git a/ld/testsuite/ld-elf/build-id.exp b/ld/testsuite/ld-elf/build-id.exp -new file mode 100644 -index 00000000000..19c22a75c4d ---- /dev/null -+++ b/ld/testsuite/ld-elf/build-id.exp -@@ -0,0 +1,77 @@ -+# Expect script for --build-id tests. -+# Copyright (C) 2021 Free Software Foundation, Inc. -+# -+# This file is part of the GNU Binutils. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+# MA 02110-1301, USA. -+# -+ -+# Exclude non-ELF targets. -+ -+if ![is_elf_format] { -+ return -+} -+ -+if { [istarget frv-*-*] || [istarget lm32-*-*] } { -+ return -+} -+ -+if { !([istarget *-*-linux*] -+ || [istarget arm*-*-uclinuxfdpiceabi] -+ || [istarget *-*-nacl*] -+ || [istarget *-*-gnu*]) } then { -+ return -+} -+ -+run_ld_link_tests [list \ -+ [list \ -+ "pr28639a.o" \ -+ "-r --build-id=md5" \ -+ "" \ -+ "" \ -+ {start.s} \ -+ {{readelf {--notes} pr28639a.rd}} \ -+ "pr28639a.o" \ -+ ] \ -+ [list \ -+ "pr28639a.o" \ -+ "-r --build-id" \ -+ "" \ -+ "" \ -+ {dummy.s} \ -+ {{readelf {--notes} pr28639b.rd}} \ -+ "pr28639b.o" \ -+ ] \ -+ [list \ -+ "pr28639a" \ -+ "--build-id tmpdir/pr28639a.o tmpdir/pr28639b.o" \ -+ "" \ -+ "" \ -+ {dummy.s} \ -+ {{readelf {--notes} pr28639b.rd} \ -+ {readelf {--notes} pr28639c.rd}} \ -+ "pr28639a" \ -+ ] \ -+ [list \ -+ "pr28639b" \ -+ "--build-id=none tmpdir/pr28639a.o tmpdir/pr28639b.o" \ -+ "" \ -+ "" \ -+ {dummy.s} \ -+ {{readelf {--notes} pr28639d.rd}} \ -+ "pr28639b" \ -+ ] \ -+] -diff --git a/ld/testsuite/ld-elf/pr28639a.rd b/ld/testsuite/ld-elf/pr28639a.rd -new file mode 100644 -index 00000000000..e85087064d0 ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr28639a.rd -@@ -0,0 +1,6 @@ -+#... -+Displaying notes found in: \.note\.gnu\.build-id -+ Owner Data size Description -+ GNU 0x00000010 NT_GNU_BUILD_ID \(unique build ID bitstring\) -+ Build ID: [0-9a-f]+ -+#pass -diff --git a/ld/testsuite/ld-elf/pr28639b.rd b/ld/testsuite/ld-elf/pr28639b.rd -new file mode 100644 -index 00000000000..04dcb04bec2 ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr28639b.rd -@@ -0,0 +1,6 @@ -+#... -+Displaying notes found in: \.note\.gnu\.build-id -+ Owner Data size Description -+ GNU 0x00000014 NT_GNU_BUILD_ID \(unique build ID bitstring\) -+ Build ID: [0-9a-f]+ -+#pass -diff --git a/ld/testsuite/ld-elf/pr28639c.rd b/ld/testsuite/ld-elf/pr28639c.rd -new file mode 100644 -index 00000000000..64221e5fa51 ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr28639c.rd -@@ -0,0 +1,10 @@ -+#failif -+#... -+Displaying notes found in: \.note\.gnu\.build-id -+ Owner Data size Description -+ GNU 0x[0-9a-f]+ NT_GNU_BUILD_ID \(unique build ID bitstring\) -+ Build ID: [0-9a-f]+ -+ Owner Data size Description -+ GNU 0x[0-9a-f]+ NT_GNU_BUILD_ID \(unique build ID bitstring\) -+ Build ID: [0-9a-f]+ -+#... -diff --git a/ld/testsuite/ld-elf/pr28639d.rd b/ld/testsuite/ld-elf/pr28639d.rd -new file mode 100644 -index 00000000000..897c8493efa ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr28639d.rd -@@ -0,0 +1,4 @@ -+#failif -+#... -+Displaying notes found in: \.note\.gnu\.build-id -+#... --- -meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch +2
-2@@ -1,4 +1,4 @@ -From 6e93d0328f499569db7ce6396f94f304ce340df8 Mon Sep 17 00:00:00 2001 +From f820ab7ea7e94d4df548be3388163ff2efb2ea96 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 6 Mar 2017 23:37:05 -0800 Subject: [PATCH] binutils-cross: Do not generate linker script directories@@ -22,7 +22,7 @@ Signed-off-by: Khem Raj <[email protected]> 1 file changed, 25 deletions(-) diff --git a/ld/genscripts.sh b/ld/genscripts.sh -index 46a2db7005c..4bb7c33f560 100755 +index 0c52ebee4d0..1acbe66bd2e 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -235,31 +235,6 @@ append_to_lib_path()meta/recipes-devtools/binutils/binutils/0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch +8
-8@@ -1,4 +1,4 @@ -From d49016d3faf684319bf3ac37450558920d70be03 Mon Sep 17 00:00:00 2001 +From b2ccd25828b40310caeb094c0413e3a30a4dc0a5 Mon Sep 17 00:00:00 2001 From: Richard Purdie <[email protected]> Date: Wed, 19 Feb 2020 09:51:16 -0800 Subject: [PATCH] binutils-nativesdk: Search for alternative ld.so.conf in SDK@@ -29,7 +29,7 @@ Signed-off-by: Khem Raj <[email protected]> 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ld/Makefile.am b/ld/Makefile.am -index f8e99325361..fd196541f59 100644 +index b55a873d927..61db131fb0d 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -42,7 +42,8 @@ ZLIBINC = @zlibinc@@@ -43,10 +43,10 @@ index f8e99325361..fd196541f59 100644 NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) diff --git a/ld/Makefile.in b/ld/Makefile.in -index ef2e99e08da..cb8f5bfb70e 100644 +index 61e93eeaf1e..860eb21a785 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -555,7 +555,8 @@ ZLIB = @zlibdir@ -lz +@@ -556,7 +556,8 @@ ZLIB = @zlibdir@ -lz ZLIBINC = @zlibinc@ ELF_CLFAGS = -DELF_LIST_OPTIONS=@elf_list_options@ \ -DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \@@ -57,10 +57,10 @@ index ef2e99e08da..cb8f5bfb70e 100644 AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) diff --git a/ld/ldelf.c b/ld/ldelf.c -index 21e655bb55c..d1615003ede 100644 +index 121c25d948f..34cbc60e5e9 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c -@@ -911,7 +911,7 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force, +@@ -930,7 +930,7 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force, info.path = NULL; info.len = info.alloc = 0;@@ -70,7 +70,7 @@ index 21e655bb55c..d1615003ede 100644 if (!ldelf_parse_ld_so_conf (&info, tmppath)) { diff --git a/ld/ldmain.c b/ld/ldmain.c -index 42660eb9a3c..5a4a4d5da3d 100644 +index ea72b14a301..1ae90a77749 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -70,6 +70,7 @@ char *program_name;@@ -82,7 +82,7 @@ index 42660eb9a3c..5a4a4d5da3d 100644 /* The canonical representation of ld_sysroot. */ char *ld_canon_sysroot; diff --git a/ld/ldmain.h b/ld/ldmain.h -index 39d08a6c378..4c3519e7970 100644 +index f6d05a02f59..e60292cd522 100644 --- a/ld/ldmain.h +++ b/ld/ldmain.h @@ -23,6 +23,7 @@meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch renamed from meta/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch +4
-4@@ -1,4 +1,4 @@ -From 1a9fcaae50e63b993019bd4dc00219e43421efdc Mon Sep 17 00:00:00 2001 +From 7a7b777cdfded080aab1021fa6bcdb20345f5cfd Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:09:58 +0000 Subject: [PATCH] Point scripts location to libdir@@ -12,7 +12,7 @@ Signed-off-by: Khem Raj <[email protected]> 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ld/Makefile.am b/ld/Makefile.am -index fd196541f59..d94fa7e64e1 100644 +index 61db131fb0d..5b5ee64d121 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -51,7 +51,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)@@ -25,10 +25,10 @@ index fd196541f59..d94fa7e64e1 100644 EMUL = @EMUL@ EMULATION_OFILES = @EMULATION_OFILES@ diff --git a/ld/Makefile.in b/ld/Makefile.in -index cb8f5bfb70e..9a58879c5ca 100644 +index 860eb21a785..d719747919c 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -563,7 +563,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -564,7 +564,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers.meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch renamed from meta/recipes-devtools/binutils/binutils/0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch +4
-4@@ -1,4 +1,4 @@ -From 29517900352336708495d41902b5b7e8cc9a401a Mon Sep 17 00:00:00 2001 +From edddb1f294d667eac94649ba0665fe464990ed18 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:27:17 +0000 Subject: [PATCH] Only generate an RPATH entry if LD_RUN_PATH is not empty@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <[email protected]> 1 file changed, 4 insertions(+) diff --git a/ld/ldelf.c b/ld/ldelf.c -index d1615003ede..6a894285b11 100644 +index 34cbc60e5e9..b1965a9e96f 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c -@@ -1250,6 +1250,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, +@@ -1277,6 +1277,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, && command_line.rpath == NULL) { path = (const char *) getenv ("LD_RUN_PATH");@@ -26,7 +26,7 @@ index d1615003ede..6a894285b11 100644 if (path && ldelf_search_needed (path, &n, force, is_linux, elfsize)) -@@ -1610,6 +1612,8 @@ ldelf_before_allocation (char *audit, char *depaudit, +@@ -1636,6 +1638,8 @@ ldelf_before_allocation (char *audit, char *depaudit, rpath = command_line.rpath; if (rpath == NULL) rpath = (const char *) getenv ("LD_RUN_PATH");meta/recipes-devtools/binutils/binutils/0006-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch renamed from meta/recipes-devtools/binutils/binutils/0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch +3
-3@@ -1,4 +1,4 @@ -From 37581c8ce9d98a1183706e12a2c9a73f7f40462d Mon Sep 17 00:00:00 2001 +From fc9e8b99969bb32a4b009eab763bade6c554ef73 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Mon, 2 Mar 2015 01:39:01 +0000 Subject: [PATCH] don't let the distro compiler point to the wrong installation@@ -17,10 +17,10 @@ Signed-off-by: Khem Raj <[email protected]> 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in -index 4f1213b983b..2ba18b75cac 100644 +index abef3c4601b..880c8826482 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in -@@ -367,7 +367,8 @@ install-strip: install +@@ -385,7 +385,8 @@ install-strip: install # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the # default multilib, so we have to take CFLAGS into account as well, # since it will be passed the multilib flags.meta/recipes-devtools/binutils/binutils/0007-warn-for-uses-of-system-directories-when-cross-linki.patch renamed from meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch +33
-15@@ -1,4 +1,4 @@ -From 99e1565b9d2b929d4ee4e9da6f63766b22b23fc3 Mon Sep 17 00:00:00 2001 +From 9fb1bafb20371d82b674778d2a8b5c9444fed417 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Fri, 15 Jan 2016 06:31:09 +0000 Subject: [PATCH] warn for uses of system directories when cross linking@@ -58,10 +58,12 @@ Signed-off-by: Khem Raj <[email protected]> ld/ld.texi | 12 ++++++++++++ ld/ldfile.c | 17 +++++++++++++++++ ld/ldlex.h | 2 ++ - ld/ldmain.c | 2 ++ + ld/ldmain.c | 6 ++++-- ld/lexsup.c | 16 ++++++++++++++++ - 9 files changed, 86 insertions(+) + 9 files changed, 88 insertions(+), 2 deletions(-) +diff --git a/ld/config.in b/ld/config.in +index 26d55a00d47..ffad464783c 100644 --- a/ld/config.in +++ b/ld/config.in @@ -43,6 +43,9 @@@@ -74,9 +76,11 @@ Signed-off-by: Khem Raj <[email protected]> /* Additional extension a shared object might have. */ #undef EXTRA_SHLIB_EXTENSION +diff --git a/ld/configure b/ld/configure +index 26150d62898..1f9ec8ec580 100755 --- a/ld/configure +++ b/ld/configure -@@ -829,6 +829,7 @@ with_lib_path +@@ -831,6 +831,7 @@ with_lib_path enable_targets enable_64_bit_bfd with_sysroot@@ -84,7 +88,7 @@ Signed-off-by: Khem Raj <[email protected]> enable_gold enable_got enable_compressed_debug_sections -@@ -1498,6 +1499,8 @@ Optional Features: +@@ -1500,6 +1501,8 @@ Optional Features: --enable-checking enable run-time checks --enable-targets alternative target configurations --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)@@ -93,7 +97,7 @@ Signed-off-by: Khem Raj <[email protected]> --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-got=<type> GOT handling scheme (target, single, negative, multigot) -@@ -15215,6 +15218,19 @@ fi +@@ -15312,6 +15315,19 @@ fi@@ -113,9 +117,11 @@ Signed-off-by: Khem Raj <[email protected]> # Check whether --enable-gold was given. if test "${enable_gold+set}" = set; then : enableval=$enable_gold; case "${enableval}" in +diff --git a/ld/configure.ac b/ld/configure.ac +index 7f4cff079b7..57d1abff870 100644 --- a/ld/configure.ac +++ b/ld/configure.ac -@@ -106,6 +106,16 @@ AC_SUBST(use_sysroot) +@@ -102,6 +102,16 @@ AC_SUBST(use_sysroot) AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)@@ -132,6 +138,8 @@ Signed-off-by: Khem Raj <[email protected]> dnl Use --enable-gold to decide if this linker should be the default. dnl "install_as_default" is set to false if gold is the default linker. dnl "installed_linker" is the installed BFD linker name. +diff --git a/ld/ld.h b/ld/ld.h +index f3086bf30de..db5064243c7 100644 --- a/ld/ld.h +++ b/ld/ld.h @@ -162,6 +162,14 @@ typedef struct@@ -149,9 +157,11 @@ Signed-off-by: Khem Raj <[email protected]> /* Big or little endian as set on command line. */ enum endian_enum endian; +diff --git a/ld/ld.texi b/ld/ld.texi +index fc75e9b3625..dca697d626e 100644 --- a/ld/ld.texi +++ b/ld/ld.texi -@@ -2863,6 +2863,18 @@ string identifying the original linked f +@@ -2892,6 +2892,18 @@ string identifying the original linked file does not change. Passing @code{none} for @var{style} disables the setting from any @code{--build-id} options earlier on the command line.@@ -170,9 +180,11 @@ Signed-off-by: Khem Raj <[email protected]> @end table @c man end +diff --git a/ld/ldfile.c b/ld/ldfile.c +index 731ae5f7aed..dd8f03fd960 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c -@@ -117,6 +117,23 @@ ldfile_add_library_path (const char *nam +@@ -117,6 +117,23 @@ ldfile_add_library_path (const char *name, bool cmdline) new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); else new_dirs->name = xstrdup (name);@@ -196,9 +208,11 @@ Signed-off-by: Khem Raj <[email protected]> } /* Try to open a BFD for a lang_input_statement. */ +diff --git a/ld/ldlex.h b/ld/ldlex.h +index bc58fea73cc..a1595589197 100644 --- a/ld/ldlex.h +++ b/ld/ldlex.h -@@ -163,6 +163,8 @@ enum option_values +@@ -164,6 +164,8 @@ enum option_values OPTION_CTF_VARIABLES, OPTION_NO_CTF_VARIABLES, OPTION_CTF_SHARE_TYPES,@@ -207,9 +221,11 @@ Signed-off-by: Khem Raj <[email protected]> }; /* The initial parser states. */ +diff --git a/ld/ldmain.c b/ld/ldmain.c +index 1ae90a77749..f40750fd816 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c -@@ -321,6 +321,8 @@ main (int argc, char **argv) +@@ -322,6 +322,8 @@ main (int argc, char **argv) command_line.warn_mismatch = true; command_line.warn_search_mismatch = true; command_line.check_section_addresses = -1;@@ -218,7 +234,7 @@ Signed-off-by: Khem Raj <[email protected]> /* We initialize DEMANGLING based on the environment variable COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the -@@ -1444,7 +1446,7 @@ undefined_symbol (struct bfd_link_info * +@@ -1447,7 +1449,7 @@ undefined_symbol (struct bfd_link_info *info, argv[1] = "undefined-symbol"; argv[2] = (char *) name; argv[3] = NULL;@@ -227,7 +243,7 @@ Signed-off-by: Khem Raj <[email protected]> if (verbose) einfo (_("%P: About to run error handling script '%s' with arguments: '%s' '%s'\n"), argv[0], argv[1], argv[2]); -@@ -1465,7 +1467,7 @@ undefined_symbol (struct bfd_link_info * +@@ -1468,7 +1470,7 @@ undefined_symbol (struct bfd_link_info *info, carry on to issue the normal error message. */ } #endif /* SUPPORT_ERROR_HANDLING_SCRIPT */@@ -236,9 +252,11 @@ Signed-off-by: Khem Raj <[email protected]> if (section != NULL) { if (error_count < MAX_ERRORS_IN_A_ROW) +diff --git a/ld/lexsup.c b/ld/lexsup.c +index 5acc47ed5a0..d03c6136ccf 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c -@@ -595,6 +595,14 @@ static const struct ld_option ld_options +@@ -600,6 +600,14 @@ static const struct ld_option ld_options[] = " <method> is: share-unconflicted (default),\n" " share-duplicated"), TWO_DASHES },@@ -253,7 +271,7 @@ Signed-off-by: Khem Raj <[email protected]> }; #define OPTION_COUNT ARRAY_SIZE (ld_options) -@@ -1686,6 +1694,14 @@ parse_args (unsigned argc, char **argv) +@@ -1702,6 +1710,14 @@ parse_args (unsigned argc, char **argv) config.print_map_discarded = true; break;meta/recipes-devtools/binutils/binutils/0008-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch renamed from meta/recipes-devtools/binutils/binutils/0011-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch +3
-4@@ -1,4 +1,4 @@ -From b77c5a67d4ac2513d0b4bab5e4dd1c33b339689b Mon Sep 17 00:00:00 2001 +From 00ae1ee97ad3ad0624798b28c6bab94a19b3ef39 Mon Sep 17 00:00:00 2001 From: Zhenhua Luo <[email protected]> Date: Sat, 11 Jun 2016 22:08:29 -0500 Subject: [PATCH] fix the incorrect assembling for ppc wait mnemonic@@ -7,15 +7,14 @@ The wait mnemonic for ppc targets is incorrectly assembled into 0x7c00003c due to duplicated address definition with waitasec instruction. The issue causes kernel boot calltrace for ppc targets when wait instruction is executed. -Signed-off-by: Zhenhua Luo <[email protected]> - Upstream-Status: Pending +Signed-off-by: Zhenhua Luo <[email protected]> --- opcodes/ppc-opc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c -index 13d8b6c3c07..cd979f9c80c 100644 +index a424dd924de..406d5b60917 100644 --- a/opcodes/ppc-opc.c +++ b/opcodes/ppc-opc.c @@ -6378,8 +6378,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {meta/recipes-devtools/binutils/binutils/0009-Use-libtool-2.4.patch renamed from meta/recipes-devtools/binutils/binutils/0013-Use-libtool-2.4.patch +3027
-937@@ -1,4 +1,4 @@ -From fd34d57c9e2a0bff1283a6707062ed4a42476b10 Mon Sep 17 00:00:00 2001 +From 9a0dea4d2f1f0f2c71f519e6195ef9cfacd9fda9 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Sun, 14 Feb 2016 17:04:07 +0000 Subject: [PATCH] Use libtool 2.4@@ -9,27 +9,28 @@ Upstream-Status: Pending Signed-off-by: Khem Raj <[email protected]> --- - bfd/configure | 1340 +++++++++++++++----- - bfd/configure.ac | 2 +- - binutils/configure | 1338 +++++++++++++++----- - gas/configure | 1338 +++++++++++++++----- - gprof/configure | 1338 +++++++++++++++----- - ld/configure | 1713 +++++++++++++++++++------- - libctf/configure | 1337 +++++++++++++++----- - libtool.m4 | 1100 +++++++++++------ - ltmain.sh | 2925 +++++++++++++++++++++++++++++--------------- - ltoptions.m4 | 2 +- - ltversion.m4 | 12 +- - lt~obsolete.m4 | 2 +- - opcodes/configure | 1338 +++++++++++++++----- - zlib/configure | 1338 +++++++++++++++----- - 14 files changed, 10995 insertions(+), 4128 deletions(-) + bfd/configure | 1333 +++++++++++++----- + bfd/configure.ac | 2 +- + binutils/configure | 1331 +++++++++++++----- + gas/configure | 1331 +++++++++++++----- + gprof/configure | 1331 +++++++++++++----- + ld/configure | 1704 +++++++++++++++++------ + libbacktrace/configure | 1534 +++++++++++++++------ + libctf/configure | 1330 +++++++++++++----- + libtool.m4 | 1093 ++++++++++----- + ltmain.sh | 2925 +++++++++++++++++++++++++++------------- + ltoptions.m4 | 2 +- + ltversion.m4 | 12 +- + lt~obsolete.m4 | 2 +- + opcodes/configure | 1331 +++++++++++++----- + zlib/configure | 1331 +++++++++++++----- + 15 files changed, 12067 insertions(+), 4525 deletions(-) diff --git a/bfd/configure b/bfd/configure -index daa51244369..79d0c4b4623 100755 +index b23c9eebfd7..fb25d046cd2 100755 --- a/bfd/configure +++ b/bfd/configure -@@ -705,6 +705,9 @@ OTOOL +@@ -707,6 +707,9 @@ OTOOL LIPO NMEDIT DSYMUTIL@@ -39,7 +40,7 @@ index daa51244369..79d0c4b4623 100755 OBJDUMP LN_S NM -@@ -823,6 +826,7 @@ enable_static +@@ -825,6 +828,7 @@ enable_static with_pic enable_fast_install with_gnu_ld@@ -47,7 +48,7 @@ index daa51244369..79d0c4b4623 100755 enable_libtool_lock enable_plugins enable_largefile -@@ -1507,6 +1511,8 @@ Optional Packages: +@@ -1509,6 +1513,8 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no]@@ -56,7 +57,7 @@ index daa51244369..79d0c4b4623 100755 --with-mmap try using mmap for BFD input files if available --with-separate-debug-dir=DIR Look for global separate debug info in DIR -@@ -4988,8 +4994,8 @@ esac +@@ -5029,8 +5035,8 @@ esac@@ -67,7 +68,7 @@ index daa51244369..79d0c4b4623 100755 -@@ -5029,7 +5035,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO +@@ -5070,7 +5076,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present.@@ -76,7 +77,7 @@ index daa51244369..79d0c4b4623 100755 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then -@@ -5715,8 +5721,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; +@@ -5757,8 +5763,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c"@@ -87,7 +88,7 @@ index daa51244369..79d0c4b4623 100755 && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes -@@ -5765,6 +5771,80 @@ esac +@@ -5807,6 +5813,80 @@ esac@@ -168,7 +169,7 @@ index daa51244369..79d0c4b4623 100755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : -@@ -5781,6 +5861,11 @@ case $reload_flag in +@@ -5823,6 +5903,11 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in@@ -180,7 +181,7 @@ index daa51244369..79d0c4b4623 100755 darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' -@@ -5949,7 +6034,8 @@ mingw* | pw32*) +@@ -5991,7 +6076,8 @@ mingw* | pw32*) lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else@@ -190,7 +191,7 @@ index daa51244369..79d0c4b4623 100755 lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -@@ -6103,6 +6189,21 @@ esac +@@ -6145,6 +6231,21 @@ esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; }@@ -212,7 +213,7 @@ index daa51244369..79d0c4b4623 100755 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown -@@ -6118,6 +6219,157 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -6160,6 +6261,157 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown@@ -370,7 +371,7 @@ index daa51244369..79d0c4b4623 100755 plugin_option= plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" for plugin in $plugin_names; do -@@ -6132,8 +6384,10 @@ for plugin in $plugin_names; do +@@ -6174,8 +6426,10 @@ for plugin in $plugin_names; do done if test -n "$ac_tool_prefix"; then@@ -383,7 +384,7 @@ index daa51244369..79d0c4b4623 100755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : -@@ -6149,7 +6403,7 @@ do +@@ -6191,7 +6445,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then@@ -392,7 +393,7 @@ index daa51244369..79d0c4b4623 100755 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi -@@ -6169,11 +6423,15 @@ $as_echo "no" >&6; } +@@ -6211,11 +6465,15 @@ $as_echo "no" >&6; } fi@@ -411,7 +412,7 @@ index daa51244369..79d0c4b4623 100755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : -@@ -6189,7 +6447,7 @@ do +@@ -6231,7 +6489,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then@@ -420,7 +421,7 @@ index daa51244369..79d0c4b4623 100755 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi -@@ -6208,6 +6466,10 @@ else +@@ -6250,6 +6508,10 @@ else $as_echo "no" >&6; } fi@@ -431,7 +432,7 @@ index daa51244369..79d0c4b4623 100755 if test "x$ac_ct_AR" = x; then AR="false" else -@@ -6219,25 +6481,20 @@ ac_tool_warned=yes ;; +@@ -6261,25 +6523,20 @@ ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi@@ -467,7 +468,7 @@ index daa51244369..79d0c4b4623 100755 -@@ -6248,6 +6505,63 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru +@@ -6290,6 +6547,63 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru@@ -531,7 +532,7 @@ index daa51244369..79d0c4b4623 100755 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -@@ -6588,8 +6902,8 @@ esac +@@ -6630,8 +6944,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address@@ -542,7 +543,7 @@ index daa51244369..79d0c4b4623 100755 # Handle CRLF in mingw tool chain opt_cr= -@@ -6625,6 +6939,7 @@ for ac_symprfx in "" "_"; do +@@ -6667,6 +6981,7 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi@@ -550,7 +551,7 @@ index daa51244369..79d0c4b4623 100755 # Check to see that the pipe works correctly. pipe_works=no -@@ -6666,6 +6981,18 @@ _LT_EOF +@@ -6708,6 +7023,18 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext@@ -569,7 +570,7 @@ index daa51244369..79d0c4b4623 100755 #ifdef __cplusplus extern "C" { #endif -@@ -6677,7 +7004,7 @@ _LT_EOF +@@ -6719,7 +7046,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */@@ -578,7 +579,7 @@ index daa51244369..79d0c4b4623 100755 const char *name; void *address; } -@@ -6703,8 +7030,8 @@ static const void *lt_preloaded_setup() { +@@ -6745,8 +7072,8 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext@@ -589,7 +590,7 @@ index daa51244369..79d0c4b4623 100755 LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 -@@ -6714,8 +7041,8 @@ _LT_EOF +@@ -6756,8 +7083,8 @@ _LT_EOF test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi@@ -600,7 +601,7 @@ index daa51244369..79d0c4b4623 100755 else echo "cannot find nm_test_func in $nlist" >&5 fi -@@ -6752,6 +7079,14 @@ else +@@ -6794,6 +7121,14 @@ else $as_echo "ok" >&6; } fi@@ -615,7 +616,7 @@ index daa51244369..79d0c4b4623 100755 -@@ -6770,6 +7105,47 @@ fi +@@ -6812,6 +7147,47 @@ fi@@ -663,7 +664,7 @@ index daa51244369..79d0c4b4623 100755 -@@ -6979,6 +7355,123 @@ esac +@@ -7021,6 +7397,123 @@ esac need_locks="$enable_libtool_lock"@@ -787,7 +788,7 @@ index daa51244369..79d0c4b4623 100755 case $host_os in rhapsody* | darwin*) -@@ -7542,6 +8035,8 @@ _LT_EOF +@@ -7584,6 +8077,8 @@ _LT_EOF $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5@@ -796,7 +797,7 @@ index daa51244369..79d0c4b4623 100755 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF -@@ -8093,8 +8589,6 @@ fi +@@ -8135,8 +8630,6 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static=@@ -805,7 +806,7 @@ index daa51244369..79d0c4b4623 100755 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' -@@ -8260,6 +8754,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } +@@ -8302,6 +8795,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;;@@ -818,7 +819,7 @@ index daa51244369..79d0c4b4623 100755 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) -@@ -8322,7 +8822,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } +@@ -8364,7 +8863,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in@@ -827,7 +828,7 @@ index daa51244369..79d0c4b4623 100755 lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; -@@ -8379,13 +8879,17 @@ case $host_os in +@@ -8421,13 +8920,17 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac@@ -851,7 +852,7 @@ index daa51244369..79d0c4b4623 100755 # # Check to make sure the PIC flag actually works. -@@ -8446,6 +8950,11 @@ fi +@@ -8488,6 +8991,11 @@ fi@@ -863,7 +864,7 @@ index daa51244369..79d0c4b4623 100755 # # Check to make sure the static flag actually works. # -@@ -8796,7 +9305,8 @@ _LT_EOF +@@ -8838,7 +9346,8 @@ _LT_EOF allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes@@ -873,7 +874,7 @@ index daa51244369..79d0c4b4623 100755 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' -@@ -8895,12 +9405,12 @@ _LT_EOF +@@ -8937,12 +9446,12 @@ _LT_EOF whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir'@@ -888,7 +889,7 @@ index daa51244369..79d0c4b4623 100755 fi ;; esac -@@ -8914,8 +9424,8 @@ _LT_EOF +@@ -8956,8 +9465,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else@@ -899,7 +900,7 @@ index daa51244369..79d0c4b4623 100755 fi ;; -@@ -8933,8 +9443,8 @@ _LT_EOF +@@ -8975,8 +9484,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then@@ -910,7 +911,7 @@ index daa51244369..79d0c4b4623 100755 else ld_shlibs=no fi -@@ -8980,8 +9490,8 @@ _LT_EOF +@@ -9022,8 +9531,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then@@ -921,7 +922,7 @@ index daa51244369..79d0c4b4623 100755 else ld_shlibs=no fi -@@ -9111,7 +9621,13 @@ _LT_EOF +@@ -9153,7 +9662,13 @@ _LT_EOF allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable.@@ -936,7 +937,7 @@ index daa51244369..79d0c4b4623 100755 /* end confdefs.h. */ int -@@ -9124,22 +9640,29 @@ main () +@@ -9166,22 +9681,29 @@ main ()Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch renamed from meta/recipes-devtools/binutils/binutils/0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch +1
-1Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0011-sync-with-OE-libtool-changes.patch renamed from meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch +1
-1Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0012-Check-for-clang-before-checking-gcc-version.patch renamed from meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch +4
-4Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch deleted +0
-234Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils/161e87d12167b1e36193385485c1f6ce92f74f02.patch deleted +0
-246Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Quoted 8 lines
Quoted 8 lines
meta/recipes-devtools/binutils/binutils/161e87d12167b1e36193385485c1f6ce92f74f02.patch deleted +0
-1Lines of this file are not shown. View the raw message.
meta/recipes-devtools/binutils/binutils_2.38.bb renamed from meta/recipes-devtools/binutils/binutils_2.37.bb +0
-1Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
2.35.1
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Part of the diff is not shown here. View the raw message.
Quoted 5 lines · Khem Raj
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>
So far there was a mingw failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/4729
and a qemuppc kernel build issue:
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4688
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2632
The build is:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3220
and the meta-aws issue is known about and not related.
Cheers,
Richard
Quoted 11 lines · Richard Purdie
Quoted 5 lines · Khem Raj
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>So far there was a mingw failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/4729
This seems a race
| i686-w64-mingw32-dlltool: lib32/libd3dcompiler_35.a: error reading D3DCompiler_dll_t.o: No such file or directory
| Assembler messages: | Error: can't open D3DCompiler_dll_h.s for reading: No such file or directory | i686-w64-mingw32-dlltool: i686-w64-mingw32-as exited with status 1 | i686-w64-mingw32-dlltool: failed to open temporary head file:
D3DCompiler_dll_h.o: No such file or directory
| Makefile:82403: recipe for target 'lib32/libd3dcompiler_35.a' failed | make[1]: *** [lib32/libd3dcompiler_35.a] Error 1
Quoted 6 lines
and a qemuppc kernel build issue:
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4688
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2632
this needs a kernel patch backported ( looking towards Bruce to include it)
https://lore.kernel.org/lkml/[email protected]/T/
Quoted 10 lines
The build is:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3220
and the meta-aws issue is known about and not related.
Cheers,
Richard
Quoted 32 lines · Khem Raj
Quoted 11 lines · Richard Purdie
Quoted 5 lines · Khem Raj
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>So far there was a mingw failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/4729
This seems a race
| i686-w64-mingw32-dlltool: lib32/libd3dcompiler_35.a: error reading D3DCompiler_dll_t.o: No such file or directory
| Assembler messages: | Error: can't open D3DCompiler_dll_h.s for reading: No such file or directory | i686-w64-mingw32-dlltool: i686-w64-mingw32-as exited with status 1 | i686-w64-mingw32-dlltool: failed to open temporary head file:D3DCompiler_dll_h.o: No such file or directory
| Makefile:82403: recipe for target 'lib32/libd3dcompiler_35.a' failed | make[1]: *** [lib32/libd3dcompiler_35.a] Error 1Quoted 3 lines
and a qemuppc kernel build issue:
Quoted 7 lines
Quoted 3 lines
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4688
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2632this needs a kernel patch backported ( looking towards Bruce to include it)
I've grabbed this change, and the riscv one, and applied them to 5.10 and 5.15.
The pull request is on the list for the binutils fixes and -stable updates.
Bruce
Quoted 21 lines
Quoted 4 lines
The build is:
Quoted 8 lines
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3220
and the meta-aws issue is known about and not related.
Cheers,
Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161673): https://lists.openembedded.org/g/openembedded-core/message/161673
Mute This Topic: https://lists.openembedded.org/mt/89052445/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 37 lines · Bruce Ashfield
Quoted 36 lines · Khem Raj
Quoted 11 lines · Richard Purdie
Quoted 5 lines · Khem Raj
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>So far there was a mingw failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/4729
This seems a race
Quoted 1 line
i686-w64-mingw32-dlltool: lib32/libd3dcompiler_35.a: error reading
D3DCompiler_dll_t.o: No such file or directory
Quoted 4 lines
Assembler messages:
Error: can't open D3DCompiler_dll_h.s for reading: No such file or directory
i686-w64-mingw32-dlltool: i686-w64-mingw32-as exited with status 1
i686-w64-mingw32-dlltool: failed to open temporary head file:D3DCompiler_dll_h.o: No such file or directory
Quoted 11 lines
Makefile:82403: recipe for target 'lib32/libd3dcompiler_35.a' failed make[1]: *** [lib32/libd3dcompiler_35.a] Error 1
and a qemuppc kernel build issue:
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4688
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2632
Quoted 7 lines
Quoted 3 lines
this needs a kernel patch backported ( looking towards Bruce to include it)
I've grabbed this change, and the riscv one, and applied them to 5.10 and 5.15.
The pull request is on the list for the binutils fixes and -stable updates.
Thanks Bruce. Unfortunately this doesn't seem to fix the qemuppc build issues:
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4691
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2634
Cheers,
Richard
Quoted 43 lines · Richard Purdie
Quoted 41 lines · Bruce Ashfield
Quoted 39 lines · Khem Raj
Quoted 11 lines · Richard Purdie
Quoted 5 lines · Khem Raj
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>So far there was a mingw failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/4729
This seems a race
Quoted 1 line
i686-w64-mingw32-dlltool: lib32/libd3dcompiler_35.a: error reading
D3DCompiler_dll_t.o: No such file or directory
Quoted 4 lines
Assembler messages:
Error: can't open D3DCompiler_dll_h.s for reading: No such file or directory
i686-w64-mingw32-dlltool: i686-w64-mingw32-as exited with status 1
i686-w64-mingw32-dlltool: failed to open temporary head file:D3DCompiler_dll_h.o: No such file or directory
Quoted 11 lines
Makefile:82403: recipe for target 'lib32/libd3dcompiler_35.a' failed make[1]: *** [lib32/libd3dcompiler_35.a] Error 1
and a qemuppc kernel build issue:
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4688
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2632this needs a kernel patch backported ( looking towards Bruce to include it)
Quoted 8 lines
Quoted 3 lines
I've grabbed this change, and the riscv one, and applied them to 5.10 and 5.15.
The pull request is on the list for the binutils fixes and -stable updates.
Thanks Bruce. Unfortunately this doesn't seem to fix the qemuppc build issues:
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4691
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2634
I see a patch from January on lkml with the shortlog: "powerpc/mm:
Switch obsolete dssall to .long", which may be related.
But I'm not setup to see the build issues myself this weekend, but can start looking more closely on Monday.
Bruce
Quoted 6 lines
Cheers,
Richard
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 51 lines · Bruce Ashfield
Quoted 49 lines · Richard Purdie
Quoted 37 lines · Bruce Ashfield
Quoted 36 lines · Khem Raj
Quoted 11 lines · Richard Purdie
Quoted 5 lines · Khem Raj
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>So far there was a mingw failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/4729
This seems a race
Quoted 1 line
i686-w64-mingw32-dlltool: lib32/libd3dcompiler_35.a: error reading
D3DCompiler_dll_t.o: No such file or directory
Quoted 4 lines
Assembler messages:
Error: can't open D3DCompiler_dll_h.s for reading: No such file or directory
i686-w64-mingw32-dlltool: i686-w64-mingw32-as exited with status 1
i686-w64-mingw32-dlltool: failed to open temporary head file:D3DCompiler_dll_h.o: No such file or directory
Quoted 11 lines
Makefile:82403: recipe for target 'lib32/libd3dcompiler_35.a' failed make[1]: *** [lib32/libd3dcompiler_35.a] Error 1
and a qemuppc kernel build issue:
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4688
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2632Quoted 7 lines
Quoted 3 lines
this needs a kernel patch backported ( looking towards Bruce to include it)
I've grabbed this change, and the riscv one, and applied them to 5.10 and 5.15.
The pull request is on the list for the binutils fixes and -stable updates.
Thanks Bruce. Unfortunately this doesn't seem to fix the qemuppc build issues:
Quoted 8 lines
Quoted 2 lines
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4691
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2634I see a patch from January on lkml with the shortlog: "powerpc/mm:
Switch obsolete dssall to .long", which may be related.But I'm not setup to see the build issues myself this weekend, but can start looking more closely on Monday.
FWIW that sounds highly likely. If I get time I'll try and add a patch to the build, see if it helps.
Cheers,
Richard
Quoted 51 lines · Bruce Ashfield
Quoted 49 lines · Richard Purdie
Quoted 37 lines · Bruce Ashfield
Quoted 36 lines · Khem Raj
Quoted 11 lines · Richard Purdie
Quoted 5 lines · Khem Raj
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>So far there was a mingw failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/4729
This seems a race
Quoted 1 line
i686-w64-mingw32-dlltool: lib32/libd3dcompiler_35.a: error reading
D3DCompiler_dll_t.o: No such file or directory
Quoted 4 lines
Assembler messages:
Error: can't open D3DCompiler_dll_h.s for reading: No such file or directory
i686-w64-mingw32-dlltool: i686-w64-mingw32-as exited with status 1
i686-w64-mingw32-dlltool: failed to open temporary head file:D3DCompiler_dll_h.o: No such file or directory
Quoted 11 lines
Makefile:82403: recipe for target 'lib32/libd3dcompiler_35.a' failed make[1]: *** [lib32/libd3dcompiler_35.a] Error 1
and a qemuppc kernel build issue:
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4688
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2632Quoted 7 lines
Quoted 3 lines
this needs a kernel patch backported ( looking towards Bruce to include it)
I've grabbed this change, and the riscv one, and applied them to 5.10 and 5.15.
The pull request is on the list for the binutils fixes and -stable updates.
Thanks Bruce. Unfortunately this doesn't seem to fix the qemuppc build issues:
Quoted 8 lines
Quoted 2 lines
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4691
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2634I see a patch from January on lkml with the shortlog: "powerpc/mm:
Switch obsolete dssall to .long", which may be related.But I'm not setup to see the build issues myself this weekend, but can start looking more closely on Monday.
I can confirm that cherry-picking:
From d51f86cfd8e378d4907958db77da3074f6dce3ba Mon Sep 17 00:00:00 2001
From: Alexey Kardashevskiy <[email protected]>
Date: Tue, 21 Dec 2021 16:59:03 +1100
Subject: powerpc/mm: Switch obsolete dssall to .long
into 5.15 locally did fix my qemuppc build.
Cheers,
Richard
Quoted 62 lines · Richard Purdie
Quoted 51 lines · Bruce Ashfield
Quoted 49 lines · Richard Purdie
Quoted 37 lines · Bruce Ashfield
Quoted 36 lines · Khem Raj
Quoted 11 lines · Richard Purdie
Quoted 5 lines · Khem Raj
Release Notes are here [1]
[1] https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00009.html
Signed-off-by Khem Raj <[email protected]>So far there was a mingw failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/4729
This seems a race
Quoted 1 line
i686-w64-mingw32-dlltool: lib32/libd3dcompiler_35.a: error reading
D3DCompiler_dll_t.o: No such file or directory
Quoted 4 lines
Assembler messages:
Error: can't open D3DCompiler_dll_h.s for reading: No such file or directory
i686-w64-mingw32-dlltool: i686-w64-mingw32-as exited with status 1
i686-w64-mingw32-dlltool: failed to open temporary head file:D3DCompiler_dll_h.o: No such file or directory
Quoted 11 lines
Makefile:82403: recipe for target 'lib32/libd3dcompiler_35.a' failed make[1]: *** [lib32/libd3dcompiler_35.a] Error 1
and a qemuppc kernel build issue:
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4688
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2632Quoted 7 lines
Quoted 3 lines
this needs a kernel patch backported ( looking towards Bruce to include it)
I've grabbed this change, and the riscv one, and applied them to 5.10 and 5.15.
The pull request is on the list for the binutils fixes and -stable updates.
Thanks Bruce. Unfortunately this doesn't seem to fix the qemuppc build issues:
Quoted 8 lines
Quoted 2 lines
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/4691
https://autobuilder.yoctoproject.org/typhoon/#/builders/107/builds/2634I see a patch from January on lkml with the shortlog: "powerpc/mm:
Switch obsolete dssall to .long", which may be related.But I'm not setup to see the build issues myself this weekend, but can start looking more closely on Monday.
Quoted 9 lines
I can confirm that cherry-picking:
From
d51f86cfd8e378d4907958db77da3074f6dce3baMon Sep 17 00:00:00 2001
From: Alexey Kardashevskiy <[email protected]>
Date: Tue, 21 Dec 2021 16:59:03 +1100
Subject: powerpc/mm: Switch obsolete dssall to .longinto 5.15 locally did fix my qemuppc build.
I managed to miss this on the weekend. I've grabbed it for 5.15, and have had to tweak it a bit for 5.10. Once my 5.10 builds are done, I'll send SRCREV updates for linux-yocto.
Bruce
Quoted 5 lines
Cheers,
Richard
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II