From 86c2982568de1ad4d4cc12a65b19231331484405 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 10 Feb 2022 18:00:59 -0800 Subject: Run patches thru `manage-packages -P` This refreshes the line numbers, removes any fuzz (which would make any future forward ports easier) and standardizes the patch/file headers (which makes them easier to read). Signed-off-by: Alexey Neyman --- .../0013-Fix-a-missing-include-of-string.patch | 4 +- .../0012-Fix-a-missing-include-of-string.patch | 4 +- .../0009-Fix-a-missing-include-of-string.patch | 4 +- .../0009-Fix-a-missing-include-of-string.patch | 4 +- .../0009-Fix-a-missing-include-of-string.patch | 4 +- .../0012-Fix-a-missing-include-of-string.patch | 4 +- .../0009-Fix-a-missing-include-of-string.patch | 4 +- packages/binutils/2.33.1/0000-sh-conf.patch | 4 +- .../binutils/2.33.1/0001-ld_makefile_patch.patch | 4 +- .../2.33.1/0002-check_ldrunpath_length.patch | 4 +- ...ads-doesnt-have-pthread_mutexattr_settype.patch | 2 +- ...004-Dont-link-to-libfl-as-its-unnecessary.patch | 18 +- ...Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch | 4 +- packages/binutils/2.33.1/0007-sysroot.patch | 2 +- .../2.33.1/0008-poison-system-directories.patch | 26 +- packages/binutils/2.35.1/0000-sh-conf.patch | 4 +- .../binutils/2.35.1/0001-ld_makefile_patch.patch | 4 +- .../2.35.1/0002-check_ldrunpath_length.patch | 4 +- ...ads-doesnt-have-pthread_mutexattr_settype.patch | 2 +- ...004-Dont-link-to-libfl-as-its-unnecessary.patch | 18 +- ...Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch | 4 +- packages/binutils/2.35.1/0007-sysroot.patch | 2 +- .../2.35.1/0008-poison-system-directories.patch | 26 +- ...h-from-mainline-to-fix-decoding-DWARF-inf.patch | 13 +- ...-wrong-error-message-string-for-mve-vldr-.patch | 23 +- packages/binutils/2.36.1/0000-sh-conf.patch | 4 +- .../binutils/2.36.1/0001-ld_makefile_patch.patch | 4 +- .../2.36.1/0002-check_ldrunpath_length.patch | 4 +- ...ads-doesnt-have-pthread_mutexattr_settype.patch | 2 +- ...004-Dont-link-to-libfl-as-its-unnecessary.patch | 18 +- ...Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch | 4 +- packages/binutils/2.36.1/0007-sysroot.patch | 2 +- .../2.36.1/0008-poison-system-directories.patch | 26 +- .../2.37/0001-check_ldrunpath_length.patch | 24 ++ ...ads-doesnt-have-pthread_mutexattr_settype.patch | 15 ++ .../2.37/0002-check_ldrunpath_length.patch | 24 -- ...003-Dont-link-to-libfl-as-its-unnecessary.patch | 105 ++++++++ ...ads-doesnt-have-pthread_mutexattr_settype.patch | 15 -- ...gold-binary-cc-include-string-not-cstring.patch | 15 ++ ...004-Dont-link-to-libfl-as-its-unnecessary.patch | 105 -------- ...Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch | 70 ++++++ ...gold-binary-cc-include-string-not-cstring.patch | 15 -- ...Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch | 70 ------ packages/binutils/2.37/0006-sysroot.patch | 41 +++ .../2.37/0007-poison-system-directories.patch | 279 +++++++++++++++++++++ packages/binutils/2.37/0007-sysroot.patch | 41 --- ...ential-invalid-pointer-access-when-fixing.patch | 217 ++++++++++++++++ .../2.37/0008-poison-system-directories.patch | 279 --------------------- ...ential-invalid-pointer-access-when-fixing.patch | 217 ---------------- .../2.37/0009-change-uint-to-unsigned.patch | 52 ++++ ...file-descriptor-if-there-is-no-archive-fd.patch | 201 +++++++++++++++ .../2.37/0010-change-uint-to-unsigned.patch | 56 ----- ...file-descriptor-if-there-is-no-archive-fd.patch | 232 ----------------- ...-objcopy-preserve-dates-a-cannot-set-time.patch | 44 ++++ ...x-resource_table-output-section-alignment.patch | 53 ++++ ...-objcopy-preserve-dates-a-cannot-set-time.patch | 51 ---- ...x-resource_table-output-section-alignment.patch | 60 ----- .../0013-pr28422-build_id-use-after-free.patch | 26 ++ .../0014-pr28422-build_id-use-after-free.patch | 31 --- ...0014-pr28459-readelf-issues-bogus-warning.patch | 35 +++ ...ring-no-longer-allows-accepting-nullptr_t.patch | 38 +++ ...0015-pr28459-readelf-issues-bogus-warning.patch | 40 --- ...ring-no-longer-allows-accepting-nullptr_t.patch | 45 ---- ...28540-segmentation-fault-on-NULL-byte_get.patch | 25 ++ ...operty-section-before-other-note-sections.patch | 50 ++++ ...28540-segmentation-fault-on-NULL-byte_get.patch | 30 --- ...operty-section-before-other-note-sections.patch | 57 ----- .../2.37/0018-waddress-warning-in-ldelf.c.patch | 31 +++ .../2.37/0019-waddress-warning-in-ldelf.c.patch | 36 --- 69 files changed, 1438 insertions(+), 1543 deletions(-) create mode 100644 packages/binutils/2.37/0001-check_ldrunpath_length.patch create mode 100644 packages/binutils/2.37/0002-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch delete mode 100644 packages/binutils/2.37/0002-check_ldrunpath_length.patch create mode 100644 packages/binutils/2.37/0003-Dont-link-to-libfl-as-its-unnecessary.patch delete mode 100644 packages/binutils/2.37/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch create mode 100644 packages/binutils/2.37/0004-Darwin-gold-binary-cc-include-string-not-cstring.patch delete mode 100644 packages/binutils/2.37/0004-Dont-link-to-libfl-as-its-unnecessary.patch create mode 100644 packages/binutils/2.37/0005-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch delete mode 100644 packages/binutils/2.37/0005-Darwin-gold-binary-cc-include-string-not-cstring.patch delete mode 100644 packages/binutils/2.37/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch create mode 100644 packages/binutils/2.37/0006-sysroot.patch create mode 100644 packages/binutils/2.37/0007-poison-system-directories.patch delete mode 100644 packages/binutils/2.37/0007-sysroot.patch create mode 100644 packages/binutils/2.37/0008-arc-Fix-potential-invalid-pointer-access-when-fixing.patch delete mode 100644 packages/binutils/2.37/0008-poison-system-directories.patch delete mode 100644 packages/binutils/2.37/0009-arc-Fix-potential-invalid-pointer-access-when-fixing.patch create mode 100644 packages/binutils/2.37/0009-change-uint-to-unsigned.patch create mode 100644 packages/binutils/2.37/0010-bfd-close-the-file-descriptor-if-there-is-no-archive-fd.patch delete mode 100644 packages/binutils/2.37/0010-change-uint-to-unsigned.patch delete mode 100644 packages/binutils/2.37/0011-bfd-close-the-file-descriptor-if-there-is-no-archive-fd.patch create mode 100644 packages/binutils/2.37/0011-pr28391-strip-objcopy-preserve-dates-a-cannot-set-time.patch create mode 100644 packages/binutils/2.37/0012-ld-pru-fix-resource_table-output-section-alignment.patch delete mode 100644 packages/binutils/2.37/0012-pr28391-strip-objcopy-preserve-dates-a-cannot-set-time.patch delete mode 100644 packages/binutils/2.37/0013-ld-pru-fix-resource_table-output-section-alignment.patch create mode 100644 packages/binutils/2.37/0013-pr28422-build_id-use-after-free.patch delete mode 100644 packages/binutils/2.37/0014-pr28422-build_id-use-after-free.patch create mode 100644 packages/binutils/2.37/0014-pr28459-readelf-issues-bogus-warning.patch create mode 100644 packages/binutils/2.37/0015-pr28417-std-string-no-longer-allows-accepting-nullptr_t.patch delete mode 100644 packages/binutils/2.37/0015-pr28459-readelf-issues-bogus-warning.patch delete mode 100644 packages/binutils/2.37/0016-pr28417-std-string-no-longer-allows-accepting-nullptr_t.patch create mode 100644 packages/binutils/2.37/0016-pr28540-segmentation-fault-on-NULL-byte_get.patch create mode 100644 packages/binutils/2.37/0017-gold-place-note-gnu-property-section-before-other-note-sections.patch delete mode 100644 packages/binutils/2.37/0017-pr28540-segmentation-fault-on-NULL-byte_get.patch delete mode 100644 packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch create mode 100644 packages/binutils/2.37/0018-waddress-warning-in-ldelf.c.patch delete mode 100644 packages/binutils/2.37/0019-waddress-warning-in-ldelf.c.patch (limited to 'packages/binutils') diff --git a/packages/binutils/2.26.1/0013-Fix-a-missing-include-of-string.patch b/packages/binutils/2.26.1/0013-Fix-a-missing-include-of-string.patch index b04033a7..8ba0e8de 100644 --- a/packages/binutils/2.26.1/0013-Fix-a-missing-include-of-string.patch +++ b/packages/binutils/2.26.1/0013-Fix-a-missing-include-of-string.patch @@ -9,11 +9,9 @@ gold/ChangeLog: * errors.h: Include string. --- - gold/errors.h | 1 + + gold/errors.h | 1 + 1 file changed, 1 insertion(+) -diff --git a/gold/errors.h b/gold/errors.h -index 1e61c8dbb5..805b25fc9c 100644 --- a/gold/errors.h +++ b/gold/errors.h @@ -24,6 +24,7 @@ diff --git a/packages/binutils/2.27/0012-Fix-a-missing-include-of-string.patch b/packages/binutils/2.27/0012-Fix-a-missing-include-of-string.patch index b04033a7..8ba0e8de 100644 --- a/packages/binutils/2.27/0012-Fix-a-missing-include-of-string.patch +++ b/packages/binutils/2.27/0012-Fix-a-missing-include-of-string.patch @@ -9,11 +9,9 @@ gold/ChangeLog: * errors.h: Include string. --- - gold/errors.h | 1 + + gold/errors.h | 1 + 1 file changed, 1 insertion(+) -diff --git a/gold/errors.h b/gold/errors.h -index 1e61c8dbb5..805b25fc9c 100644 --- a/gold/errors.h +++ b/gold/errors.h @@ -24,6 +24,7 @@ diff --git a/packages/binutils/2.28.1/0009-Fix-a-missing-include-of-string.patch b/packages/binutils/2.28.1/0009-Fix-a-missing-include-of-string.patch index b04033a7..8ba0e8de 100644 --- a/packages/binutils/2.28.1/0009-Fix-a-missing-include-of-string.patch +++ b/packages/binutils/2.28.1/0009-Fix-a-missing-include-of-string.patch @@ -9,11 +9,9 @@ gold/ChangeLog: * errors.h: Include string. --- - gold/errors.h | 1 + + gold/errors.h | 1 + 1 file changed, 1 insertion(+) -diff --git a/gold/errors.h b/gold/errors.h -index 1e61c8dbb5..805b25fc9c 100644 --- a/gold/errors.h +++ b/gold/errors.h @@ -24,6 +24,7 @@ diff --git a/packages/binutils/2.29.1/0009-Fix-a-missing-include-of-string.patch b/packages/binutils/2.29.1/0009-Fix-a-missing-include-of-string.patch index b04033a7..8ba0e8de 100644 --- a/packages/binutils/2.29.1/0009-Fix-a-missing-include-of-string.patch +++ b/packages/binutils/2.29.1/0009-Fix-a-missing-include-of-string.patch @@ -9,11 +9,9 @@ gold/ChangeLog: * errors.h: Include string. --- - gold/errors.h | 1 + + gold/errors.h | 1 + 1 file changed, 1 insertion(+) -diff --git a/gold/errors.h b/gold/errors.h -index 1e61c8dbb5..805b25fc9c 100644 --- a/gold/errors.h +++ b/gold/errors.h @@ -24,6 +24,7 @@ diff --git a/packages/binutils/2.30/0009-Fix-a-missing-include-of-string.patch b/packages/binutils/2.30/0009-Fix-a-missing-include-of-string.patch index b04033a7..8ba0e8de 100644 --- a/packages/binutils/2.30/0009-Fix-a-missing-include-of-string.patch +++ b/packages/binutils/2.30/0009-Fix-a-missing-include-of-string.patch @@ -9,11 +9,9 @@ gold/ChangeLog: * errors.h: Include string. --- - gold/errors.h | 1 + + gold/errors.h | 1 + 1 file changed, 1 insertion(+) -diff --git a/gold/errors.h b/gold/errors.h -index 1e61c8dbb5..805b25fc9c 100644 --- a/gold/errors.h +++ b/gold/errors.h @@ -24,6 +24,7 @@ diff --git a/packages/binutils/2.31.1/0012-Fix-a-missing-include-of-string.patch b/packages/binutils/2.31.1/0012-Fix-a-missing-include-of-string.patch index b04033a7..8ba0e8de 100644 --- a/packages/binutils/2.31.1/0012-Fix-a-missing-include-of-string.patch +++ b/packages/binutils/2.31.1/0012-Fix-a-missing-include-of-string.patch @@ -9,11 +9,9 @@ gold/ChangeLog: * errors.h: Include string. --- - gold/errors.h | 1 + + gold/errors.h | 1 + 1 file changed, 1 insertion(+) -diff --git a/gold/errors.h b/gold/errors.h -index 1e61c8dbb5..805b25fc9c 100644 --- a/gold/errors.h +++ b/gold/errors.h @@ -24,6 +24,7 @@ diff --git a/packages/binutils/2.32/0009-Fix-a-missing-include-of-string.patch b/packages/binutils/2.32/0009-Fix-a-missing-include-of-string.patch index b04033a7..8ba0e8de 100644 --- a/packages/binutils/2.32/0009-Fix-a-missing-include-of-string.patch +++ b/packages/binutils/2.32/0009-Fix-a-missing-include-of-string.patch @@ -9,11 +9,9 @@ gold/ChangeLog: * errors.h: Include string. --- - gold/errors.h | 1 + + gold/errors.h | 1 + 1 file changed, 1 insertion(+) -diff --git a/gold/errors.h b/gold/errors.h -index 1e61c8dbb5..805b25fc9c 100644 --- a/gold/errors.h +++ b/gold/errors.h @@ -24,6 +24,7 @@ diff --git a/packages/binutils/2.33.1/0000-sh-conf.patch b/packages/binutils/2.33.1/0000-sh-conf.patch index f6362898..ecd28af4 100644 --- a/packages/binutils/2.33.1/0000-sh-conf.patch +++ b/packages/binutils/2.33.1/0000-sh-conf.patch @@ -12,7 +12,7 @@ inept targets than that one, really. Go look, I promise). --- a/configure +++ b/configure -@@ -3865,7 +3865,7 @@ case "${target}" in +@@ -3865,7 +3865,7 @@ nvptx*-*-*) noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" ;; @@ -23,7 +23,7 @@ inept targets than that one, really. Go look, I promise). ;; --- a/configure.ac +++ b/configure.ac -@@ -1158,7 +1158,7 @@ case "${target}" in +@@ -1158,7 +1158,7 @@ nvptx*-*-*) noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" ;; diff --git a/packages/binutils/2.33.1/0001-ld_makefile_patch.patch b/packages/binutils/2.33.1/0001-ld_makefile_patch.patch index e76207e6..f73ff26d 100644 --- a/packages/binutils/2.33.1/0001-ld_makefile_patch.patch +++ b/packages/binutils/2.33.1/0001-ld_makefile_patch.patch @@ -5,7 +5,7 @@ --- a/ld/Makefile.am +++ b/ld/Makefile.am -@@ -57,7 +57,7 @@ endif +@@ -57,7 +57,7 @@ # 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. @@ -16,7 +16,7 @@ EMULATION_OFILES = @EMULATION_OFILES@ --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -563,7 +563,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -563,7 +563,7 @@ # 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. diff --git a/packages/binutils/2.33.1/0002-check_ldrunpath_length.patch b/packages/binutils/2.33.1/0002-check_ldrunpath_length.patch index 131c6bf3..95730af8 100644 --- a/packages/binutils/2.33.1/0002-check_ldrunpath_length.patch +++ b/packages/binutils/2.33.1/0002-check_ldrunpath_length.patch @@ -4,7 +4,7 @@ --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em -@@ -1470,6 +1470,8 @@ fragment <&5 --- a/ld/configure.ac +++ b/ld/configure.ac -@@ -243,7 +243,10 @@ AM_PO_SUBDIRS +@@ -243,7 +243,10 @@ AC_EXEEXT AC_PROG_YACC diff --git a/packages/binutils/2.33.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch b/packages/binutils/2.33.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch index 0537aa42..2b32b9ae 100644 --- a/packages/binutils/2.33.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch +++ b/packages/binutils/2.33.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch @@ -15,7 +15,7 @@ Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c -@@ -3623,6 +3623,28 @@ u16_mbtouc (wchar_t * puc, const unsigne +@@ -3623,6 +3623,28 @@ } #endif /* HAVE_WCHAR_H and not Cygwin/Mingw */ @@ -46,7 +46,7 @@ Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b) --- a/gold/gold-threads.cc +++ b/gold/gold-threads.cc -@@ -284,9 +284,18 @@ Condvar::~Condvar() +@@ -284,9 +284,18 @@ class Once_initialize { public: diff --git a/packages/binutils/2.33.1/0007-sysroot.patch b/packages/binutils/2.33.1/0007-sysroot.patch index bcf6f346..ba7940a4 100644 --- a/packages/binutils/2.33.1/0007-sysroot.patch +++ b/packages/binutils/2.33.1/0007-sysroot.patch @@ -11,7 +11,7 @@ http://sourceware.org/bugzilla/show_bug.cgi?id=10340 --- a/ld/ldfile.c +++ b/ld/ldfile.c -@@ -338,18 +338,25 @@ ldfile_open_file_search (const char *arc +@@ -338,18 +338,25 @@ directory first. */ if (!entry->flags.maybe_archive) { diff --git a/packages/binutils/2.33.1/0008-poison-system-directories.patch b/packages/binutils/2.33.1/0008-poison-system-directories.patch index 907036c9..461c8df1 100644 --- a/packages/binutils/2.33.1/0008-poison-system-directories.patch +++ b/packages/binutils/2.33.1/0008-poison-system-directories.patch @@ -85,7 +85,7 @@ Signed-off-by: Scott Garman --- a/ld/configure +++ b/ld/configure -@@ -823,6 +823,7 @@ with_lib_path +@@ -823,6 +823,7 @@ enable_targets enable_64_bit_bfd with_sysroot @@ -93,7 +93,7 @@ Signed-off-by: Scott Garman enable_gold enable_got enable_compressed_debug_sections -@@ -1487,6 +1488,8 @@ Optional Features: +@@ -1487,6 +1488,8 @@ --disable-largefile omit support for large files --enable-targets alternative target configurations --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) @@ -102,7 +102,7 @@ Signed-off-by: Scott Garman --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-got= GOT handling scheme (target, single, negative, multigot) -@@ -15804,7 +15807,18 @@ else +@@ -15804,7 +15807,18 @@ fi @@ -123,7 +123,7 @@ Signed-off-by: Scott Garman if test "${enable_got+set}" = set; then : --- a/ld/configure.ac +++ b/ld/configure.ac -@@ -94,6 +94,16 @@ AC_SUBST(use_sysroot) +@@ -94,6 +94,16 @@ AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) @@ -142,7 +142,7 @@ Signed-off-by: Scott Garman dnl "installed_linker" is the installed BFD linker name. --- a/ld/ld.h +++ b/ld/ld.h -@@ -175,6 +175,14 @@ typedef struct +@@ -175,6 +175,14 @@ /* If set, display the target memory usage (per memory region). */ bfd_boolean print_memory_usage; @@ -159,7 +159,7 @@ Signed-off-by: Scott Garman in the linker script. */ --- a/ld/ld.texi +++ b/ld/ld.texi -@@ -2557,6 +2557,18 @@ string identifying the original linked f +@@ -2557,6 +2557,18 @@ Passing @code{none} for @var{style} disables the setting from any @code{--build-id} options earlier on the command line. @@ -180,7 +180,7 @@ Signed-off-by: Scott Garman @c man end --- a/ld/ldfile.c +++ b/ld/ldfile.c -@@ -116,6 +116,23 @@ ldfile_add_library_path (const char *nam +@@ -116,6 +116,23 @@ new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); else new_dirs->name = xstrdup (name); @@ -206,7 +206,7 @@ Signed-off-by: Scott Garman /* Try to open a BFD for a lang_input_statement. */ --- a/ld/ldlex.h +++ b/ld/ldlex.h -@@ -150,6 +150,8 @@ enum option_values +@@ -150,6 +150,8 @@ OPTION_FORCE_GROUP_ALLOCATION, OPTION_PRINT_MAP_DISCARDED, OPTION_NO_PRINT_MAP_DISCARDED, @@ -217,7 +217,7 @@ Signed-off-by: Scott Garman /* The initial parser states. */ --- a/ld/ldmain.c +++ b/ld/ldmain.c -@@ -270,6 +270,8 @@ main (int argc, char **argv) +@@ -270,6 +270,8 @@ command_line.warn_mismatch = TRUE; command_line.warn_search_mismatch = TRUE; command_line.check_section_addresses = -1; @@ -228,7 +228,7 @@ Signed-off-by: Scott Garman COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the --- a/ld/lexsup.c +++ b/ld/lexsup.c -@@ -549,6 +549,14 @@ static const struct ld_option ld_options +@@ -549,6 +549,14 @@ { {"no-print-map-discarded", no_argument, NULL, OPTION_NO_PRINT_MAP_DISCARDED}, '\0', NULL, N_("Do not show discarded sections in map file output"), TWO_DASHES }, @@ -243,7 +243,7 @@ Signed-off-by: Scott Garman }; #define OPTION_COUNT ARRAY_SIZE (ld_options) -@@ -561,6 +569,7 @@ parse_args (unsigned argc, char **argv) +@@ -561,6 +569,7 @@ int ingroup = 0; char *default_dirlist = NULL; char *shortopts; @@ -251,7 +251,7 @@ Signed-off-by: Scott Garman struct option *longopts; struct option *really_longopts; int last_optind; -@@ -1549,6 +1558,14 @@ parse_args (unsigned argc, char **argv) +@@ -1549,6 +1558,14 @@ } break; @@ -266,7 +266,7 @@ Signed-off-by: Scott Garman case OPTION_PUSH_STATE: input_flags.pushed = xmemdup (&input_flags, sizeof (input_flags), -@@ -1600,6 +1617,10 @@ parse_args (unsigned argc, char **argv) +@@ -1600,6 +1617,10 @@ command_line.soname = NULL; } diff --git a/packages/binutils/2.35.1/0000-sh-conf.patch b/packages/binutils/2.35.1/0000-sh-conf.patch index 06693efc..b7e07d9d 100644 --- a/packages/binutils/2.35.1/0000-sh-conf.patch +++ b/packages/binutils/2.35.1/0000-sh-conf.patch @@ -12,7 +12,7 @@ inept targets than that one, really. Go look, I promise). --- a/configure +++ b/configure -@@ -3937,7 +3937,7 @@ case "${target}" in +@@ -3937,7 +3937,7 @@ nvptx*-*-*) noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" ;; @@ -23,7 +23,7 @@ inept targets than that one, really. Go look, I promise). ;; --- a/configure.ac +++ b/configure.ac -@@ -1178,7 +1178,7 @@ case "${target}" in +@@ -1178,7 +1178,7 @@ nvptx*-*-*) noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" ;; diff --git a/packages/binutils/2.35.1/0001-ld_makefile_patch.patch b/packages/binutils/2.35.1/0001-ld_makefile_patch.patch index 0eb94962..5a64fb9c 100644 --- a/packages/binutils/2.35.1/0001-ld_makefile_patch.patch +++ b/packages/binutils/2.35.1/0001-ld_makefile_patch.patch @@ -5,7 +5,7 @@ --- a/ld/Makefile.am +++ b/ld/Makefile.am -@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -50,7 +50,7 @@ # 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. @@ -16,7 +16,7 @@ EMULATION_OFILES = @EMULATION_OFILES@ --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -555,7 +555,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -555,7 +555,7 @@ # 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. diff --git a/packages/binutils/2.35.1/0002-check_ldrunpath_length.patch b/packages/binutils/2.35.1/0002-check_ldrunpath_length.patch index 0edd2fe3..407b48cd 100644 --- a/packages/binutils/2.35.1/0002-check_ldrunpath_length.patch +++ b/packages/binutils/2.35.1/0002-check_ldrunpath_length.patch @@ -4,7 +4,7 @@ --- a/ld/ldelf.c +++ b/ld/ldelf.c -@@ -1247,6 +1247,8 @@ ldelf_after_open (int use_libpath, int n +@@ -1247,6 +1247,8 @@ && command_line.rpath == NULL) { path = (const char *) getenv ("LD_RUN_PATH"); @@ -13,7 +13,7 @@ if (path && ldelf_search_needed (path, &n, force, is_linux, elfsize)) -@@ -1605,6 +1607,8 @@ ldelf_before_allocation (char *audit, ch +@@ -1605,6 +1607,8 @@ rpath = command_line.rpath; if (rpath == NULL) rpath = (const char *) getenv ("LD_RUN_PATH"); diff --git a/packages/binutils/2.35.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch b/packages/binutils/2.35.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch index c712df5d..99dee969 100644 --- a/packages/binutils/2.35.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch +++ b/packages/binutils/2.35.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch @@ -4,7 +4,7 @@ --- a/gold/gold-threads.cc +++ b/gold/gold-threads.cc -@@ -101,7 +101,7 @@ Lock_impl_threads::Lock_impl_threads() +@@ -101,7 +101,7 @@ int err = pthread_mutexattr_init(&attr); if (err != 0) gold_fatal(_("pthead_mutexattr_init failed: %s"), strerror(err)); diff --git a/packages/binutils/2.35.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch b/packages/binutils/2.35.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch index 02efa21c..fd6b203e 100644 --- a/packages/binutils/2.35.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch +++ b/packages/binutils/2.35.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch @@ -9,7 +9,7 @@ --- a/binutils/configure +++ b/binutils/configure -@@ -12570,6 +12570,7 @@ fi +@@ -12570,6 +12570,7 @@ done test -n "$YACC" || YACC="yacc" @@ -17,7 +17,7 @@ for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -12733,6 +12734,8 @@ esac +@@ -12733,6 +12734,8 @@ if test "$LEX" = :; then LEX=${am_missing_run}flex fi @@ -28,7 +28,7 @@ # If we haven't got the data from the intl directory, --- a/binutils/configure.ac +++ b/binutils/configure.ac -@@ -95,7 +95,10 @@ if test -z "$host" ; then +@@ -95,7 +95,10 @@ fi AC_PROG_YACC @@ -41,7 +41,7 @@ ZW_GNU_GETTEXT_SISTER_DIR --- a/gas/configure +++ b/gas/configure -@@ -13519,6 +13519,7 @@ fi +@@ -13519,6 +13519,7 @@ done test -n "$YACC" || YACC="yacc" @@ -49,7 +49,7 @@ for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -13682,6 +13683,8 @@ esac +@@ -13682,6 +13683,8 @@ if test "$LEX" = :; then LEX=${am_missing_run}flex fi @@ -60,7 +60,7 @@ # If we haven't got the data from the intl directory, --- a/gas/configure.ac +++ b/gas/configure.ac -@@ -924,7 +924,10 @@ AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${tar +@@ -924,7 +924,10 @@ AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.]) AC_PROG_YACC @@ -73,7 +73,7 @@ ZW_GNU_GETTEXT_SISTER_DIR --- a/ld/configure +++ b/ld/configure -@@ -16584,6 +16584,7 @@ fi +@@ -16584,6 +16584,7 @@ done test -n "$YACC" || YACC="yacc" @@ -81,7 +81,7 @@ for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -16747,6 +16748,8 @@ esac +@@ -16747,6 +16748,8 @@ if test "$LEX" = :; then LEX=${am_missing_run}flex fi @@ -92,7 +92,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 --- a/ld/configure.ac +++ b/ld/configure.ac -@@ -258,7 +258,10 @@ AM_PO_SUBDIRS +@@ -258,7 +258,10 @@ AC_EXEEXT AC_PROG_YACC diff --git a/packages/binutils/2.35.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch b/packages/binutils/2.35.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch index 631d0135..6f2d1e1c 100644 --- a/packages/binutils/2.35.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch +++ b/packages/binutils/2.35.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch @@ -15,7 +15,7 @@ Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c -@@ -3696,6 +3696,28 @@ u16_mbtouc (wchar_t * puc, const unsigne +@@ -3696,6 +3696,28 @@ } #endif /* HAVE_WCHAR_H and not Cygwin/Mingw */ @@ -46,7 +46,7 @@ Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b) --- a/gold/gold-threads.cc +++ b/gold/gold-threads.cc -@@ -284,9 +284,18 @@ Condvar::~Condvar() +@@ -284,9 +284,18 @@ class Once_initialize { public: diff --git a/packages/binutils/2.35.1/0007-sysroot.patch b/packages/binutils/2.35.1/0007-sysroot.patch index c98f1476..0140fe8c 100644 --- a/packages/binutils/2.35.1/0007-sysroot.patch +++ b/packages/binutils/2.35.1/0007-sysroot.patch @@ -11,7 +11,7 @@ http://sourceware.org/bugzilla/show_bug.cgi?id=10340 --- a/ld/ldfile.c +++ b/ld/ldfile.c -@@ -340,18 +340,25 @@ ldfile_open_file_search (const char *arc +@@ -340,18 +340,25 @@ directory first. */ if (!entry->flags.maybe_archive) { diff --git a/packages/binutils/2.35.1/0008-poison-system-directories.patch b/packages/binutils/2.35.1/0008-poison-system-directories.patch index d836f8af..970a7a1c 100644 --- a/packages/binutils/2.35.1/0008-poison-system-directories.patch +++ b/packages/binutils/2.35.1/0008-poison-system-directories.patch @@ -85,7 +85,7 @@ Signed-off-by: Scott Garman --- a/ld/configure +++ b/ld/configure -@@ -826,6 +826,7 @@ with_lib_path +@@ -826,6 +826,7 @@ enable_targets enable_64_bit_bfd with_sysroot @@ -93,7 +93,7 @@ Signed-off-by: Scott Garman enable_gold enable_got enable_compressed_debug_sections -@@ -1493,6 +1494,8 @@ Optional Features: +@@ -1493,6 +1494,8 @@ --disable-largefile omit support for large files --enable-targets alternative target configurations --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) @@ -102,7 +102,7 @@ Signed-off-by: Scott Garman --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-got= GOT handling scheme (target, single, negative, multigot) -@@ -15814,7 +15817,18 @@ else +@@ -15814,7 +15817,18 @@ fi @@ -123,7 +123,7 @@ Signed-off-by: Scott Garman if test "${enable_got+set}" = set; then : --- a/ld/configure.ac +++ b/ld/configure.ac -@@ -94,6 +94,16 @@ AC_SUBST(use_sysroot) +@@ -94,6 +94,16 @@ AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) @@ -142,7 +142,7 @@ Signed-off-by: Scott Garman dnl "installed_linker" is the installed BFD linker name. --- a/ld/ld.h +++ b/ld/ld.h -@@ -161,6 +161,14 @@ typedef struct +@@ -161,6 +161,14 @@ /* If set, display the target memory usage (per memory region). */ bfd_boolean print_memory_usage; @@ -159,7 +159,7 @@ Signed-off-by: Scott Garman in the linker script. */ --- a/ld/ld.texi +++ b/ld/ld.texi -@@ -2655,6 +2655,18 @@ string identifying the original linked f +@@ -2655,6 +2655,18 @@ Passing @code{none} for @var{style} disables the setting from any @code{--build-id} options earlier on the command line. @@ -180,7 +180,7 @@ Signed-off-by: Scott Garman @c man end --- a/ld/ldfile.c +++ b/ld/ldfile.c -@@ -117,6 +117,23 @@ ldfile_add_library_path (const char *nam +@@ -117,6 +117,23 @@ new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); else new_dirs->name = xstrdup (name); @@ -206,7 +206,7 @@ Signed-off-by: Scott Garman /* Try to open a BFD for a lang_input_statement. */ --- a/ld/ldlex.h +++ b/ld/ldlex.h -@@ -155,6 +155,8 @@ enum option_values +@@ -155,6 +155,8 @@ OPTION_NON_CONTIGUOUS_REGIONS, OPTION_NON_CONTIGUOUS_REGIONS_WARNINGS, OPTION_DEPENDENCY_FILE, @@ -217,7 +217,7 @@ Signed-off-by: Scott Garman /* The initial parser states. */ --- a/ld/ldmain.c +++ b/ld/ldmain.c -@@ -321,6 +321,8 @@ main (int argc, char **argv) +@@ -321,6 +321,8 @@ command_line.warn_mismatch = TRUE; command_line.warn_search_mismatch = TRUE; command_line.check_section_addresses = -1; @@ -228,7 +228,7 @@ Signed-off-by: Scott Garman COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the --- a/ld/lexsup.c +++ b/ld/lexsup.c -@@ -572,6 +572,14 @@ static const struct ld_option ld_options +@@ -572,6 +572,14 @@ { {"no-print-map-discarded", no_argument, NULL, OPTION_NO_PRINT_MAP_DISCARDED}, '\0', NULL, N_("Do not show discarded sections in map file output"), TWO_DASHES }, @@ -243,7 +243,7 @@ Signed-off-by: Scott Garman }; #define OPTION_COUNT ARRAY_SIZE (ld_options) -@@ -584,6 +592,7 @@ parse_args (unsigned argc, char **argv) +@@ -584,6 +592,7 @@ int ingroup = 0; char *default_dirlist = NULL; char *shortopts; @@ -251,7 +251,7 @@ Signed-off-by: Scott Garman struct option *longopts; struct option *really_longopts; int last_optind; -@@ -1591,6 +1600,14 @@ parse_args (unsigned argc, char **argv) +@@ -1591,6 +1600,14 @@ } break; @@ -266,7 +266,7 @@ Signed-off-by: Scott Garman case OPTION_PUSH_STATE: input_flags.pushed = xmemdup (&input_flags, sizeof (input_flags), -@@ -1681,6 +1698,10 @@ parse_args (unsigned argc, char **argv) +@@ -1681,6 +1698,10 @@ command_line.soname = NULL; } diff --git a/packages/binutils/2.35.1/0009-Import-patch-from-mainline-to-fix-decoding-DWARF-inf.patch b/packages/binutils/2.35.1/0009-Import-patch-from-mainline-to-fix-decoding-DWARF-inf.patch index b6b44965..674347f3 100644 --- a/packages/binutils/2.35.1/0009-Import-patch-from-mainline-to-fix-decoding-DWARF-inf.patch +++ b/packages/binutils/2.35.1/0009-Import-patch-from-mainline-to-fix-decoding-DWARF-inf.patch @@ -8,11 +8,13 @@ Subject: [PATCH] Import patch from mainline to fix decoding DWARF information * dwarf2.c (scan_unit_for_symbols): Add member entries to the variable table. --- -diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c -index b8f0008a10d..977bf43a6a1 100644 +--- + bfd/dwarf2.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c -@@ -3404,7 +3404,8 @@ scan_unit_for_symbols (struct comp_unit *unit) +@@ -3404,7 +3404,8 @@ else { func = NULL; @@ -22,7 +24,7 @@ index b8f0008a10d..977bf43a6a1 100644 { size_t amt = sizeof (struct varinfo); var = (struct varinfo *) bfd_zalloc (abfd, amt); -@@ -3516,7 +3517,7 @@ scan_unit_for_symbols (struct comp_unit *unit) +@@ -3516,7 +3517,7 @@ spec_var = lookup_var_by_offset (attr.u.val, unit->variable_table); if (spec_var == NULL) @@ -31,6 +33,3 @@ index b8f0008a10d..977bf43a6a1 100644 _bfd_error_handler (_("DWARF error: could not find " "variable specification " "at offset %lx"), --- -2.25.4 - diff --git a/packages/binutils/2.35.1/0010-arm-Fix-the-wrong-error-message-string-for-mve-vldr-.patch b/packages/binutils/2.35.1/0010-arm-Fix-the-wrong-error-message-string-for-mve-vldr-.patch index 9ea369ac..72763578 100644 --- a/packages/binutils/2.35.1/0010-arm-Fix-the-wrong-error-message-string-for-mve-vldr-.patch +++ b/packages/binutils/2.35.1/0010-arm-Fix-the-wrong-error-message-string-for-mve-vldr-.patch @@ -36,11 +36,16 @@ gas/ChangeLog: * testsuite/gas/arm/mve-vldr-vstr-bad.l: Likewise. * testsuite/gas/arm/mve-vldr-vstr-bad.s: Likewise. --- -diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c -index a9aaffa3bdd..64475d66729 100644 +--- + gas/config/tc-arm.c | 10 + gas/testsuite/gas/arm/mve-vldr-vstr-bad.d | 5 + gas/testsuite/gas/arm/mve-vldr-vstr-bad.l | 811 ++++++++++++++++++++++++++++++ + gas/testsuite/gas/arm/mve-vldr-vstr-bad.s | 30 + + 4 files changed, 855 insertions(+), 1 deletion(-) + --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c -@@ -5936,7 +5936,15 @@ parse_address_main (char **str, int i, int group_relocations, +@@ -5936,7 +5936,15 @@ if (skip_past_char (&p, '[') == FAIL) { @@ -57,9 +62,6 @@ index a9aaffa3bdd..64475d66729 100644 { /* Bare address - translate to PC-relative offset. */ inst.relocs[0].pc_rel = 1; -diff --git a/gas/testsuite/gas/arm/mve-vldr-vstr-bad.d b/gas/testsuite/gas/arm/mve-vldr-vstr-bad.d -new file mode 100644 -index 00000000000..8989688f0f3 --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vldr-vstr-bad.d @@ -0,0 +1,5 @@ @@ -68,9 +70,6 @@ index 00000000000..8989688f0f3 +#error_output: mve-vldr-vstr-bad.l + +.*: +file format .*arm.* -diff --git a/gas/testsuite/gas/arm/mve-vldr-vstr-bad.l b/gas/testsuite/gas/arm/mve-vldr-vstr-bad.l -new file mode 100644 -index 00000000000..2df3a37ac02 --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vldr-vstr-bad.l @@ -0,0 +1,811 @@ @@ -885,9 +884,6 @@ index 00000000000..2df3a37ac02 +[^:]*:30: Error: syntax error -- `vldrw.s32 q7,r14' +[^:]*:30: Error: syntax error -- `vldrw.u32 q7,r14' +[^:]*:30: Error: syntax error -- `vstrw.32 q7,r14' -diff --git a/gas/testsuite/gas/arm/mve-vldr-vstr-bad.s b/gas/testsuite/gas/arm/mve-vldr-vstr-bad.s -new file mode 100644 -index 00000000000..c72c1296d2f --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vldr-vstr-bad.s @@ -0,0 +1,30 @@ @@ -921,6 +917,3 @@ index 00000000000..c72c1296d2f +vstrw.32 \op2, \op3 +.endr +.endr --- -2.25.4 - diff --git a/packages/binutils/2.36.1/0000-sh-conf.patch b/packages/binutils/2.36.1/0000-sh-conf.patch index 83d40a08..39a56e1f 100644 --- a/packages/binutils/2.36.1/0000-sh-conf.patch +++ b/packages/binutils/2.36.1/0000-sh-conf.patch @@ -12,7 +12,7 @@ inept targets than that one, really. Go look, I promise). --- a/configure +++ b/configure -@@ -3887,7 +3887,7 @@ case "${target}" in +@@ -3887,7 +3887,7 @@ nvptx*-*-*) noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" ;; @@ -23,7 +23,7 @@ inept targets than that one, really. Go look, I promise). ;; --- a/configure.ac +++ b/configure.ac -@@ -1177,7 +1177,7 @@ case "${target}" in +@@ -1177,7 +1177,7 @@ nvptx*-*-*) noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" ;; diff --git a/packages/binutils/2.36.1/0001-ld_makefile_patch.patch b/packages/binutils/2.36.1/0001-ld_makefile_patch.patch index 1c03d024..7c49085a 100644 --- a/packages/binutils/2.36.1/0001-ld_makefile_patch.patch +++ b/packages/binutils/2.36.1/0001-ld_makefile_patch.patch @@ -5,7 +5,7 @@ --- a/ld/Makefile.am +++ b/ld/Makefile.am -@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -50,7 +50,7 @@ # 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. @@ -16,7 +16,7 @@ EMULATION_OFILES = @EMULATION_OFILES@ --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -561,7 +561,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -561,7 +561,7 @@ # 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. diff --git a/packages/binutils/2.36.1/0002-check_ldrunpath_length.patch b/packages/binutils/2.36.1/0002-check_ldrunpath_length.patch index d54e6564..bf30ca9e 100644 --- a/packages/binutils/2.36.1/0002-check_ldrunpath_length.patch +++ b/packages/binutils/2.36.1/0002-check_ldrunpath_length.patch @@ -4,7 +4,7 @@ --- a/ld/ldelf.c +++ b/ld/ldelf.c -@@ -1248,6 +1248,8 @@ ldelf_after_open (int use_libpath, int n +@@ -1248,6 +1248,8 @@ && command_line.rpath == NULL) { path = (const char *) getenv ("LD_RUN_PATH"); @@ -13,7 +13,7 @@ if (path && ldelf_search_needed (path, &n, force, is_linux, elfsize)) -@@ -1608,6 +1610,8 @@ ldelf_before_allocation (char *audit, ch +@@ -1608,6 +1610,8 @@ rpath = command_line.rpath; if (rpath == NULL) rpath = (const char *) getenv ("LD_RUN_PATH"); diff --git a/packages/binutils/2.36.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch b/packages/binutils/2.36.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch index c712df5d..99dee969 100644 --- a/packages/binutils/2.36.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch +++ b/packages/binutils/2.36.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch @@ -4,7 +4,7 @@ --- a/gold/gold-threads.cc +++ b/gold/gold-threads.cc -@@ -101,7 +101,7 @@ Lock_impl_threads::Lock_impl_threads() +@@ -101,7 +101,7 @@ int err = pthread_mutexattr_init(&attr); if (err != 0) gold_fatal(_("pthead_mutexattr_init failed: %s"), strerror(err)); diff --git a/packages/binutils/2.36.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch b/packages/binutils/2.36.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch index 53324266..67bac1fa 100644 --- a/packages/binutils/2.36.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch +++ b/packages/binutils/2.36.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch @@ -9,7 +9,7 @@ --- a/binutils/configure +++ b/binutils/configure -@@ -12811,6 +12811,7 @@ fi +@@ -12811,6 +12811,7 @@ done test -n "$YACC" || YACC="yacc" @@ -17,7 +17,7 @@ for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -12974,6 +12975,8 @@ esac +@@ -12974,6 +12975,8 @@ if test "$LEX" = :; then LEX=${am_missing_run}flex fi @@ -28,7 +28,7 @@ # If we haven't got the data from the intl directory, --- a/binutils/configure.ac +++ b/binutils/configure.ac -@@ -110,7 +110,10 @@ if test -z "$host" ; then +@@ -110,7 +110,10 @@ fi AC_PROG_YACC @@ -41,7 +41,7 @@ ZW_GNU_GETTEXT_SISTER_DIR --- a/gas/configure +++ b/gas/configure -@@ -13558,6 +13558,7 @@ fi +@@ -13558,6 +13558,7 @@ done test -n "$YACC" || YACC="yacc" @@ -49,7 +49,7 @@ for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -13721,6 +13722,8 @@ esac +@@ -13721,6 +13722,8 @@ if test "$LEX" = :; then LEX=${am_missing_run}flex fi @@ -60,7 +60,7 @@ # If we haven't got the data from the intl directory, --- a/gas/configure.ac +++ b/gas/configure.ac -@@ -931,7 +931,10 @@ AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${tar +@@ -931,7 +931,10 @@ AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.]) AC_PROG_YACC @@ -73,7 +73,7 @@ ZW_GNU_GETTEXT_SISTER_DIR --- a/ld/configure +++ b/ld/configure -@@ -16623,6 +16623,7 @@ fi +@@ -16623,6 +16623,7 @@ done test -n "$YACC" || YACC="yacc" @@ -81,7 +81,7 @@ for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -16786,6 +16787,8 @@ esac +@@ -16786,6 +16787,8 @@ if test "$LEX" = :; then LEX=${am_missing_run}flex fi @@ -92,7 +92,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 --- a/ld/configure.ac +++ b/ld/configure.ac -@@ -269,7 +269,10 @@ AM_PO_SUBDIRS +@@ -269,7 +269,10 @@ AC_EXEEXT AC_PROG_YACC diff --git a/packages/binutils/2.36.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch b/packages/binutils/2.36.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch index 87d047c4..6d869007 100644 --- a/packages/binutils/2.36.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch +++ b/packages/binutils/2.36.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch @@ -15,7 +15,7 @@ Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c -@@ -3589,6 +3589,28 @@ u16_mbtouc (wchar_t * puc, const unsigne +@@ -3589,6 +3589,28 @@ } #endif /* HAVE_WCHAR_H and not Cygwin/Mingw */ @@ -46,7 +46,7 @@ Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b) --- a/gold/gold-threads.cc +++ b/gold/gold-threads.cc -@@ -284,9 +284,18 @@ Condvar::~Condvar() +@@ -284,9 +284,18 @@ class Once_initialize { public: diff --git a/packages/binutils/2.36.1/0007-sysroot.patch b/packages/binutils/2.36.1/0007-sysroot.patch index c98f1476..0140fe8c 100644 --- a/packages/binutils/2.36.1/0007-sysroot.patch +++ b/packages/binutils/2.36.1/0007-sysroot.patch @@ -11,7 +11,7 @@ http://sourceware.org/bugzilla/show_bug.cgi?id=10340 --- a/ld/ldfile.c +++ b/ld/ldfile.c -@@ -340,18 +340,25 @@ ldfile_open_file_search (const char *arc +@@ -340,18 +340,25 @@ directory first. */ if (!entry->flags.maybe_archive) { diff --git a/packages/binutils/2.36.1/0008-poison-system-directories.patch b/packages/binutils/2.36.1/0008-poison-system-directories.patch index 126e99c4..545a1a39 100644 --- a/packages/binutils/2.36.1/0008-poison-system-directories.patch +++ b/packages/binutils/2.36.1/0008-poison-system-directories.patch @@ -85,7 +85,7 @@ Signed-off-by: Scott Garman --- a/ld/configure +++ b/ld/configure -@@ -828,6 +828,7 @@ with_lib_path +@@ -828,6 +828,7 @@ enable_targets enable_64_bit_bfd with_sysroot @@ -93,7 +93,7 @@ Signed-off-by: Scott Garman enable_gold enable_got enable_compressed_debug_sections -@@ -1496,6 +1497,8 @@ Optional Features: +@@ -1496,6 +1497,8 @@ --disable-largefile omit support for large files --enable-targets alternative target configurations --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) @@ -102,7 +102,7 @@ Signed-off-by: Scott Garman --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-got= GOT handling scheme (target, single, negative, multigot) -@@ -15841,7 +15844,18 @@ else +@@ -15841,7 +15844,18 @@ fi @@ -123,7 +123,7 @@ Signed-off-by: Scott Garman if test "${enable_got+set}" = set; then : --- a/ld/configure.ac +++ b/ld/configure.ac -@@ -94,6 +94,16 @@ AC_SUBST(use_sysroot) +@@ -94,6 +94,16 @@ AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) @@ -142,7 +142,7 @@ Signed-off-by: Scott Garman dnl "installed_linker" is the installed BFD linker name. --- a/ld/ld.h +++ b/ld/ld.h -@@ -161,6 +161,14 @@ typedef struct +@@ -161,6 +161,14 @@ /* If set, display the target memory usage (per memory region). */ bfd_boolean print_memory_usage; @@ -159,7 +159,7 @@ Signed-off-by: Scott Garman in the linker script. */ --- a/ld/ld.texi +++ b/ld/ld.texi -@@ -2810,6 +2810,18 @@ string identifying the original linked f +@@ -2810,6 +2810,18 @@ Passing @code{none} for @var{style} disables the setting from any @code{--build-id} options earlier on the command line. @@ -180,7 +180,7 @@ Signed-off-by: Scott Garman @c man end --- a/ld/ldfile.c +++ b/ld/ldfile.c -@@ -117,6 +117,23 @@ ldfile_add_library_path (const char *nam +@@ -117,6 +117,23 @@ new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); else new_dirs->name = xstrdup (name); @@ -206,7 +206,7 @@ Signed-off-by: Scott Garman /* Try to open a BFD for a lang_input_statement. */ --- a/ld/ldlex.h +++ b/ld/ldlex.h -@@ -161,6 +161,8 @@ enum option_values +@@ -161,6 +161,8 @@ OPTION_CTF_VARIABLES, OPTION_NO_CTF_VARIABLES, OPTION_CTF_SHARE_TYPES, @@ -217,7 +217,7 @@ Signed-off-by: Scott Garman /* The initial parser states. */ --- a/ld/ldmain.c +++ b/ld/ldmain.c -@@ -323,6 +323,8 @@ main (int argc, char **argv) +@@ -323,6 +323,8 @@ command_line.warn_mismatch = TRUE; command_line.warn_search_mismatch = TRUE; command_line.check_section_addresses = -1; @@ -228,7 +228,7 @@ Signed-off-by: Scott Garman COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the --- a/ld/lexsup.c +++ b/ld/lexsup.c -@@ -591,6 +591,14 @@ static const struct ld_option ld_options +@@ -591,6 +591,14 @@ " is: share-unconflicted (default),\n" " share-duplicated"), TWO_DASHES }, @@ -243,7 +243,7 @@ Signed-off-by: Scott Garman }; #define OPTION_COUNT ARRAY_SIZE (ld_options) -@@ -603,6 +611,7 @@ parse_args (unsigned argc, char **argv) +@@ -603,6 +611,7 @@ int ingroup = 0; char *default_dirlist = NULL; char *shortopts; @@ -251,7 +251,7 @@ Signed-off-by: Scott Garman struct option *longopts; struct option *really_longopts; int last_optind; -@@ -1633,6 +1642,14 @@ parse_args (unsigned argc, char **argv) +@@ -1633,6 +1642,14 @@ } break; @@ -266,7 +266,7 @@ Signed-off-by: Scott Garman case OPTION_PUSH_STATE: input_flags.pushed = xmemdup (&input_flags, sizeof (input_flags), -@@ -1778,6 +1795,10 @@ parse_args (unsigned argc, char **argv) +@@ -1778,6 +1795,10 @@ command_line.soname = NULL; } diff --git a/packages/binutils/2.37/0001-check_ldrunpath_length.patch b/packages/binutils/2.37/0001-check_ldrunpath_length.patch new file mode 100644 index 00000000..13518dbb --- /dev/null +++ b/packages/binutils/2.37/0001-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/ldelf.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/ldelf.c ++++ b/ld/ldelf.c +@@ -1250,6 +1250,8 @@ + && command_line.rpath == NULL) + { + path = (const char *) getenv ("LD_RUN_PATH"); ++ if (path && *path == '\0') ++ path = NULL; + if (path + && ldelf_search_needed (path, &n, force, + is_linux, elfsize)) +@@ -1610,6 +1612,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if (rpath && *rpath == '\0') ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.37/0002-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch b/packages/binutils/2.37/0002-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch new file mode 100644 index 00000000..99dee969 --- /dev/null +++ b/packages/binutils/2.37/0002-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch @@ -0,0 +1,15 @@ +--- + gold/gold-threads.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/gold/gold-threads.cc ++++ b/gold/gold-threads.cc +@@ -101,7 +101,7 @@ + int err = pthread_mutexattr_init(&attr); + if (err != 0) + gold_fatal(_("pthead_mutexattr_init failed: %s"), strerror(err)); +-#ifdef PTHREAD_MUTEX_ADAPTIVE_NP ++#if defined(PTHREAD_MUTEX_ADAPTIVE_NP) && !defined(_WIN32) + err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); + if (err != 0) + gold_fatal(_("pthread_mutexattr_settype failed: %s"), strerror(err)); diff --git a/packages/binutils/2.37/0002-check_ldrunpath_length.patch b/packages/binutils/2.37/0002-check_ldrunpath_length.patch deleted file mode 100644 index 13518dbb..00000000 --- a/packages/binutils/2.37/0002-check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/ldelf.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/ldelf.c -+++ b/ld/ldelf.c -@@ -1250,6 +1250,8 @@ - && command_line.rpath == NULL) - { - path = (const char *) getenv ("LD_RUN_PATH"); -+ if (path && *path == '\0') -+ path = NULL; - if (path - && ldelf_search_needed (path, &n, force, - is_linux, elfsize)) -@@ -1610,6 +1612,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if (rpath && *rpath == '\0') -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.37/0003-Dont-link-to-libfl-as-its-unnecessary.patch b/packages/binutils/2.37/0003-Dont-link-to-libfl-as-its-unnecessary.patch new file mode 100644 index 00000000..c3e525ae --- /dev/null +++ b/packages/binutils/2.37/0003-Dont-link-to-libfl-as-its-unnecessary.patch @@ -0,0 +1,105 @@ +--- + binutils/configure | 3 +++ + binutils/configure.ac | 3 +++ + gas/configure | 3 +++ + gas/configure.ac | 3 +++ + ld/configure | 3 +++ + ld/configure.ac | 3 +++ + 6 files changed, 18 insertions(+) + +--- a/binutils/configure ++++ b/binutils/configure +@@ -12233,6 +12233,7 @@ + done + test -n "$YACC" || YACC="yacc" + ++save_LIBS=$LIBS + for ac_prog in flex lex + do + # Extract the first word of "$ac_prog", so it can be a program name with args. +@@ -12396,6 +12397,8 @@ + if test "$LEX" = :; then + LEX=${am_missing_run}flex + fi ++LIBS=$save_LIBS ++LEXLIB= + + ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW" + # If we haven't got the data from the intl directory, +--- a/binutils/configure.ac ++++ b/binutils/configure.ac +@@ -136,7 +136,10 @@ + fi + + AC_PROG_YACC ++save_LIBS=$LIBS + AM_PROG_LEX ++LIBS=$save_LIBS ++LEXLIB= + + ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW" + ZW_GNU_GETTEXT_SISTER_DIR +--- a/gas/configure ++++ b/gas/configure +@@ -12880,6 +12880,7 @@ + done + test -n "$YACC" || YACC="yacc" + ++save_LIBS=$LIBS + for ac_prog in flex lex + do + # Extract the first word of "$ac_prog", so it can be a program name with args. +@@ -13043,6 +13044,8 @@ + if test "$LEX" = :; then + LEX=${am_missing_run}flex + fi ++LIBS=$save_LIBS ++LEXLIB= + + ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN" + # If we haven't got the data from the intl directory, +--- a/gas/configure.ac ++++ b/gas/configure.ac +@@ -930,7 +930,10 @@ + AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.]) + + AC_PROG_YACC ++save_LIBS=$LIBS + AM_PROG_LEX ++LIBS=$save_LIBS ++LEXLIB= + + ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN" + ZW_GNU_GETTEXT_SISTER_DIR +--- a/ld/configure ++++ b/ld/configure +@@ -16035,6 +16035,7 @@ + done + test -n "$YACC" || YACC="yacc" + ++save_LIBS=$LIBS + for ac_prog in flex lex + do + # Extract the first word of "$ac_prog", so it can be a program name with args. +@@ -16198,6 +16199,8 @@ + if test "$LEX" = :; then + LEX=${am_missing_run}flex + fi ++LIBS=$save_LIBS ++LEXLIB= + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +--- a/ld/configure.ac ++++ b/ld/configure.ac +@@ -293,7 +293,10 @@ + AC_EXEEXT + + AC_PROG_YACC ++save_LIBS=$LIBS + AM_PROG_LEX ++LIBS=$save_LIBS ++LEXLIB= + + AM_MAINTAINER_MODE + AM_CONDITIONAL(GENINSRC_NEVER, false) diff --git a/packages/binutils/2.37/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch b/packages/binutils/2.37/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch deleted file mode 100644 index 99dee969..00000000 --- a/packages/binutils/2.37/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- - gold/gold-threads.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/gold/gold-threads.cc -+++ b/gold/gold-threads.cc -@@ -101,7 +101,7 @@ - int err = pthread_mutexattr_init(&attr); - if (err != 0) - gold_fatal(_("pthead_mutexattr_init failed: %s"), strerror(err)); --#ifdef PTHREAD_MUTEX_ADAPTIVE_NP -+#if defined(PTHREAD_MUTEX_ADAPTIVE_NP) && !defined(_WIN32) - err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); - if (err != 0) - gold_fatal(_("pthread_mutexattr_settype failed: %s"), strerror(err)); diff --git a/packages/binutils/2.37/0004-Darwin-gold-binary-cc-include-string-not-cstring.patch b/packages/binutils/2.37/0004-Darwin-gold-binary-cc-include-string-not-cstring.patch new file mode 100644 index 00000000..fbc40418 --- /dev/null +++ b/packages/binutils/2.37/0004-Darwin-gold-binary-cc-include-string-not-cstring.patch @@ -0,0 +1,15 @@ +--- + gold/binary.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/gold/binary.cc ++++ b/gold/binary.cc +@@ -23,7 +23,7 @@ + #include "gold.h" + + #include +-#include ++#include + + #include "elfcpp.h" + #include "stringpool.h" diff --git a/packages/binutils/2.37/0004-Dont-link-to-libfl-as-its-unnecessary.patch b/packages/binutils/2.37/0004-Dont-link-to-libfl-as-its-unnecessary.patch deleted file mode 100644 index c3e525ae..00000000 --- a/packages/binutils/2.37/0004-Dont-link-to-libfl-as-its-unnecessary.patch +++ /dev/null @@ -1,105 +0,0 @@ ---- - binutils/configure | 3 +++ - binutils/configure.ac | 3 +++ - gas/configure | 3 +++ - gas/configure.ac | 3 +++ - ld/configure | 3 +++ - ld/configure.ac | 3 +++ - 6 files changed, 18 insertions(+) - ---- a/binutils/configure -+++ b/binutils/configure -@@ -12233,6 +12233,7 @@ - done - test -n "$YACC" || YACC="yacc" - -+save_LIBS=$LIBS - for ac_prog in flex lex - do - # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -12396,6 +12397,8 @@ - if test "$LEX" = :; then - LEX=${am_missing_run}flex - fi -+LIBS=$save_LIBS -+LEXLIB= - - ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW" - # If we haven't got the data from the intl directory, ---- a/binutils/configure.ac -+++ b/binutils/configure.ac -@@ -136,7 +136,10 @@ - fi - - AC_PROG_YACC -+save_LIBS=$LIBS - AM_PROG_LEX -+LIBS=$save_LIBS -+LEXLIB= - - ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW" - ZW_GNU_GETTEXT_SISTER_DIR ---- a/gas/configure -+++ b/gas/configure -@@ -12880,6 +12880,7 @@ - done - test -n "$YACC" || YACC="yacc" - -+save_LIBS=$LIBS - for ac_prog in flex lex - do - # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -13043,6 +13044,8 @@ - if test "$LEX" = :; then - LEX=${am_missing_run}flex - fi -+LIBS=$save_LIBS -+LEXLIB= - - ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN" - # If we haven't got the data from the intl directory, ---- a/gas/configure.ac -+++ b/gas/configure.ac -@@ -930,7 +930,10 @@ - AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.]) - - AC_PROG_YACC -+save_LIBS=$LIBS - AM_PROG_LEX -+LIBS=$save_LIBS -+LEXLIB= - - ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN" - ZW_GNU_GETTEXT_SISTER_DIR ---- a/ld/configure -+++ b/ld/configure -@@ -16035,6 +16035,7 @@ - done - test -n "$YACC" || YACC="yacc" - -+save_LIBS=$LIBS - for ac_prog in flex lex - do - # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -16198,6 +16199,8 @@ - if test "$LEX" = :; then - LEX=${am_missing_run}flex - fi -+LIBS=$save_LIBS -+LEXLIB= - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 ---- a/ld/configure.ac -+++ b/ld/configure.ac -@@ -293,7 +293,10 @@ - AC_EXEEXT - - AC_PROG_YACC -+save_LIBS=$LIBS - AM_PROG_LEX -+LIBS=$save_LIBS -+LEXLIB= - - AM_MAINTAINER_MODE - AM_CONDITIONAL(GENINSRC_NEVER, false) diff --git a/packages/binutils/2.37/0005-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch b/packages/binutils/2.37/0005-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch new file mode 100644 index 00000000..6728c6eb --- /dev/null +++ b/packages/binutils/2.37/0005-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch @@ -0,0 +1,70 @@ +From c39479f4ab4d372b518957871e1f205a03e7c3d6 Mon Sep 17 00:00:00 2001 +From: Andrew Hsieh +Date: Wed, 18 Mar 2015 10:57:24 +0800 +Subject: [PATCH] Fix darwin build + +1. In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 + doesn't support ended initializer list +2. wcsncasecmp doesn't exist in MacSDK10.6.x + +Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e +--- + bfd/peXXigen.c | 22 ++++++++++++++++++++++ + gold/gold-threads.cc | 15 ++++++++++++--- + 2 files changed, 34 insertions(+), 3 deletions(-) + +--- a/bfd/peXXigen.c ++++ b/bfd/peXXigen.c +@@ -3614,6 +3614,28 @@ + } + #endif /* not Cygwin/Mingw */ + ++#if defined __APPLE__ && __DARWIN_C_LEVEL < 200809L ++/* wcsncasecmp isn't always defined in Mac SDK */ ++static int ++wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n) ++{ ++ wchar_t c1, c2; ++ ++ if (n == 0) ++ return (0); ++ for (; *s1; s1++, s2++) ++ { ++ c1 = towlower(*s1); ++ c2 = towlower(*s2); ++ if (c1 != c2) ++ return ((int)c1 - c2); ++ if (--n == 0) ++ return (0); ++ } ++ return (-*s2); ++} ++#endif ++ + /* Perform a comparison of two entries. */ + static signed int + rsrc_cmp (bool is_name, rsrc_entry * a, rsrc_entry * b) +--- a/gold/gold-threads.cc ++++ b/gold/gold-threads.cc +@@ -284,9 +284,18 @@ + class Once_initialize + { + public: +- Once_initialize() +- : once_(PTHREAD_ONCE_INIT) +- { } ++ Once_initialize() ++#if !defined(__APPLE__) ++ : once_(PTHREAD_ONCE_INIT) ++ { } ++#else ++// In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 doesn't support ++// extended initializer list as above */ ++ { ++ pthread_once_t once_2 = PTHREAD_ONCE_INIT; ++ once_ = once_2; ++ } ++#endif + + // Return a pointer to the pthread_once_t variable. + pthread_once_t* diff --git a/packages/binutils/2.37/0005-Darwin-gold-binary-cc-include-string-not-cstring.patch b/packages/binutils/2.37/0005-Darwin-gold-binary-cc-include-string-not-cstring.patch deleted file mode 100644 index fbc40418..00000000 --- a/packages/binutils/2.37/0005-Darwin-gold-binary-cc-include-string-not-cstring.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- - gold/binary.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/gold/binary.cc -+++ b/gold/binary.cc -@@ -23,7 +23,7 @@ - #include "gold.h" - - #include --#include -+#include - - #include "elfcpp.h" - #include "stringpool.h" diff --git a/packages/binutils/2.37/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch b/packages/binutils/2.37/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch deleted file mode 100644 index 6728c6eb..00000000 --- a/packages/binutils/2.37/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch +++ /dev/null @@ -1,70 +0,0 @@ -From c39479f4ab4d372b518957871e1f205a03e7c3d6 Mon Sep 17 00:00:00 2001 -From: Andrew Hsieh -Date: Wed, 18 Mar 2015 10:57:24 +0800 -Subject: [PATCH] Fix darwin build - -1. In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 - doesn't support ended initializer list -2. wcsncasecmp doesn't exist in MacSDK10.6.x - -Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e ---- - bfd/peXXigen.c | 22 ++++++++++++++++++++++ - gold/gold-threads.cc | 15 ++++++++++++--- - 2 files changed, 34 insertions(+), 3 deletions(-) - ---- a/bfd/peXXigen.c -+++ b/bfd/peXXigen.c -@@ -3614,6 +3614,28 @@ - } - #endif /* not Cygwin/Mingw */ - -+#if defined __APPLE__ && __DARWIN_C_LEVEL < 200809L -+/* wcsncasecmp isn't always defined in Mac SDK */ -+static int -+wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n) -+{ -+ wchar_t c1, c2; -+ -+ if (n == 0) -+ return (0); -+ for (; *s1; s1++, s2++) -+ { -+ c1 = towlower(*s1); -+ c2 = towlower(*s2); -+ if (c1 != c2) -+ return ((int)c1 - c2); -+ if (--n == 0) -+ return (0); -+ } -+ return (-*s2); -+} -+#endif -+ - /* Perform a comparison of two entries. */ - static signed int - rsrc_cmp (bool is_name, rsrc_entry * a, rsrc_entry * b) ---- a/gold/gold-threads.cc -+++ b/gold/gold-threads.cc -@@ -284,9 +284,18 @@ - class Once_initialize - { - public: -- Once_initialize() -- : once_(PTHREAD_ONCE_INIT) -- { } -+ Once_initialize() -+#if !defined(__APPLE__) -+ : once_(PTHREAD_ONCE_INIT) -+ { } -+#else -+// In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 doesn't support -+// extended initializer list as above */ -+ { -+ pthread_once_t once_2 = PTHREAD_ONCE_INIT; -+ once_ = once_2; -+ } -+#endif - - // Return a pointer to the pthread_once_t variable. - pthread_once_t* diff --git a/packages/binutils/2.37/0006-sysroot.patch b/packages/binutils/2.37/0006-sysroot.patch new file mode 100644 index 00000000..3b3c0ec1 --- /dev/null +++ b/packages/binutils/2.37/0006-sysroot.patch @@ -0,0 +1,41 @@ +Signed-off-by: Sven Rebhan + +Always try to prepend the sysroot prefix to absolute filenames first. + +http://bugs.gentoo.org/275666 +http://sourceware.org/bugzilla/show_bug.cgi?id=10340 + +--- + ld/ldfile.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -340,18 +340,25 @@ + directory first. */ + if (!entry->flags.maybe_archive) + { +- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)) ++ /* For absolute pathnames, try to always open the file in the ++ sysroot first. If this fails, try to open the file at the ++ given location. */ ++ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename); ++ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename) ++ && ld_sysroot) + { + char *name = concat (ld_sysroot, entry->filename, + (const char *) NULL); + if (ldfile_try_open_bfd (name, entry)) + { + entry->filename = name; ++ entry->flags.sysrooted = true; + return true; + } + free (name); + } +- else if (ldfile_try_open_bfd (entry->filename, entry)) ++ ++ if (ldfile_try_open_bfd (entry->filename, entry)) + return true; + + if (IS_ABSOLUTE_PATH (entry->filename)) diff --git a/packages/binutils/2.37/0007-poison-system-directories.patch b/packages/binutils/2.37/0007-poison-system-directories.patch new file mode 100644 index 00000000..0fd1adcd --- /dev/null +++ b/packages/binutils/2.37/0007-poison-system-directories.patch @@ -0,0 +1,279 @@ +Patch adapted to binutils 2.23.2 and extended to use +BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni. + +[Gustavo: adapt to binutils 2.25] +Signed-off-by: Thomas Petazzoni +Signed-off-by: Gustavo Zacarias + +Upstream-Status: Inappropriate [distribution: codesourcery] + +Patch originally created by Mark Hatle, forward-ported to +binutils 2.21 by Scott Garman. + +purpose: warn for uses of system directories when cross linking + +Code Merged from Sourcery G++ binutils 2.19 - 4.4-277 + +2008-07-02 Joseph Myers + + ld/ + * ld.h (args_type): Add error_poison_system_directories. + * ld.texinfo (--error-poison-system-directories): Document. + * ldfile.c (ldfile_add_library_path): Check + command_line.error_poison_system_directories. + * ldmain.c (main): Initialize + command_line.error_poison_system_directories. + * lexsup.c (enum option_values): Add + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES. + (ld_options): Add --error-poison-system-directories. + (parse_args): Handle new option. + +2007-06-13 Joseph Myers + + ld/ + * config.in: Regenerate. + * ld.h (args_type): Add poison_system_directories. + * ld.texinfo (--no-poison-system-directories): Document. + * ldfile.c (ldfile_add_library_path): Check + command_line.poison_system_directories. + * ldmain.c (main): Initialize + command_line.poison_system_directories. + * lexsup.c (enum option_values): Add + OPTION_NO_POISON_SYSTEM_DIRECTORIES. + (ld_options): Add --no-poison-system-directories. + (parse_args): Handle new option. + +2007-04-20 Joseph Myers + + Merge from Sourcery G++ binutils 2.17: + + 2007-03-20 Joseph Myers + Based on patch by Mark Hatle . + ld/ + * configure.ac (--enable-poison-system-directories): New option. + * configure, config.in: Regenerate. + * ldfile.c (ldfile_add_library_path): If + ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib, + /usr/lib, /usr/local/lib or /usr/X11R6/lib. + +Signed-off-by: Mark Hatle +Signed-off-by: Scott Garman + +--- + ld/config.in | 3 +++ + ld/configure | 14 ++++++++++++++ + ld/configure.ac | 10 ++++++++++ + ld/ld.h | 8 ++++++++ + ld/ld.texi | 12 ++++++++++++ + ld/ldfile.c | 17 +++++++++++++++++ + ld/ldlex.h | 2 ++ + ld/ldmain.c | 2 ++ + ld/lexsup.c | 21 +++++++++++++++++++++ + 9 files changed, 89 insertions(+) + +--- a/ld/config.in ++++ b/ld/config.in +@@ -43,6 +43,9 @@ + language is requested. */ + #undef ENABLE_NLS + ++/* Define to warn for use of native system library directories */ ++#undef ENABLE_POISON_SYSTEM_DIRECTORIES ++ + /* Additional extension a shared object might have. */ + #undef EXTRA_SHLIB_EXTENSION + +--- a/ld/configure ++++ b/ld/configure +@@ -829,6 +829,7 @@ + enable_targets + enable_64_bit_bfd + with_sysroot ++enable_poison_system_directories + enable_gold + enable_got + enable_compressed_debug_sections +@@ -1498,6 +1499,8 @@ + --enable-checking enable run-time checks + --enable-targets alternative target configurations + --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) ++ --enable-poison-system-directories ++ warn for use of native system library directories + --enable-gold[=ARG] build gold [ARG={default,yes,no}] + --enable-got= GOT handling scheme (target, single, negative, + multigot) +@@ -15236,7 +15239,18 @@ + fi + + ++# Check whether --enable-poison-system-directories was given. ++if test "${enable_poison_system_directories+set}" = set; then : ++ enableval=$enable_poison_system_directories; ++else ++ enable_poison_system_directories=no ++fi ++ ++if test "x${enable_poison_system_directories}" = "xyes"; then + ++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++ ++fi + + # Check whether --enable-got was given. + if test "${enable_got+set}" = set; then : +--- a/ld/configure.ac ++++ b/ld/configure.ac +@@ -106,6 +106,16 @@ + AC_SUBST(TARGET_SYSTEM_ROOT) + AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) + ++AC_ARG_ENABLE([poison-system-directories], ++ AS_HELP_STRING([--enable-poison-system-directories], ++ [warn for use of native system library directories]),, ++ [enable_poison_system_directories=no]) ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], ++ [1], ++ [Define to warn for use of native system library directories]) ++fi ++ + 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. +--- a/ld/ld.h ++++ b/ld/ld.h +@@ -157,6 +157,14 @@ + /* If set, display the target memory usage (per memory region). */ + bool print_memory_usage; + ++ /* If TRUE (the default) warn for uses of system directories when ++ cross linking. */ ++ bool poison_system_directories; ++ ++ /* If TRUE (default FALSE) give an error for uses of system ++ directories when cross linking instead of a warning. */ ++ bool error_poison_system_directories; ++ + /* Should we force section groups to be resolved? Controlled with + --force-group-allocation on the command line or FORCE_GROUP_ALLOCATION + in the linker script. */ +--- a/ld/ld.texi ++++ b/ld/ld.texi +@@ -2863,6 +2863,18 @@ + + Passing @code{none} for @var{style} disables the setting from any + @code{--build-id} options earlier on the command line. ++ ++@kindex --no-poison-system-directories ++@item --no-poison-system-directories ++Do not warn for @option{-L} options using system directories such as ++@file{/usr/lib} when cross linking. This option is intended for use ++in chroot environments when such directories contain the correct ++libraries for the target system rather than the host. ++ ++@kindex --error-poison-system-directories ++@item --error-poison-system-directories ++Give an error instead of a warning for @option{-L} options using ++system directories when cross linking. + @end table + + @c man end +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -117,6 +117,23 @@ + new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); + else + new_dirs->name = xstrdup (name); ++ ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ if (command_line.poison_system_directories ++ && ((!strncmp (name, "/lib", 4)) ++ || (!strncmp (name, "/usr/lib", 8)) ++ || (!strncmp (name, "/usr/local/lib", 14)) ++ || (!strncmp (name, "/usr/X11R6/lib", 14)))) ++ { ++ if (command_line.error_poison_system_directories) ++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for " ++ "cross-compilation\n"), name); ++ else ++ einfo (_("%P: warning: library search path \"%s\" is unsafe for " ++ "cross-compilation\n"), name); ++ } ++#endif ++ + } + + /* Try to open a BFD for a lang_input_statement. */ +--- a/ld/ldlex.h ++++ b/ld/ldlex.h +@@ -163,6 +163,8 @@ + OPTION_CTF_VARIABLES, + OPTION_NO_CTF_VARIABLES, + OPTION_CTF_SHARE_TYPES, ++ OPTION_NO_POISON_SYSTEM_DIRECTORIES, ++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES, + }; + + /* The initial parser states. */ +--- a/ld/ldmain.c ++++ b/ld/ldmain.c +@@ -321,6 +321,8 @@ + command_line.warn_mismatch = true; + command_line.warn_search_mismatch = true; + command_line.check_section_addresses = -1; ++ command_line.poison_system_directories = true; ++ command_line.error_poison_system_directories = true; + + /* We initialize DEMANGLING based on the environment variable + COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the +--- a/ld/lexsup.c ++++ b/ld/lexsup.c +@@ -595,6 +595,14 @@ + " is: share-unconflicted (default),\n" + " share-duplicated"), + TWO_DASHES }, ++ { {"no-poison-system-directories", no_argument, NULL, ++ OPTION_NO_POISON_SYSTEM_DIRECTORIES}, ++ '\0', NULL, N_("Do not warn for -L options using system directories"), ++ TWO_DASHES }, ++ { {"error-poison-system-directories", no_argument, NULL, ++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES}, ++ '\0', NULL, N_("Give an error for -L options using system directories"), ++ TWO_DASHES }, + }; + + #define OPTION_COUNT ARRAY_SIZE (ld_options) +@@ -607,6 +615,7 @@ + int ingroup = 0; + char *default_dirlist = NULL; + char *shortopts; ++ char *BR_paranoid_env; + struct option *longopts; + struct option *really_longopts; + int last_optind; +@@ -1643,6 +1652,14 @@ + } + break; + ++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES: ++ command_line.poison_system_directories = false; ++ break; ++ ++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: ++ command_line.error_poison_system_directories = true; ++ break; ++ + case OPTION_PUSH_STATE: + input_flags.pushed = xmemdup (&input_flags, + sizeof (input_flags), +@@ -1788,6 +1805,10 @@ + command_line.soname = NULL; + } + ++ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH"); ++ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0) ++ command_line.error_poison_system_directories = true; ++ + while (ingroup) + { + einfo (_("%P: missing --end-group; added as last command line option\n")); diff --git a/packages/binutils/2.37/0007-sysroot.patch b/packages/binutils/2.37/0007-sysroot.patch deleted file mode 100644 index 3b3c0ec1..00000000 --- a/packages/binutils/2.37/0007-sysroot.patch +++ /dev/null @@ -1,41 +0,0 @@ -Signed-off-by: Sven Rebhan - -Always try to prepend the sysroot prefix to absolute filenames first. - -http://bugs.gentoo.org/275666 -http://sourceware.org/bugzilla/show_bug.cgi?id=10340 - ---- - ld/ldfile.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - ---- a/ld/ldfile.c -+++ b/ld/ldfile.c -@@ -340,18 +340,25 @@ - directory first. */ - if (!entry->flags.maybe_archive) - { -- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)) -+ /* For absolute pathnames, try to always open the file in the -+ sysroot first. If this fails, try to open the file at the -+ given location. */ -+ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename); -+ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename) -+ && ld_sysroot) - { - char *name = concat (ld_sysroot, entry->filename, - (const char *) NULL); - if (ldfile_try_open_bfd (name, entry)) - { - entry->filename = name; -+ entry->flags.sysrooted = true; - return true; - } - free (name); - } -- else if (ldfile_try_open_bfd (entry->filename, entry)) -+ -+ if (ldfile_try_open_bfd (entry->filename, entry)) - return true; - - if (IS_ABSOLUTE_PATH (entry->filename)) diff --git a/packages/binutils/2.37/0008-arc-Fix-potential-invalid-pointer-access-when-fixing.patch b/packages/binutils/2.37/0008-arc-Fix-potential-invalid-pointer-access-when-fixing.patch new file mode 100644 index 00000000..ade3180b --- /dev/null +++ b/packages/binutils/2.37/0008-arc-Fix-potential-invalid-pointer-access-when-fixing.patch @@ -0,0 +1,217 @@ +From 29d31b4ed96fcbc774740fac91ef77cb3d62a714 Mon Sep 17 00:00:00 2001 +From: Claudiu Zissulescu +Date: Tue, 17 Aug 2021 13:44:17 +0300 +Subject: [PATCH] arc: Fix potential invalid pointer access when fixing got + symbols. + +When statically linking, it can arrive to an undefined weak symbol of +which its value cannot be determined. However, we are having pieces of +code which doesn't take this situation into account, leading to access +a structure which may not be initialized. Fix this situation and add a +test. + +bfd/ +xxxx-xx-xx Cupertino Miranda + Claudiu Zissulescu + + * arc-got.h (arc_static_sym_data): New structure. + (get_static_sym_data): New function. + (relocate_fix_got_relocs_for_got_info): Move the computation fo + symbol value and section to above introduced function, and use + this new function. + +ld/testsuite/ +xxxx-xx-xx Claudiu Zissulescu + + * ld-arc/got-weak.d: New file. + * ld-arc/got-weak.s: Likewise. + +For all the gory details please refer to [1]. +Original fix could be found here [2]. + +[1] https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/issues/402 +[2] https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/commit/29d31b4ed96fcbc774740fac91ef77cb3d62a714 + +Signed-off-by: Claudiu Zissulescu +[Added links to the origins] +Signed-off-by: Alexey Brodkin +--- + bfd/arc-got.h | 94 ++++++++++++++++++++++++----------------- + ld/testsuite/ld-arc/got-weak.d | 12 +++++ + ld/testsuite/ld-arc/got-weak.s | 7 +++ + 3 files changed, 76 insertions(+), 37 deletions(-) + create mode 100644 ld/testsuite/ld-arc/got-weak.d + create mode 100644 ld/testsuite/ld-arc/got-weak.s + +--- a/bfd/arc-got.h ++++ b/bfd/arc-got.h +@@ -262,6 +262,48 @@ + return true; + } + ++struct arc_static_sym_data { ++ bfd_vma sym_value; ++ const char *symbol_name; ++}; ++ ++static struct arc_static_sym_data ++get_static_sym_data (unsigned long r_symndx, ++ Elf_Internal_Sym *local_syms, ++ asection **local_sections, ++ struct elf_link_hash_entry *h, ++ struct arc_relocation_data *reloc_data) ++{ ++ static const char local_name[] = "(local)"; ++ struct arc_static_sym_data ret = { 0, NULL }; ++ ++ if (h != NULL) ++ { ++ BFD_ASSERT (h->root.type != bfd_link_hash_undefweak ++ && h->root.type != bfd_link_hash_undefined); ++ /* TODO: This should not be here. */ ++ reloc_data->sym_value = h->root.u.def.value; ++ reloc_data->sym_section = h->root.u.def.section; ++ ++ ret.sym_value = h->root.u.def.value ++ + h->root.u.def.section->output_section->vma ++ + h->root.u.def.section->output_offset; ++ ++ ret.symbol_name = h->root.root.string; ++ } ++ else ++ { ++ Elf_Internal_Sym *sym = local_syms + r_symndx; ++ asection *sec = local_sections[r_symndx]; ++ ++ ret.sym_value = sym->st_value ++ + sec->output_section->vma ++ + sec->output_offset; ++ ++ ret.symbol_name = local_name; ++ } ++ return ret; ++} + + static bfd_vma + relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p, +@@ -290,38 +332,7 @@ + && SYMBOL_REFERENCES_LOCAL (info, h)))) + { + const char ATTRIBUTE_UNUSED *symbol_name; +- static const char local_name[] = "(local)"; +- asection *tls_sec = NULL; +- bfd_vma sym_value = 0; +- +- if (h != NULL) +- { +- /* TODO: This should not be here. */ +- reloc_data->sym_value = h->root.u.def.value; +- reloc_data->sym_section = h->root.u.def.section; +- +- sym_value = h->root.u.def.value +- + h->root.u.def.section->output_section->vma +- + h->root.u.def.section->output_offset; +- +- tls_sec = elf_hash_table (info)->tls_sec; +- +- symbol_name = h->root.root.string; +- } +- else +- { +- Elf_Internal_Sym *sym = local_syms + r_symndx; +- asection *sec = local_sections[r_symndx]; +- +- sym_value = sym->st_value +- + sec->output_section->vma +- + sec->output_offset; +- +- tls_sec = elf_hash_table (info)->tls_sec; +- +- symbol_name = local_name; +- } +- ++ asection *tls_sec = elf_hash_table (info)->tls_sec; + + if (entry && !entry->processed) + { +@@ -335,8 +346,12 @@ + if (h == NULL || h->forced_local + || !elf_hash_table (info)->dynamic_sections_created) + { ++ struct arc_static_sym_data tmp = ++ get_static_sym_data (r_symndx, local_syms, local_sections, ++ h, reloc_data); ++ + bfd_put_32 (output_bfd, +- sym_value - sec_vma ++ tmp.sym_value - sec_vma + + (elf_hash_table (info)->dynamic_sections_created + ? 0 + : (align_power (0, +@@ -355,7 +370,7 @@ + + entry->offset + + (entry->existing_entries == TLS_GOT_MOD_AND_OFF + ? 4 : 0)), +- symbol_name); ++ tmp.symbol_name); + } + } + break; +@@ -366,8 +381,12 @@ + bfd_vma ATTRIBUTE_UNUSED sec_vma + = tls_sec->output_section->vma; + ++ struct arc_static_sym_data tmp = ++ get_static_sym_data (r_symndx, local_syms, local_sections, ++ h, reloc_data); ++ + bfd_put_32 (output_bfd, +- sym_value - sec_vma ++ tmp.sym_value - sec_vma + + (elf_hash_table (info)->dynamic_sections_created + ? 0 + : (align_power (TCB_SIZE, +@@ -386,7 +405,7 @@ + + entry->offset + + (entry->existing_entries == TLS_GOT_MOD_AND_OFF + ? 4 : 0)), +- symbol_name); ++ tmp.symbol_name); + } + break; + +@@ -415,7 +434,8 @@ + "@ %#08lx for sym %s in got offset %#lx\n", + (long) (reloc_data->sym_value + sec_vma), + (long) (htab->sgot->output_section->vma +- + htab->sgot->output_offset + entry->offset), ++ + htab->sgot->output_offset ++ + entry->offset), + symbol_name, + (long) entry->offset); + } +--- /dev/null ++++ b/ld/testsuite/ld-arc/got-weak.d +@@ -0,0 +1,12 @@ ++#source: got-weak.s ++#as: ++#ld: -Bstatic ++#objdump: -d ++ ++[^:]*: file format elf32-.*arc ++ ++ ++Disassembly of section \.text: ++ ++00000100 <.*>: ++ 100: 2730 7f80 0000 2014 ld r0,\[pcl,0x2014\].* +--- /dev/null ++++ b/ld/testsuite/ld-arc/got-weak.s +@@ -0,0 +1,7 @@ ++ .cpu archs ++ ++ .weak symb ++ .global __start ++ .text ++__start: ++ ld r0,[pcl,@symb@gotpc] diff --git a/packages/binutils/2.37/0008-poison-system-directories.patch b/packages/binutils/2.37/0008-poison-system-directories.patch deleted file mode 100644 index 0fd1adcd..00000000 --- a/packages/binutils/2.37/0008-poison-system-directories.patch +++ /dev/null @@ -1,279 +0,0 @@ -Patch adapted to binutils 2.23.2 and extended to use -BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni. - -[Gustavo: adapt to binutils 2.25] -Signed-off-by: Thomas Petazzoni -Signed-off-by: Gustavo Zacarias - -Upstream-Status: Inappropriate [distribution: codesourcery] - -Patch originally created by Mark Hatle, forward-ported to -binutils 2.21 by Scott Garman. - -purpose: warn for uses of system directories when cross linking - -Code Merged from Sourcery G++ binutils 2.19 - 4.4-277 - -2008-07-02 Joseph Myers - - ld/ - * ld.h (args_type): Add error_poison_system_directories. - * ld.texinfo (--error-poison-system-directories): Document. - * ldfile.c (ldfile_add_library_path): Check - command_line.error_poison_system_directories. - * ldmain.c (main): Initialize - command_line.error_poison_system_directories. - * lexsup.c (enum option_values): Add - OPTION_ERROR_POISON_SYSTEM_DIRECTORIES. - (ld_options): Add --error-poison-system-directories. - (parse_args): Handle new option. - -2007-06-13 Joseph Myers - - ld/ - * config.in: Regenerate. - * ld.h (args_type): Add poison_system_directories. - * ld.texinfo (--no-poison-system-directories): Document. - * ldfile.c (ldfile_add_library_path): Check - command_line.poison_system_directories. - * ldmain.c (main): Initialize - command_line.poison_system_directories. - * lexsup.c (enum option_values): Add - OPTION_NO_POISON_SYSTEM_DIRECTORIES. - (ld_options): Add --no-poison-system-directories. - (parse_args): Handle new option. - -2007-04-20 Joseph Myers - - Merge from Sourcery G++ binutils 2.17: - - 2007-03-20 Joseph Myers - Based on patch by Mark Hatle . - ld/ - * configure.ac (--enable-poison-system-directories): New option. - * configure, config.in: Regenerate. - * ldfile.c (ldfile_add_library_path): If - ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib, - /usr/lib, /usr/local/lib or /usr/X11R6/lib. - -Signed-off-by: Mark Hatle -Signed-off-by: Scott Garman - ---- - ld/config.in | 3 +++ - ld/configure | 14 ++++++++++++++ - ld/configure.ac | 10 ++++++++++ - ld/ld.h | 8 ++++++++ - ld/ld.texi | 12 ++++++++++++ - ld/ldfile.c | 17 +++++++++++++++++ - ld/ldlex.h | 2 ++ - ld/ldmain.c | 2 ++ - ld/lexsup.c | 21 +++++++++++++++++++++ - 9 files changed, 89 insertions(+) - ---- a/ld/config.in -+++ b/ld/config.in -@@ -43,6 +43,9 @@ - language is requested. */ - #undef ENABLE_NLS - -+/* Define to warn for use of native system library directories */ -+#undef ENABLE_POISON_SYSTEM_DIRECTORIES -+ - /* Additional extension a shared object might have. */ - #undef EXTRA_SHLIB_EXTENSION - ---- a/ld/configure -+++ b/ld/configure -@@ -829,6 +829,7 @@ - enable_targets - enable_64_bit_bfd - with_sysroot -+enable_poison_system_directories - enable_gold - enable_got - enable_compressed_debug_sections -@@ -1498,6 +1499,8 @@ - --enable-checking enable run-time checks - --enable-targets alternative target configurations - --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) -+ --enable-poison-system-directories -+ warn for use of native system library directories - --enable-gold[=ARG] build gold [ARG={default,yes,no}] - --enable-got= GOT handling scheme (target, single, negative, - multigot) -@@ -15236,7 +15239,18 @@ - fi - - -+# Check whether --enable-poison-system-directories was given. -+if test "${enable_poison_system_directories+set}" = set; then : -+ enableval=$enable_poison_system_directories; -+else -+ enable_poison_system_directories=no -+fi -+ -+if test "x${enable_poison_system_directories}" = "xyes"; then - -+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h -+ -+fi - - # Check whether --enable-got was given. - if test "${enable_got+set}" = set; then : ---- a/ld/configure.ac -+++ b/ld/configure.ac -@@ -106,6 +106,16 @@ - AC_SUBST(TARGET_SYSTEM_ROOT) - AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) - -+AC_ARG_ENABLE([poison-system-directories], -+ AS_HELP_STRING([--enable-poison-system-directories], -+ [warn for use of native system library directories]),, -+ [enable_poison_system_directories=no]) -+if test "x${enable_poison_system_directories}" = "xyes"; then -+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], -+ [1], -+ [Define to warn for use of native system library directories]) -+fi -+ - 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. ---- a/ld/ld.h -+++ b/ld/ld.h -@@ -157,6 +157,14 @@ - /* If set, display the target memory usage (per memory region). */ - bool print_memory_usage; - -+ /* If TRUE (the default) warn for uses of system directories when -+ cross linking. */ -+ bool poison_system_directories; -+ -+ /* If TRUE (default FALSE) give an error for uses of system -+ directories when cross linking instead of a warning. */ -+ bool error_poison_system_directories; -+ - /* Should we force section groups to be resolved? Controlled with - --force-group-allocation on the command line or FORCE_GROUP_ALLOCATION - in the linker script. */ ---- a/ld/ld.texi -+++ b/ld/ld.texi -@@ -2863,6 +2863,18 @@ - - Passing @code{none} for @var{style} disables the setting from any - @code{--build-id} options earlier on the command line. -+ -+@kindex --no-poison-system-directories -+@item --no-poison-system-directories -+Do not warn for @option{-L} options using system directories such as -+@file{/usr/lib} when cross linking. This option is intended for use -+in chroot environments when such directories contain the correct -+libraries for the target system rather than the host. -+ -+@kindex --error-poison-system-directories -+@item --error-poison-system-directories -+Give an error instead of a warning for @option{-L} options using -+system directories when cross linking. - @end table - - @c man end ---- a/ld/ldfile.c -+++ b/ld/ldfile.c -@@ -117,6 +117,23 @@ - new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); - else - new_dirs->name = xstrdup (name); -+ -+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES -+ if (command_line.poison_system_directories -+ && ((!strncmp (name, "/lib", 4)) -+ || (!strncmp (name, "/usr/lib", 8)) -+ || (!strncmp (name, "/usr/local/lib", 14)) -+ || (!strncmp (name, "/usr/X11R6/lib", 14)))) -+ { -+ if (command_line.error_poison_system_directories) -+ einfo (_("%X%P: error: library search path \"%s\" is unsafe for " -+ "cross-compilation\n"), name); -+ else -+ einfo (_("%P: warning: library search path \"%s\" is unsafe for " -+ "cross-compilation\n"), name); -+ } -+#endif -+ - } - - /* Try to open a BFD for a lang_input_statement. */ ---- a/ld/ldlex.h -+++ b/ld/ldlex.h -@@ -163,6 +163,8 @@ - OPTION_CTF_VARIABLES, - OPTION_NO_CTF_VARIABLES, - OPTION_CTF_SHARE_TYPES, -+ OPTION_NO_POISON_SYSTEM_DIRECTORIES, -+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES, - }; - - /* The initial parser states. */ ---- a/ld/ldmain.c -+++ b/ld/ldmain.c -@@ -321,6 +321,8 @@ - command_line.warn_mismatch = true; - command_line.warn_search_mismatch = true; - command_line.check_section_addresses = -1; -+ command_line.poison_system_directories = true; -+ command_line.error_poison_system_directories = true; - - /* We initialize DEMANGLING based on the environment variable - COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the ---- a/ld/lexsup.c -+++ b/ld/lexsup.c -@@ -595,6 +595,14 @@ - " is: share-unconflicted (default),\n" - " share-duplicated"), - TWO_DASHES }, -+ { {"no-poison-system-directories", no_argument, NULL, -+ OPTION_NO_POISON_SYSTEM_DIRECTORIES}, -+ '\0', NULL, N_("Do not warn for -L options using system directories"), -+ TWO_DASHES }, -+ { {"error-poison-system-directories", no_argument, NULL, -+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES}, -+ '\0', NULL, N_("Give an error for -L options using system directories"), -+ TWO_DASHES }, - }; - - #define OPTION_COUNT ARRAY_SIZE (ld_options) -@@ -607,6 +615,7 @@ - int ingroup = 0; - char *default_dirlist = NULL; - char *shortopts; -+ char *BR_paranoid_env; - struct option *longopts; - struct option *really_longopts; - int last_optind; -@@ -1643,6 +1652,14 @@ - } - break; - -+ case OPTION_NO_POISON_SYSTEM_DIRECTORIES: -+ command_line.poison_system_directories = false; -+ break; -+ -+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: -+ command_line.error_poison_system_directories = true; -+ break; -+ - case OPTION_PUSH_STATE: - input_flags.pushed = xmemdup (&input_flags, - sizeof (input_flags), -@@ -1788,6 +1805,10 @@ - command_line.soname = NULL; - } - -+ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH"); -+ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0) -+ command_line.error_poison_system_directories = true; -+ - while (ingroup) - { - einfo (_("%P: missing --end-group; added as last command line option\n")); diff --git a/packages/binutils/2.37/0009-arc-Fix-potential-invalid-pointer-access-when-fixing.patch b/packages/binutils/2.37/0009-arc-Fix-potential-invalid-pointer-access-when-fixing.patch deleted file mode 100644 index ade3180b..00000000 --- a/packages/binutils/2.37/0009-arc-Fix-potential-invalid-pointer-access-when-fixing.patch +++ /dev/null @@ -1,217 +0,0 @@ -From 29d31b4ed96fcbc774740fac91ef77cb3d62a714 Mon Sep 17 00:00:00 2001 -From: Claudiu Zissulescu -Date: Tue, 17 Aug 2021 13:44:17 +0300 -Subject: [PATCH] arc: Fix potential invalid pointer access when fixing got - symbols. - -When statically linking, it can arrive to an undefined weak symbol of -which its value cannot be determined. However, we are having pieces of -code which doesn't take this situation into account, leading to access -a structure which may not be initialized. Fix this situation and add a -test. - -bfd/ -xxxx-xx-xx Cupertino Miranda - Claudiu Zissulescu - - * arc-got.h (arc_static_sym_data): New structure. - (get_static_sym_data): New function. - (relocate_fix_got_relocs_for_got_info): Move the computation fo - symbol value and section to above introduced function, and use - this new function. - -ld/testsuite/ -xxxx-xx-xx Claudiu Zissulescu - - * ld-arc/got-weak.d: New file. - * ld-arc/got-weak.s: Likewise. - -For all the gory details please refer to [1]. -Original fix could be found here [2]. - -[1] https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/issues/402 -[2] https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/commit/29d31b4ed96fcbc774740fac91ef77cb3d62a714 - -Signed-off-by: Claudiu Zissulescu -[Added links to the origins] -Signed-off-by: Alexey Brodkin ---- - bfd/arc-got.h | 94 ++++++++++++++++++++++++----------------- - ld/testsuite/ld-arc/got-weak.d | 12 +++++ - ld/testsuite/ld-arc/got-weak.s | 7 +++ - 3 files changed, 76 insertions(+), 37 deletions(-) - create mode 100644 ld/testsuite/ld-arc/got-weak.d - create mode 100644 ld/testsuite/ld-arc/got-weak.s - ---- a/bfd/arc-got.h -+++ b/bfd/arc-got.h -@@ -262,6 +262,48 @@ - return true; - } - -+struct arc_static_sym_data { -+ bfd_vma sym_value; -+ const char *symbol_name; -+}; -+ -+static struct arc_static_sym_data -+get_static_sym_data (unsigned long r_symndx, -+ Elf_Internal_Sym *local_syms, -+ asection **local_sections, -+ struct elf_link_hash_entry *h, -+ struct arc_relocation_data *reloc_data) -+{ -+ static const char local_name[] = "(local)"; -+ struct arc_static_sym_data ret = { 0, NULL }; -+ -+ if (h != NULL) -+ { -+ BFD_ASSERT (h->root.type != bfd_link_hash_undefweak -+ && h->root.type != bfd_link_hash_undefined); -+ /* TODO: This should not be here. */ -+ reloc_data->sym_value = h->root.u.def.value; -+ reloc_data->sym_section = h->root.u.def.section; -+ -+ ret.sym_value = h->root.u.def.value -+ + h->root.u.def.section->output_section->vma -+ + h->root.u.def.section->output_offset; -+ -+ ret.symbol_name = h->root.root.string; -+ } -+ else -+ { -+ Elf_Internal_Sym *sym = local_syms + r_symndx; -+ asection *sec = local_sections[r_symndx]; -+ -+ ret.sym_value = sym->st_value -+ + sec->output_section->vma -+ + sec->output_offset; -+ -+ ret.symbol_name = local_name; -+ } -+ return ret; -+} - - static bfd_vma - relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p, -@@ -290,38 +332,7 @@ - && SYMBOL_REFERENCES_LOCAL (info, h)))) - { - const char ATTRIBUTE_UNUSED *symbol_name; -- static const char local_name[] = "(local)"; -- asection *tls_sec = NULL; -- bfd_vma sym_value = 0; -- -- if (h != NULL) -- { -- /* TODO: This should not be here. */ -- reloc_data->sym_value = h->root.u.def.value; -- reloc_data->sym_section = h->root.u.def.section; -- -- sym_value = h->root.u.def.value -- + h->root.u.def.section->output_section->vma -- + h->root.u.def.section->output_offset; -- -- tls_sec = elf_hash_table (info)->tls_sec; -- -- symbol_name = h->root.root.string; -- } -- else -- { -- Elf_Internal_Sym *sym = local_syms + r_symndx; -- asection *sec = local_sections[r_symndx]; -- -- sym_value = sym->st_value -- + sec->output_section->vma -- + sec->output_offset; -- -- tls_sec = elf_hash_table (info)->tls_sec; -- -- symbol_name = local_name; -- } -- -+ asection *tls_sec = elf_hash_table (info)->tls_sec; - - if (entry && !entry->processed) - { -@@ -335,8 +346,12 @@ - if (h == NULL || h->forced_local - || !elf_hash_table (info)->dynamic_sections_created) - { -+ struct arc_static_sym_data tmp = -+ get_static_sym_data (r_symndx, local_syms, local_sections, -+ h, reloc_data); -+ - bfd_put_32 (output_bfd, -- sym_value - sec_vma -+ tmp.sym_value - sec_vma - + (elf_hash_table (info)->dynamic_sections_created - ? 0 - : (align_power (0, -@@ -355,7 +370,7 @@ - + entry->offset - + (entry->existing_entries == TLS_GOT_MOD_AND_OFF - ? 4 : 0)), -- symbol_name); -+ tmp.symbol_name); - } - } - break; -@@ -366,8 +381,12 @@ - bfd_vma ATTRIBUTE_UNUSED sec_vma - = tls_sec->output_section->vma; - -+ struct arc_static_sym_data tmp = -+ get_static_sym_data (r_symndx, local_syms, local_sections, -+ h, reloc_data); -+ - bfd_put_32 (output_bfd, -- sym_value - sec_vma -+ tmp.sym_value - sec_vma - + (elf_hash_table (info)->dynamic_sections_created - ? 0 - : (align_power (TCB_SIZE, -@@ -386,7 +405,7 @@ - + entry->offset - + (entry->existing_entries == TLS_GOT_MOD_AND_OFF - ? 4 : 0)), -- symbol_name); -+ tmp.symbol_name); - } - break; - -@@ -415,7 +434,8 @@ - "@ %#08lx for sym %s in got offset %#lx\n", - (long) (reloc_data->sym_value + sec_vma), - (long) (htab->sgot->output_section->vma -- + htab->sgot->output_offset + entry->offset), -+ + htab->sgot->output_offset -+ + entry->offset), - symbol_name, - (long) entry->offset); - } ---- /dev/null -+++ b/ld/testsuite/ld-arc/got-weak.d -@@ -0,0 +1,12 @@ -+#source: got-weak.s -+#as: -+#ld: -Bstatic -+#objdump: -d -+ -+[^:]*: file format elf32-.*arc -+ -+ -+Disassembly of section \.text: -+ -+00000100 <.*>: -+ 100: 2730 7f80 0000 2014 ld r0,\[pcl,0x2014\].* ---- /dev/null -+++ b/ld/testsuite/ld-arc/got-weak.s -@@ -0,0 +1,7 @@ -+ .cpu archs -+ -+ .weak symb -+ .global __start -+ .text -+__start: -+ ld r0,[pcl,@symb@gotpc] diff --git a/packages/binutils/2.37/0009-change-uint-to-unsigned.patch b/packages/binutils/2.37/0009-change-uint-to-unsigned.patch new file mode 100644 index 00000000..016016eb --- /dev/null +++ b/packages/binutils/2.37/0009-change-uint-to-unsigned.patch @@ -0,0 +1,52 @@ +From 999566402e3d7c69032bbf47e28b44fc0926fe62 Mon Sep 17 00:00:00 2001 +From: Christopher Wellons +Date: Sun, 18 Jul 2021 16:57:19 -0400 +Subject: [PATCH] Change "uint" to "unsigned" + +This fixes a defect introduced in 25162c795. The "uint" type has not +been explicitly defined here on mingw, causing compilation to fail. + +On linux we have this in /usr/include/sys/types.h + +/* Old compatibility names for C types. */ +typedef unsigned long int ulong; +typedef unsigned short int ushort; +typedef unsigned int uint; + +So it's easy to see how such bugs can creep in. + + * rust-demangle.c (struct rust_demangler): Change type of + "recursion" to unsigned. + (RUST_NO_RECURSION_LIMIT): Similarly in cast. +--- + libiberty/ChangeLog | 6 ++++++ + libiberty/rust-demangle.c | 4 ++-- + 2 files changed, 8 insertions(+), 2 deletions(-) + +--- a/libiberty/ChangeLog ++++ b/libiberty/ChangeLog +@@ -1,3 +1,9 @@ ++2021-07-19 Christopher Wellons ++ ++ * rust-demangle.c (struct rust_demangler): Change type of ++ "recursion" to unsigned. ++ (RUST_NO_RECURSION_LIMIT): Similarly in cast. ++ + 2021-07-15 Nick Clifton + + PR 99935 +--- a/libiberty/rust-demangle.c ++++ b/libiberty/rust-demangle.c +@@ -75,10 +75,10 @@ + int version; + + /* Recursion depth. */ +- uint recursion; ++ unsigned recursion; + /* Maximum number of times demangle_path may be called recursively. */ + #define RUST_MAX_RECURSION_COUNT 1024 +-#define RUST_NO_RECURSION_LIMIT ((uint) -1) ++#define RUST_NO_RECURSION_LIMIT ((unsigned) -1) + + uint64_t bound_lifetime_depth; + }; diff --git a/packages/binutils/2.37/0010-bfd-close-the-file-descriptor-if-there-is-no-archive-fd.patch b/packages/binutils/2.37/0010-bfd-close-the-file-descriptor-if-there-is-no-archive-fd.patch new file mode 100644 index 00000000..1fe3d9c4 --- /dev/null +++ b/packages/binutils/2.37/0010-bfd-close-the-file-descriptor-if-there-is-no-archive-fd.patch @@ -0,0 +1,201 @@ +From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Mon, 26 Jul 2021 05:59:55 -0700 +Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd + +Close the file descriptor if there is no archive plugin file descriptor +to avoid running out of file descriptors on thin archives with many +archive members. + +bfd/ + + PR ld/28138 + * plugin.c (bfd_plugin_close_file_descriptor): Close the file + descriptor there is no archive plugin file descriptor. + +ld/ + + PR ld/28138 + * testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for + native build. + + PR ld/28138 + * testsuite/ld-plugin/lto.exp: Run ld/28138 tests. + * testsuite/ld-plugin/pr28138.c: New file. + * testsuite/ld-plugin/pr28138-1.c: Likewise. + * testsuite/ld-plugin/pr28138-2.c: Likewise. + * testsuite/ld-plugin/pr28138-3.c: Likewise. + * testsuite/ld-plugin/pr28138-4.c: Likewise. + * testsuite/ld-plugin/pr28138-5.c: Likewise. + * testsuite/ld-plugin/pr28138-6.c: Likewise. + * testsuite/ld-plugin/pr28138-7.c: Likewise. + +(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742) +(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2) +--- + bfd/plugin.c | 8 ++++++++ + ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++++++ + ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++++ + 10 files changed, 104 insertions(+) + create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c + create mode 100644 ld/testsuite/ld-plugin/pr28138.c + +--- a/bfd/plugin.c ++++ b/bfd/plugin.c +@@ -291,6 +291,14 @@ + && !bfd_is_thin_archive (abfd->my_archive)) + abfd = abfd->my_archive; + ++ /* Close the file descriptor if there is no archive plugin file ++ descriptor. */ ++ if (abfd->archive_plugin_fd == -1) ++ { ++ close (fd); ++ return; ++ } ++ + abfd->archive_plugin_fd_open_count--; + /* Dup the archive plugin file descriptor for later use, which + will be closed by _bfd_archive_close_and_cleanup. */ +--- a/ld/testsuite/ld-plugin/lto.exp ++++ b/ld/testsuite/ld-plugin/lto.exp +@@ -687,6 +687,40 @@ + } + } + ++run_cc_link_tests [list \ ++ [list \ ++ "Build pr28138.a" \ ++ "-T" "" \ ++ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \ ++ pr28138-6.c pr28138-7.c} {} "pr28138.a" \ ++ ] \ ++ [list \ ++ "Build pr28138.o" \ ++ "" "" \ ++ {pr28138.c} {} \ ++ ] \ ++] ++ ++set exec_output [run_host_cmd "sh" \ ++ "-c \"ulimit -n 20; \ ++ $CC -Btmpdir/ld -o tmpdir/pr28138 \ ++ tmpdir/pr28138.o tmpdir/pr28138.a\""] ++set exec_output [prune_warnings $exec_output] ++if [string match "" $exec_output] then { ++ if { [isnative] } { ++ set exec_output [run_host_cmd "tmpdir/pr28138" ""] ++ if [string match "PASS" $exec_output] then { ++ pass "PR ld/28138" ++ } else { ++ fail "PR ld/28138" ++ } ++ } else { ++ pass "PR ld/28138" ++ } ++} else { ++ fail "PR ld/28138" ++} ++ + set testname "Build liblto-11.a" + remote_file host delete "tmpdir/liblto-11.a" + set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"] +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-1.c +@@ -0,0 +1,6 @@ ++extern int a0(void); ++int ++a1(void) ++{ ++ return 1 + a0(); ++} +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-2.c +@@ -0,0 +1,6 @@ ++extern int a1(void); ++int ++a2(void) ++{ ++ return 1 + a1(); ++} +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-3.c +@@ -0,0 +1,6 @@ ++extern int a2(void); ++int ++a3(void) ++{ ++ return 1 + a2(); ++} +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-4.c +@@ -0,0 +1,6 @@ ++extern int a3(void); ++int ++a4(void) ++{ ++ return 1 + a3(); ++} +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-5.c +@@ -0,0 +1,6 @@ ++extern int a4(void); ++int ++a5(void) ++{ ++ return 1 + a4(); ++} +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-6.c +@@ -0,0 +1,6 @@ ++extern int a5(void); ++int ++a6(void) ++{ ++ return 1 + a5(); ++} +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-7.c +@@ -0,0 +1,6 @@ ++extern int a6(void); ++int ++a7(void) ++{ ++ return 1 + a6(); ++} +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138.c +@@ -0,0 +1,20 @@ ++#include ++ ++extern int a7(void); ++ ++int ++a0(void) ++{ ++ return 0; ++} ++ ++int ++main() ++{ ++ if (a7() == 7) ++ { ++ printf ("PASS\n"); ++ return 0; ++ } ++ return 1; ++} diff --git a/packages/binutils/2.37/0010-change-uint-to-unsigned.patch b/packages/binutils/2.37/0010-change-uint-to-unsigned.patch deleted file mode 100644 index d44b12e7..00000000 --- a/packages/binutils/2.37/0010-change-uint-to-unsigned.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 999566402e3d7c69032bbf47e28b44fc0926fe62 Mon Sep 17 00:00:00 2001 -From: Christopher Wellons -Date: Sun, 18 Jul 2021 16:57:19 -0400 -Subject: [PATCH] Change "uint" to "unsigned" - -This fixes a defect introduced in 25162c795. The "uint" type has not -been explicitly defined here on mingw, causing compilation to fail. - -On linux we have this in /usr/include/sys/types.h - -/* Old compatibility names for C types. */ -typedef unsigned long int ulong; -typedef unsigned short int ushort; -typedef unsigned int uint; - -So it's easy to see how such bugs can creep in. - - * rust-demangle.c (struct rust_demangler): Change type of - "recursion" to unsigned. - (RUST_NO_RECURSION_LIMIT): Similarly in cast. ---- - libiberty/ChangeLog | 6 ++++++ - libiberty/rust-demangle.c | 4 ++-- - 2 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog -index 8e39fd28eba8..3f749455f05d 100644 ---- a/libiberty/ChangeLog -+++ b/libiberty/ChangeLog -@@ -1,3 +1,9 @@ -+2021-07-19 Christopher Wellons -+ -+ * rust-demangle.c (struct rust_demangler): Change type of -+ "recursion" to unsigned. -+ (RUST_NO_RECURSION_LIMIT): Similarly in cast. -+ - 2021-07-15 Nick Clifton - - PR 99935 -diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c -index df09b7b8fddb..ac1eb8eb02c6 100644 ---- a/libiberty/rust-demangle.c -+++ b/libiberty/rust-demangle.c -@@ -75,10 +75,10 @@ struct rust_demangler - int version; - - /* Recursion depth. */ -- uint recursion; -+ unsigned recursion; - /* Maximum number of times demangle_path may be called recursively. */ - #define RUST_MAX_RECURSION_COUNT 1024 --#define RUST_NO_RECURSION_LIMIT ((uint) -1) -+#define RUST_NO_RECURSION_LIMIT ((unsigned) -1) - - uint64_t bound_lifetime_depth; - }; diff --git a/packages/binutils/2.37/0011-bfd-close-the-file-descriptor-if-there-is-no-archive-fd.patch b/packages/binutils/2.37/0011-bfd-close-the-file-descriptor-if-there-is-no-archive-fd.patch deleted file mode 100644 index 192d4e02..00000000 --- a/packages/binutils/2.37/0011-bfd-close-the-file-descriptor-if-there-is-no-archive-fd.patch +++ /dev/null @@ -1,232 +0,0 @@ -From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" -Date: Mon, 26 Jul 2021 05:59:55 -0700 -Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd - -Close the file descriptor if there is no archive plugin file descriptor -to avoid running out of file descriptors on thin archives with many -archive members. - -bfd/ - - PR ld/28138 - * plugin.c (bfd_plugin_close_file_descriptor): Close the file - descriptor there is no archive plugin file descriptor. - -ld/ - - PR ld/28138 - * testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for - native build. - - PR ld/28138 - * testsuite/ld-plugin/lto.exp: Run ld/28138 tests. - * testsuite/ld-plugin/pr28138.c: New file. - * testsuite/ld-plugin/pr28138-1.c: Likewise. - * testsuite/ld-plugin/pr28138-2.c: Likewise. - * testsuite/ld-plugin/pr28138-3.c: Likewise. - * testsuite/ld-plugin/pr28138-4.c: Likewise. - * testsuite/ld-plugin/pr28138-5.c: Likewise. - * testsuite/ld-plugin/pr28138-6.c: Likewise. - * testsuite/ld-plugin/pr28138-7.c: Likewise. - -(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742) -(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2) ---- - bfd/plugin.c | 8 +++++++ - ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++ - ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++ - ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++ - 10 files changed, 104 insertions(+) - create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c - create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c - create mode 100644 ld/testsuite/ld-plugin/pr28138.c - -diff --git a/bfd/plugin.c b/bfd/plugin.c -index 6cfa2b66470..3bab8febe88 100644 ---- a/bfd/plugin.c -+++ b/bfd/plugin.c -@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd) - && !bfd_is_thin_archive (abfd->my_archive)) - abfd = abfd->my_archive; - -+ /* Close the file descriptor if there is no archive plugin file -+ descriptor. */ -+ if (abfd->archive_plugin_fd == -1) -+ { -+ close (fd); -+ return; -+ } -+ - abfd->archive_plugin_fd_open_count--; - /* Dup the archive plugin file descriptor for later use, which - will be closed by _bfd_archive_close_and_cleanup. */ -diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp -index def69e43ab3..999d911ce6a 100644 ---- a/ld/testsuite/ld-plugin/lto.exp -+++ b/ld/testsuite/ld-plugin/lto.exp -@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } { - } - } - -+run_cc_link_tests [list \ -+ [list \ -+ "Build pr28138.a" \ -+ "-T" "" \ -+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \ -+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \ -+ ] \ -+ [list \ -+ "Build pr28138.o" \ -+ "" "" \ -+ {pr28138.c} {} \ -+ ] \ -+] -+ -+set exec_output [run_host_cmd "sh" \ -+ "-c \"ulimit -n 20; \ -+ $CC -Btmpdir/ld -o tmpdir/pr28138 \ -+ tmpdir/pr28138.o tmpdir/pr28138.a\""] -+set exec_output [prune_warnings $exec_output] -+if [string match "" $exec_output] then { -+ if { [isnative] } { -+ set exec_output [run_host_cmd "tmpdir/pr28138" ""] -+ if [string match "PASS" $exec_output] then { -+ pass "PR ld/28138" -+ } else { -+ fail "PR ld/28138" -+ } -+ } else { -+ pass "PR ld/28138" -+ } -+} else { -+ fail "PR ld/28138" -+} -+ - set testname "Build liblto-11.a" - remote_file host delete "tmpdir/liblto-11.a" - set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"] -diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c -new file mode 100644 -index 00000000000..51d119e1642 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-1.c -@@ -0,0 +1,6 @@ -+extern int a0(void); -+int -+a1(void) -+{ -+ return 1 + a0(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c -new file mode 100644 -index 00000000000..1120cd797e9 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-2.c -@@ -0,0 +1,6 @@ -+extern int a1(void); -+int -+a2(void) -+{ -+ return 1 + a1(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c -new file mode 100644 -index 00000000000..ec464947ee6 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-3.c -@@ -0,0 +1,6 @@ -+extern int a2(void); -+int -+a3(void) -+{ -+ return 1 + a2(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c -new file mode 100644 -index 00000000000..475701b2c5c ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-4.c -@@ -0,0 +1,6 @@ -+extern int a3(void); -+int -+a4(void) -+{ -+ return 1 + a3(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c -new file mode 100644 -index 00000000000..e24f86c363e ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-5.c -@@ -0,0 +1,6 @@ -+extern int a4(void); -+int -+a5(void) -+{ -+ return 1 + a4(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c -new file mode 100644 -index 00000000000..b5b938bdb21 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-6.c -@@ -0,0 +1,6 @@ -+extern int a5(void); -+int -+a6(void) -+{ -+ return 1 + a5(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c -new file mode 100644 -index 00000000000..4ef75bf0f0c ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-7.c -@@ -0,0 +1,6 @@ -+extern int a6(void); -+int -+a7(void) -+{ -+ return 1 + a6(); -+} -diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c -new file mode 100644 -index 00000000000..68252c9f382 ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138.c -@@ -0,0 +1,20 @@ -+#include -+ -+extern int a7(void); -+ -+int -+a0(void) -+{ -+ return 0; -+} -+ -+int -+main() -+{ -+ if (a7() == 7) -+ { -+ printf ("PASS\n"); -+ return 0; -+ } -+ return 1; -+} --- -2.27.0 - diff --git a/packages/binutils/2.37/0011-pr28391-strip-objcopy-preserve-dates-a-cannot-set-time.patch b/packages/binutils/2.37/0011-pr28391-strip-objcopy-preserve-dates-a-cannot-set-time.patch new file mode 100644 index 00000000..de54af37 --- /dev/null +++ b/packages/binutils/2.37/0011-pr28391-strip-objcopy-preserve-dates-a-cannot-set-time.patch @@ -0,0 +1,44 @@ +From 6b02746a0e29b1007efd4feb137e2da3e681fc68 Mon Sep 17 00:00:00 2001 +From: Gleb Fotengauer-Malinovskiy +Date: Tue, 28 Sep 2021 20:11:26 +0930 +Subject: [PATCH] PR28391, strip/objcopy --preserve-dates *.a: cannot set time + +After commit 985e0264516 copy_archive function began to pass invalid +values to the utimensat(2) function when it tries to preserve +timestamps in ar archives. This happens because the bfd_stat_arch_elt +implementation for ar archives fills only the st_mtim.tv_sec part of +the st_mtim timespec structure, but leaves the st_mtim.tv_nsec part +and the whole st_atim timespec untouched leaving them uninitialized + + PR 28391 + * ar.c (extract_file): Clear buf for preserve_dates. + * objcopy.c (copy_archive): Likewise. + +(cherry picked from commit 0d62064867c74286360e821b75ef6799bedc4b34) +--- + binutils/ar.c | 3 +++ + binutils/objcopy.c | 1 + + 2 files changed, 4 insertions(+) + +--- a/binutils/ar.c ++++ b/binutils/ar.c +@@ -1180,6 +1180,9 @@ + bfd_size_type size; + struct stat buf; + ++ if (preserve_dates) ++ memset (&buf, 0, sizeof (buf)); ++ + if (bfd_stat_arch_elt (abfd, &buf) != 0) + /* xgettext:c-format */ + fatal (_("internal stat error on %s"), bfd_get_filename (abfd)); +--- a/binutils/objcopy.c ++++ b/binutils/objcopy.c +@@ -3600,6 +3600,7 @@ + + if (preserve_dates) + { ++ memset (&buf, 0, sizeof (buf)); + stat_status = bfd_stat_arch_elt (this_element, &buf); + + if (stat_status != 0) diff --git a/packages/binutils/2.37/0012-ld-pru-fix-resource_table-output-section-alignment.patch b/packages/binutils/2.37/0012-ld-pru-fix-resource_table-output-section-alignment.patch new file mode 100644 index 00000000..863253e9 --- /dev/null +++ b/packages/binutils/2.37/0012-ld-pru-fix-resource_table-output-section-alignment.patch @@ -0,0 +1,53 @@ +From a9c3934f6cb4407c5aaae82ada3b859d8ca9df83 Mon Sep 17 00:00:00 2001 +From: Dimitar Dimitrov +Date: Mon, 27 Sep 2021 22:43:24 +0300 +Subject: [PATCH] ld: pru: Fix resource_table output section alignment + +My commit 261980de18b added alignment for the resource table symbol. +But it is wrong. The Linux remoteproc driver loads and interprets the +contents of the .resource_table ELF section, not of a table symbol. + +Without this patch, if the linker happens to output padding for symbol +alignment, then the resource table contents as viewed by the kernel +loader would "shift" and look corrupted. + +ld/ChangeLog: + + * scripttempl/pru.sc (.resource_table): Align the output + section, not the first symbol. + +Signed-off-by: Dimitar Dimitrov +(cherry picked from commit 5109a7bd9b87bdad530f2ebf97036e6087b4504d) +--- + ld/ChangeLog | 5 +++++ + ld/scripttempl/pru.sc | 7 +++---- + 2 files changed, 8 insertions(+), 4 deletions(-) + +--- a/ld/ChangeLog ++++ b/ld/ChangeLog +@@ -1,3 +1,8 @@ ++2021-09-30 Dimitar Dimitrov ++ ++ * scripttempl/pru.sc (.resource_table): Align the output ++ section, not the first symbol. ++ + 2021-07-18 Nick Clifton + + * 2.37 release. +--- a/ld/scripttempl/pru.sc ++++ b/ld/scripttempl/pru.sc +@@ -151,11 +151,10 @@ + ${RELOCATING+ PROVIDE (_data_end = .) ; } + } ${RELOCATING+ > dmem } + +- .resource_table ${RELOCATING-0} : ++ /* Linux remoteproc loader requires the resource_table section ++ start address to be aligned to 8 bytes. */ ++ .resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN(8)} : + { +- /* Linux remoteproc loader requires the resource table address +- to be aligned to 8 bytes. */ +- ${RELOCATING+. = ALIGN(8);} + KEEP (*(.resource_table)) + } ${RELOCATING+ > dmem} + diff --git a/packages/binutils/2.37/0012-pr28391-strip-objcopy-preserve-dates-a-cannot-set-time.patch b/packages/binutils/2.37/0012-pr28391-strip-objcopy-preserve-dates-a-cannot-set-time.patch deleted file mode 100644 index f7b5221f..00000000 --- a/packages/binutils/2.37/0012-pr28391-strip-objcopy-preserve-dates-a-cannot-set-time.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 6b02746a0e29b1007efd4feb137e2da3e681fc68 Mon Sep 17 00:00:00 2001 -From: Gleb Fotengauer-Malinovskiy -Date: Tue, 28 Sep 2021 20:11:26 +0930 -Subject: [PATCH] PR28391, strip/objcopy --preserve-dates *.a: cannot set time - -After commit 985e0264516 copy_archive function began to pass invalid -values to the utimensat(2) function when it tries to preserve -timestamps in ar archives. This happens because the bfd_stat_arch_elt -implementation for ar archives fills only the st_mtim.tv_sec part of -the st_mtim timespec structure, but leaves the st_mtim.tv_nsec part -and the whole st_atim timespec untouched leaving them uninitialized - - PR 28391 - * ar.c (extract_file): Clear buf for preserve_dates. - * objcopy.c (copy_archive): Likewise. - -(cherry picked from commit 0d62064867c74286360e821b75ef6799bedc4b34) ---- - binutils/ar.c | 3 +++ - binutils/objcopy.c | 1 + - 2 files changed, 4 insertions(+) - -diff --git a/binutils/ar.c b/binutils/ar.c -index 5d6976c7027..8885585ef75 100644 ---- a/binutils/ar.c -+++ b/binutils/ar.c -@@ -1180,6 +1180,9 @@ extract_file (bfd *abfd) - bfd_size_type size; - struct stat buf; - -+ if (preserve_dates) -+ memset (&buf, 0, sizeof (buf)); -+ - if (bfd_stat_arch_elt (abfd, &buf) != 0) - /* xgettext:c-format */ - fatal (_("internal stat error on %s"), bfd_get_filename (abfd)); -diff --git a/binutils/objcopy.c b/binutils/objcopy.c -index a6c2e0dcc26..fd7557fe433 100644 ---- a/binutils/objcopy.c -+++ b/binutils/objcopy.c -@@ -3600,6 +3600,7 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, - - if (preserve_dates) - { -+ memset (&buf, 0, sizeof (buf)); - stat_status = bfd_stat_arch_elt (this_element, &buf); - - if (stat_status != 0) --- -2.27.0 - diff --git a/packages/binutils/2.37/0013-ld-pru-fix-resource_table-output-section-alignment.patch b/packages/binutils/2.37/0013-ld-pru-fix-resource_table-output-section-alignment.patch deleted file mode 100644 index 58921f1e..00000000 --- a/packages/binutils/2.37/0013-ld-pru-fix-resource_table-output-section-alignment.patch +++ /dev/null @@ -1,60 +0,0 @@ -From a9c3934f6cb4407c5aaae82ada3b859d8ca9df83 Mon Sep 17 00:00:00 2001 -From: Dimitar Dimitrov -Date: Mon, 27 Sep 2021 22:43:24 +0300 -Subject: [PATCH] ld: pru: Fix resource_table output section alignment - -My commit 261980de18b added alignment for the resource table symbol. -But it is wrong. The Linux remoteproc driver loads and interprets the -contents of the .resource_table ELF section, not of a table symbol. - -Without this patch, if the linker happens to output padding for symbol -alignment, then the resource table contents as viewed by the kernel -loader would "shift" and look corrupted. - -ld/ChangeLog: - - * scripttempl/pru.sc (.resource_table): Align the output - section, not the first symbol. - -Signed-off-by: Dimitar Dimitrov -(cherry picked from commit 5109a7bd9b87bdad530f2ebf97036e6087b4504d) ---- - ld/ChangeLog | 5 +++++ - ld/scripttempl/pru.sc | 7 +++---- - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/ld/ChangeLog b/ld/ChangeLog -index 5048b5b6a17..ee3259a06de 100644 ---- a/ld/ChangeLog -+++ b/ld/ChangeLog -@@ -1,3 +1,8 @@ -+2021-09-30 Dimitar Dimitrov -+ -+ * scripttempl/pru.sc (.resource_table): Align the output -+ section, not the first symbol. -+ - 2021-07-18 Nick Clifton - - * 2.37 release. -diff --git a/ld/scripttempl/pru.sc b/ld/scripttempl/pru.sc -index b2c941b7911..97d8be0a0a4 100644 ---- a/ld/scripttempl/pru.sc -+++ b/ld/scripttempl/pru.sc -@@ -151,11 +151,10 @@ SECTIONS - ${RELOCATING+ PROVIDE (_data_end = .) ; } - } ${RELOCATING+ > dmem } - -- .resource_table ${RELOCATING-0} : -+ /* Linux remoteproc loader requires the resource_table section -+ start address to be aligned to 8 bytes. */ -+ .resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN(8)} : - { -- /* Linux remoteproc loader requires the resource table address -- to be aligned to 8 bytes. */ -- ${RELOCATING+. = ALIGN(8);} - KEEP (*(.resource_table)) - } ${RELOCATING+ > dmem} - --- -2.27.0 - diff --git a/packages/binutils/2.37/0013-pr28422-build_id-use-after-free.patch b/packages/binutils/2.37/0013-pr28422-build_id-use-after-free.patch new file mode 100644 index 00000000..97308cad --- /dev/null +++ b/packages/binutils/2.37/0013-pr28422-build_id-use-after-free.patch @@ -0,0 +1,26 @@ +From c20c7adbeaa3af18a58ba1e20e6c33e7186356e3 Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Wed, 6 Oct 2021 18:28:47 +1030 +Subject: [PATCH] PR28422, build_id use-after-free + +This fixes a bug in commit 5d9bbb73c1df. All fields preserved from a +bfd in struct bfd_preserve need to be cleared in bfd_reinit. + + PR 28422 + * format.c (bfd_reinit): Clear build_id. + +(cherry picked from commit 6d661cdc5be46e890ed9255e749806f46a88e26c) +--- + bfd/format.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/bfd/format.c ++++ b/bfd/format.c +@@ -151,6 +151,7 @@ + abfd->tdata.any = NULL; + abfd->arch_info = &bfd_default_arch_struct; + abfd->flags &= BFD_FLAGS_SAVED; ++ abfd->build_id = NULL; + bfd_section_list_clear (abfd); + } + diff --git a/packages/binutils/2.37/0014-pr28422-build_id-use-after-free.patch b/packages/binutils/2.37/0014-pr28422-build_id-use-after-free.patch deleted file mode 100644 index 5f6c81ae..00000000 --- a/packages/binutils/2.37/0014-pr28422-build_id-use-after-free.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c20c7adbeaa3af18a58ba1e20e6c33e7186356e3 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Wed, 6 Oct 2021 18:28:47 +1030 -Subject: [PATCH] PR28422, build_id use-after-free - -This fixes a bug in commit 5d9bbb73c1df. All fields preserved from a -bfd in struct bfd_preserve need to be cleared in bfd_reinit. - - PR 28422 - * format.c (bfd_reinit): Clear build_id. - -(cherry picked from commit 6d661cdc5be46e890ed9255e749806f46a88e26c) ---- - bfd/format.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/bfd/format.c b/bfd/format.c -index 5d08d1d642c..408c984690e 100644 ---- a/bfd/format.c -+++ b/bfd/format.c -@@ -151,6 +151,7 @@ bfd_reinit (bfd *abfd, unsigned int section_id, bfd_cleanup cleanup) - abfd->tdata.any = NULL; - abfd->arch_info = &bfd_default_arch_struct; - abfd->flags &= BFD_FLAGS_SAVED; -+ abfd->build_id = NULL; - bfd_section_list_clear (abfd); - } - --- -2.27.0 - diff --git a/packages/binutils/2.37/0014-pr28459-readelf-issues-bogus-warning.patch b/packages/binutils/2.37/0014-pr28459-readelf-issues-bogus-warning.patch new file mode 100644 index 00000000..0a1d6d7b --- /dev/null +++ b/packages/binutils/2.37/0014-pr28459-readelf-issues-bogus-warning.patch @@ -0,0 +1,35 @@ +From 61b08178e4cafca911bf909f54f8c373f16f0a70 Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Sun, 17 Oct 2021 17:34:46 +1030 +Subject: [PATCH] PR28459, readelf issues bogus warning + +I'd missed the fact that the .debug_rnglists dump doesn't exactly +display the contents of the section. Instead readelf rummages through +.debug_info looking for DW_AT_ranges entries, then displays the +entries in .debug_rnglists pointed at, sorted. A simpler dump of the +actual section contents might be more useful and robust, but it was +likely done that way to detect overlap and holes. + +Anyway, the headers in .debug_rnglists besides the first are ignored, +and limiting to the unit length of the first header fails if there is +more than one unit. + + PR 28459 + * dwarf.c (display_debug_ranges): Don't constrain data to length + in header. + +(cherry picked from commit e7f024765a48fba4452535a5fc006a7e858730fd) +--- + binutils/dwarf.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/binutils/dwarf.c ++++ b/binutils/dwarf.c +@@ -7727,7 +7727,6 @@ + return 0; + } + } +- finish = start + initial_length; + + /* Get and check the version number. */ + SAFE_BYTE_GET_AND_INC (version, start, 2, finish); diff --git a/packages/binutils/2.37/0015-pr28417-std-string-no-longer-allows-accepting-nullptr_t.patch b/packages/binutils/2.37/0015-pr28417-std-string-no-longer-allows-accepting-nullptr_t.patch new file mode 100644 index 00000000..f26591ec --- /dev/null +++ b/packages/binutils/2.37/0015-pr28417-std-string-no-longer-allows-accepting-nullptr_t.patch @@ -0,0 +1,38 @@ +From 0effb90eb7c9a50408d98ce174f1b4bc5562f017 Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Wed, 20 Oct 2021 10:09:57 +1030 +Subject: [PATCH] PR28417, std::string no longer allows accepting nullptr_t + + PR 28417 + * incremental.cc (Sized_relobj_incr::do_section_name): Avoid + std:string undefined behaviour. + * options.h (Search_directory::Search_directory): Likewise. + +(cherry picked from commit 068a039b8bd7c7386bb0d88f0ae245b0fe4132e9) +--- + gold/incremental.cc | 2 +- + gold/options.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/gold/incremental.cc ++++ b/gold/incremental.cc +@@ -2280,7 +2280,7 @@ + const Output_sections& out_sections(this->output_sections()); + const Output_section* os = out_sections[shndx]; + if (os == NULL) +- return NULL; ++ return std::string(); + return os->name(); + } + +--- a/gold/options.h ++++ b/gold/options.h +@@ -611,7 +611,7 @@ + // We need a default constructor because we put this in a + // std::vector. + Search_directory() +- : name_(NULL), put_in_sysroot_(false), is_in_sysroot_(false) ++ : name_(), put_in_sysroot_(false), is_in_sysroot_(false) + { } + + // This is the usual constructor. diff --git a/packages/binutils/2.37/0015-pr28459-readelf-issues-bogus-warning.patch b/packages/binutils/2.37/0015-pr28459-readelf-issues-bogus-warning.patch deleted file mode 100644 index a8600290..00000000 --- a/packages/binutils/2.37/0015-pr28459-readelf-issues-bogus-warning.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 61b08178e4cafca911bf909f54f8c373f16f0a70 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Sun, 17 Oct 2021 17:34:46 +1030 -Subject: [PATCH] PR28459, readelf issues bogus warning - -I'd missed the fact that the .debug_rnglists dump doesn't exactly -display the contents of the section. Instead readelf rummages through -.debug_info looking for DW_AT_ranges entries, then displays the -entries in .debug_rnglists pointed at, sorted. A simpler dump of the -actual section contents might be more useful and robust, but it was -likely done that way to detect overlap and holes. - -Anyway, the headers in .debug_rnglists besides the first are ignored, -and limiting to the unit length of the first header fails if there is -more than one unit. - - PR 28459 - * dwarf.c (display_debug_ranges): Don't constrain data to length - in header. - -(cherry picked from commit e7f024765a48fba4452535a5fc006a7e858730fd) ---- - binutils/dwarf.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/binutils/dwarf.c b/binutils/dwarf.c -index 1e7f4db7b7c..e73078f496f 100644 ---- a/binutils/dwarf.c -+++ b/binutils/dwarf.c -@@ -7727,7 +7727,6 @@ display_debug_ranges (struct dwarf_section *section, - return 0; - } - } -- finish = start + initial_length; - - /* Get and check the version number. */ - SAFE_BYTE_GET_AND_INC (version, start, 2, finish); --- -2.27.0 - diff --git a/packages/binutils/2.37/0016-pr28417-std-string-no-longer-allows-accepting-nullptr_t.patch b/packages/binutils/2.37/0016-pr28417-std-string-no-longer-allows-accepting-nullptr_t.patch deleted file mode 100644 index 7fa92df3..00000000 --- a/packages/binutils/2.37/0016-pr28417-std-string-no-longer-allows-accepting-nullptr_t.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0effb90eb7c9a50408d98ce174f1b4bc5562f017 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Wed, 20 Oct 2021 10:09:57 +1030 -Subject: [PATCH] PR28417, std::string no longer allows accepting nullptr_t - - PR 28417 - * incremental.cc (Sized_relobj_incr::do_section_name): Avoid - std:string undefined behaviour. - * options.h (Search_directory::Search_directory): Likewise. - -(cherry picked from commit 068a039b8bd7c7386bb0d88f0ae245b0fe4132e9) ---- - gold/incremental.cc | 2 +- - gold/options.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gold/incremental.cc b/gold/incremental.cc -index 52941985e6f..327a1527a29 100644 ---- a/gold/incremental.cc -+++ b/gold/incremental.cc -@@ -2286,7 +2286,7 @@ Sized_relobj_incr::do_section_name(unsigned int shndx) const - const Output_sections& out_sections(this->output_sections()); - const Output_section* os = out_sections[shndx]; - if (os == NULL) -- return NULL; -+ return std::string(); - return os->name(); - } - -diff --git a/gold/options.h b/gold/options.h -index 757ebf18fec..47299a37834 100644 ---- a/gold/options.h -+++ b/gold/options.h -@@ -611,7 +611,7 @@ class Search_directory - // We need a default constructor because we put this in a - // std::vector. - Search_directory() -- : name_(NULL), put_in_sysroot_(false), is_in_sysroot_(false) -+ : name_(), put_in_sysroot_(false), is_in_sysroot_(false) - { } - - // This is the usual constructor. --- -2.27.0 - diff --git a/packages/binutils/2.37/0016-pr28540-segmentation-fault-on-NULL-byte_get.patch b/packages/binutils/2.37/0016-pr28540-segmentation-fault-on-NULL-byte_get.patch new file mode 100644 index 00000000..e0be9b7a --- /dev/null +++ b/packages/binutils/2.37/0016-pr28540-segmentation-fault-on-NULL-byte_get.patch @@ -0,0 +1,25 @@ +From 96eb21265ebffbc28f767bed9a2b7650ecb9818d Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Thu, 4 Nov 2021 14:11:02 +1030 +Subject: [PATCH] PR28540, segmentation fault on NULL byte_get + + PR 28540 + * objdump.c (dump_bfd): Don't attempt load_separate_debug_files + when byte_get is NULL. + +(cherry picked from commit f2f105f518413ea3e4c212f89585f9a8a5dddcdd) +--- + binutils/objdump.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/binutils/objdump.c ++++ b/binutils/objdump.c +@@ -4869,7 +4869,7 @@ + + The test on is_mainfile is there because the chain of separate debug + info files is a global variable shared by all invocations of dump_bfd. */ +- if (is_mainfile) ++ if (byte_get != NULL && is_mainfile) + { + load_separate_debug_files (abfd, bfd_get_filename (abfd)); + diff --git a/packages/binutils/2.37/0017-gold-place-note-gnu-property-section-before-other-note-sections.patch b/packages/binutils/2.37/0017-gold-place-note-gnu-property-section-before-other-note-sections.patch new file mode 100644 index 00000000..0063e0da --- /dev/null +++ b/packages/binutils/2.37/0017-gold-place-note-gnu-property-section-before-other-note-sections.patch @@ -0,0 +1,50 @@ +From bd711d6329ebb9328a99bd4be501932082248e44 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Mon, 25 Oct 2021 08:42:24 -0700 +Subject: [PATCH] gold: Place .note.gnu.property section before other note + sections + +Place the .note.gnu.property section before all other note sections to +avoid being placed between other note sections with different alignments. + + PR gold/28494 + * layout.cc (Layout::create_note): Set order to ORDER_PROPERTY_NOTE + for the .note.gnu.property section. + * layout.h (Output_section_order): Add ORDER_PROPERTY_NOTE. + +(cherry picked from commit f85dcfc3af9cf7c2859241253f1d37b1133abea2) +--- + gold/layout.cc | 3 ++- + gold/layout.h | 9 +++++++-- + 2 files changed, 9 insertions(+), 3 deletions(-) + +--- a/gold/layout.cc ++++ b/gold/layout.cc +@@ -3245,7 +3245,8 @@ + if (allocate) + { + flags = elfcpp::SHF_ALLOC; +- order = ORDER_RO_NOTE; ++ order = (note_type == elfcpp::NT_GNU_PROPERTY_TYPE_0 ++ ? ORDER_PROPERTY_NOTE : ORDER_RO_NOTE); + } + Output_section* os = this->choose_output_section(NULL, section_name, + elfcpp::SHT_NOTE, +--- a/gold/layout.h ++++ b/gold/layout.h +@@ -399,8 +399,13 @@ + // linker can pick it up quickly. + ORDER_INTERP, + +- // Loadable read-only note sections come next so that the PT_NOTE +- // segment is on the first page of the executable. ++ // The .note.gnu.property section comes next so that the PT_NOTE ++ // segment is on the first page of the executable and it won't be ++ // placed between other note sections with different alignments. ++ ORDER_PROPERTY_NOTE, ++ ++ // Loadable read-only note sections come after the .note.gnu.property ++ // section. + ORDER_RO_NOTE, + + // Put read-only sections used by the dynamic linker early in the diff --git a/packages/binutils/2.37/0017-pr28540-segmentation-fault-on-NULL-byte_get.patch b/packages/binutils/2.37/0017-pr28540-segmentation-fault-on-NULL-byte_get.patch deleted file mode 100644 index f7f26a7a..00000000 --- a/packages/binutils/2.37/0017-pr28540-segmentation-fault-on-NULL-byte_get.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 96eb21265ebffbc28f767bed9a2b7650ecb9818d Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Thu, 4 Nov 2021 14:11:02 +1030 -Subject: [PATCH] PR28540, segmentation fault on NULL byte_get - - PR 28540 - * objdump.c (dump_bfd): Don't attempt load_separate_debug_files - when byte_get is NULL. - -(cherry picked from commit f2f105f518413ea3e4c212f89585f9a8a5dddcdd) ---- - binutils/objdump.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/binutils/objdump.c b/binutils/objdump.c -index a7b8303b992..50317b3d48f 100644 ---- a/binutils/objdump.c -+++ b/binutils/objdump.c -@@ -4869,7 +4869,7 @@ dump_bfd (bfd *abfd, bool is_mainfile) - - The test on is_mainfile is there because the chain of separate debug - info files is a global variable shared by all invocations of dump_bfd. */ -- if (is_mainfile) -+ if (byte_get != NULL && is_mainfile) - { - load_separate_debug_files (abfd, bfd_get_filename (abfd)); - --- -2.27.0 - diff --git a/packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch b/packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch deleted file mode 100644 index 9b53a902..00000000 --- a/packages/binutils/2.37/0018-gold-place-note-gnu-property-section-before-other-note-sections.patch +++ /dev/null @@ -1,57 +0,0 @@ -From bd711d6329ebb9328a99bd4be501932082248e44 Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" -Date: Mon, 25 Oct 2021 08:42:24 -0700 -Subject: [PATCH] gold: Place .note.gnu.property section before other note - sections - -Place the .note.gnu.property section before all other note sections to -avoid being placed between other note sections with different alignments. - - PR gold/28494 - * layout.cc (Layout::create_note): Set order to ORDER_PROPERTY_NOTE - for the .note.gnu.property section. - * layout.h (Output_section_order): Add ORDER_PROPERTY_NOTE. - -(cherry picked from commit f85dcfc3af9cf7c2859241253f1d37b1133abea2) ---- - gold/layout.cc | 3 ++- - gold/layout.h | 9 +++++++-- - 2 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/gold/layout.cc b/gold/layout.cc -index a27cb071c75..38e9bceec7e 100644 ---- a/gold/layout.cc -+++ b/gold/layout.cc -@@ -3245,7 +3245,8 @@ Layout::create_note(const char* name, int note_type, - if (allocate) - { - flags = elfcpp::SHF_ALLOC; -- order = ORDER_RO_NOTE; -+ order = (note_type == elfcpp::NT_GNU_PROPERTY_TYPE_0 -+ ? ORDER_PROPERTY_NOTE : ORDER_RO_NOTE); - } - Output_section* os = this->choose_output_section(NULL, section_name, - elfcpp::SHT_NOTE, -diff --git a/gold/layout.h b/gold/layout.h -index 0b378003679..05c31714e47 100644 ---- a/gold/layout.h -+++ b/gold/layout.h -@@ -399,8 +399,13 @@ enum Output_section_order - // linker can pick it up quickly. - ORDER_INTERP, - -- // Loadable read-only note sections come next so that the PT_NOTE -- // segment is on the first page of the executable. -+ // The .note.gnu.property section comes next so that the PT_NOTE -+ // segment is on the first page of the executable and it won't be -+ // placed between other note sections with different alignments. -+ ORDER_PROPERTY_NOTE, -+ -+ // Loadable read-only note sections come after the .note.gnu.property -+ // section. - ORDER_RO_NOTE, - - // Put read-only sections used by the dynamic linker early in the --- -2.27.0 - diff --git a/packages/binutils/2.37/0018-waddress-warning-in-ldelf.c.patch b/packages/binutils/2.37/0018-waddress-warning-in-ldelf.c.patch new file mode 100644 index 00000000..685af62a --- /dev/null +++ b/packages/binutils/2.37/0018-waddress-warning-in-ldelf.c.patch @@ -0,0 +1,31 @@ +From c912b88e003a43e10020f56675fbd7e180d255ab Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Thu, 21 Oct 2021 19:18:34 +1030 +Subject: [PATCH] -Waddress warning in ldelf.c + +ldelf.c: In function 'ldelf_after_open': +ldelf.c:1049:43: warning: the comparison will always evaluate as 'true' for the address of 'elf_header' will never be NULL [-Waddress] + 1049 | && elf_tdata (abfd)->elf_header != NULL + | ^~ +In file included from ldelf.c:37: +../bfd/elf-bfd.h:1957:21: note: 'elf_header' declared here + 1957 | Elf_Internal_Ehdr elf_header[1]; /* Actual data, but ref like ptr */ + + PR ld/28734 + * ldelf.c (ldelf_after_open): Remove useless elf_header test. + +(cherry picked from commit ced10cb78d01652f9e1bb1d1e465327dfe1debaa) +--- + ld/ldelf.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/ld/ldelf.c ++++ b/ld/ldelf.c +@@ -1046,7 +1046,6 @@ + if (abfd->xvec->flavour == bfd_target_elf_flavour + && !bfd_input_just_syms (abfd) + && elf_tdata (abfd) != NULL +- && elf_tdata (abfd)->elf_header != NULL + /* FIXME: Maybe check for other non-supportable types as well ? */ + && (elf_tdata (abfd)->elf_header->e_type == ET_EXEC + || (elf_tdata (abfd)->elf_header->e_type == ET_DYN diff --git a/packages/binutils/2.37/0019-waddress-warning-in-ldelf.c.patch b/packages/binutils/2.37/0019-waddress-warning-in-ldelf.c.patch deleted file mode 100644 index 40918067..00000000 --- a/packages/binutils/2.37/0019-waddress-warning-in-ldelf.c.patch +++ /dev/null @@ -1,36 +0,0 @@ -From c912b88e003a43e10020f56675fbd7e180d255ab Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Thu, 21 Oct 2021 19:18:34 +1030 -Subject: [PATCH] -Waddress warning in ldelf.c - -ldelf.c: In function 'ldelf_after_open': -ldelf.c:1049:43: warning: the comparison will always evaluate as 'true' for the address of 'elf_header' will never be NULL [-Waddress] - 1049 | && elf_tdata (abfd)->elf_header != NULL - | ^~ -In file included from ldelf.c:37: -../bfd/elf-bfd.h:1957:21: note: 'elf_header' declared here - 1957 | Elf_Internal_Ehdr elf_header[1]; /* Actual data, but ref like ptr */ - - PR ld/28734 - * ldelf.c (ldelf_after_open): Remove useless elf_header test. - -(cherry picked from commit ced10cb78d01652f9e1bb1d1e465327dfe1debaa) ---- - ld/ldelf.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/ld/ldelf.c b/ld/ldelf.c -index 21e655bb55c..0c39eb6024f 100644 ---- a/ld/ldelf.c -+++ b/ld/ldelf.c -@@ -1046,7 +1046,6 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd, - if (abfd->xvec->flavour == bfd_target_elf_flavour - && !bfd_input_just_syms (abfd) - && elf_tdata (abfd) != NULL -- && elf_tdata (abfd)->elf_header != NULL - /* FIXME: Maybe check for other non-supportable types as well ? */ - && (elf_tdata (abfd)->elf_header->e_type == ET_EXEC - || (elf_tdata (abfd)->elf_header->e_type == ET_DYN --- -2.27.0 - -- cgit v1.2.3