From 991bb2200d2b0d922a1d420129634a4a497ec28e Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Fri, 3 Jun 2022 09:42:16 +0200 Subject: [PATCH] initial package creation Signed-off-by: Toshaan Bharvani --- .../binutils-2.19.50.0.1-output-format.sed | 38 + .../binutils-2.20.51.0.2-libtool-lib64.patch | 236 ++ ...nutils-2.22.52.0.4-no-config-h-check.patch | 28 + SOURCES/binutils-2.25-version.patch | 44 + SOURCES/binutils-2.27-aarch64-ifunc.patch | 11 + ...tils-2.29-filename-in-error-messages.patch | 145 ++ .../binutils-2.29-revert-PLT-elision.patch | 265 +++ SOURCES/binutils-CVE-2019-1010204.patch | 15 + SOURCES/binutils-CVE-2020-35448.patch | 53 + SOURCES/binutils-CVE-2021-20197.patch | 1310 +++++++++++ SOURCES/binutils-CVE-2021-20284.patch | 58 + SOURCES/binutils-CVE-2021-3487.patch | 34 + SOURCES/binutils-SHF_LINK_ORDER.patch | 223 ++ .../binutils-aarch64-condbranch-relocs.patch | 93 + ...utils-add-sym-cache-to-elf-link-hash.patch | 1981 +++++++++++++++++ SOURCES/binutils-attach-to-group.patch | 70 + SOURCES/binutils-config.patch | 44 + ...ls-do-not-link-with-static-libstdc++.patch | 83 + SOURCES/binutils-duplicate-sections.patch | 34 + SOURCES/binutils-dwarf-5-dir0.patch | 186 ++ SOURCES/binutils-elf-add-objects.patch | 36 + SOURCES/binutils-export-demangle.h.patch | 33 + .../binutils-extend-s390-arch14-support.patch | 657 ++++++ SOURCES/binutils-fix-testsuite-failures.patch | 330 +++ SOURCES/binutils-gcc-10-fixes.patch | 180 ++ SOURCES/binutils-gold-gnu-properties.patch | 181 ++ ...nutils-gold-mismatched-section-flags.patch | 19 + SOURCES/binutils-gold-warn-unsupported.patch | 66 + SOURCES/binutils-ld-DWARF-5-sections.patch | 60 + SOURCES/binutils-plugin-as-needed.patch | 182 ++ .../binutils-ppc-annobin-disassembly.patch | 39 + SOURCES/binutils-ppc64le-note-merge.patch | 42 + SOURCES/binutils-readelf-no-warn-gaps.patch | 19 + SOURCES/binutils-readelf-other-sym-info.patch | 35 + ...nutils-recursive-debuglink-following.patch | 109 + SOURCES/binutils-s390-arch14-insns.patch | 109 + SOURCES/binutils-s390-build.patch | 772 +++++++ .../binutils-special-sections-in-groups.patch | 27 + SOURCES/binutils-strip-merge.patch | 19 + SOURCES/binutils-testsuite-failures.patch | 1207 ++++++++++ SOURCES/binutils-unexpected-form-20.patch | 10 + SOURCES/binutils-use-long-long.patch | 38 + SOURCES/binutils-warnings.patch | 158 ++ SPECS/cross-binutils.spec | 1179 ++++++++++ 44 files changed, 10458 insertions(+) create mode 100644 SOURCES/binutils-2.19.50.0.1-output-format.sed create mode 100644 SOURCES/binutils-2.20.51.0.2-libtool-lib64.patch create mode 100644 SOURCES/binutils-2.22.52.0.4-no-config-h-check.patch create mode 100644 SOURCES/binutils-2.25-version.patch create mode 100644 SOURCES/binutils-2.27-aarch64-ifunc.patch create mode 100644 SOURCES/binutils-2.29-filename-in-error-messages.patch create mode 100644 SOURCES/binutils-2.29-revert-PLT-elision.patch create mode 100644 SOURCES/binutils-CVE-2019-1010204.patch create mode 100644 SOURCES/binutils-CVE-2020-35448.patch create mode 100644 SOURCES/binutils-CVE-2021-20197.patch create mode 100644 SOURCES/binutils-CVE-2021-20284.patch create mode 100644 SOURCES/binutils-CVE-2021-3487.patch create mode 100644 SOURCES/binutils-SHF_LINK_ORDER.patch create mode 100644 SOURCES/binutils-aarch64-condbranch-relocs.patch create mode 100644 SOURCES/binutils-add-sym-cache-to-elf-link-hash.patch create mode 100644 SOURCES/binutils-attach-to-group.patch create mode 100644 SOURCES/binutils-config.patch create mode 100644 SOURCES/binutils-do-not-link-with-static-libstdc++.patch create mode 100644 SOURCES/binutils-duplicate-sections.patch create mode 100644 SOURCES/binutils-dwarf-5-dir0.patch create mode 100644 SOURCES/binutils-elf-add-objects.patch create mode 100644 SOURCES/binutils-export-demangle.h.patch create mode 100644 SOURCES/binutils-extend-s390-arch14-support.patch create mode 100644 SOURCES/binutils-fix-testsuite-failures.patch create mode 100644 SOURCES/binutils-gcc-10-fixes.patch create mode 100644 SOURCES/binutils-gold-gnu-properties.patch create mode 100644 SOURCES/binutils-gold-mismatched-section-flags.patch create mode 100644 SOURCES/binutils-gold-warn-unsupported.patch create mode 100644 SOURCES/binutils-ld-DWARF-5-sections.patch create mode 100644 SOURCES/binutils-plugin-as-needed.patch create mode 100644 SOURCES/binutils-ppc-annobin-disassembly.patch create mode 100644 SOURCES/binutils-ppc64le-note-merge.patch create mode 100644 SOURCES/binutils-readelf-no-warn-gaps.patch create mode 100644 SOURCES/binutils-readelf-other-sym-info.patch create mode 100644 SOURCES/binutils-recursive-debuglink-following.patch create mode 100644 SOURCES/binutils-s390-arch14-insns.patch create mode 100644 SOURCES/binutils-s390-build.patch create mode 100644 SOURCES/binutils-special-sections-in-groups.patch create mode 100644 SOURCES/binutils-strip-merge.patch create mode 100644 SOURCES/binutils-testsuite-failures.patch create mode 100644 SOURCES/binutils-unexpected-form-20.patch create mode 100644 SOURCES/binutils-use-long-long.patch create mode 100644 SOURCES/binutils-warnings.patch create mode 100644 SPECS/cross-binutils.spec diff --git a/SOURCES/binutils-2.19.50.0.1-output-format.sed b/SOURCES/binutils-2.19.50.0.1-output-format.sed new file mode 100644 index 0000000..fd770cb --- /dev/null +++ b/SOURCES/binutils-2.19.50.0.1-output-format.sed @@ -0,0 +1,38 @@ +# Generate OUTPUT_FORMAT line for .so files from the system linker output. +# Imported from glibc/Makerules. + +/ld.*[ ]-E[BL]/b f +/collect.*[ ]-E[BL]/b f +/OUTPUT_FORMAT[^)]*$/{N +s/\n[ ]*/ / +} +t o +: o +s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/ +t q +s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/ +t s +s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/ +t q +d +: s +s/"//g +G +s/\n// +s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p +s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p +s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p +/,/s|^|*** BUG in libc/scripts/output-format.sed *** |p +q +: q +s/"//g +p +q +: f +s/^.*[ ]-E\([BL]\)[ ].*$/,\1/ +t h +s/^.*[ ]-E\([BL]\)$/,\1/ +t h +d +: h +h diff --git a/SOURCES/binutils-2.20.51.0.2-libtool-lib64.patch b/SOURCES/binutils-2.20.51.0.2-libtool-lib64.patch new file mode 100644 index 0000000..142fc7e --- /dev/null +++ b/SOURCES/binutils-2.20.51.0.2-libtool-lib64.patch @@ -0,0 +1,236 @@ +diff -rcp ../binutils-2.20.51.0.7.original/bfd/configure ./bfd/configure +--- a/bfd/configure 2010-04-08 14:53:48.000000000 +0100 ++++ b/bfd/configure 2010-04-08 14:56:50.000000000 +0100 +@@ -10762,10 +10762,34 @@ + # before this can be enabled. + hardcode_into_libs=yes + ++ # find out which ABI we are using ++ libsuff= ++ case "$host_cpu" in ++ x86_64*|s390*|powerpc*|ppc*|sparc*) ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *64-bit*) ++ libsuff=64 ++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then ++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ++ fi ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ esac ++ + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +diff -rcp ../binutils-2.20.51.0.7.original/binutils/configure ./binutils/configure +--- a/binutils/configure 2010-04-08 14:53:45.000000000 +0100 ++++ b/binutils/configure 2010-04-08 14:56:21.000000000 +0100 +@@ -10560,10 +10560,34 @@ + # before this can be enabled. + hardcode_into_libs=yes + ++ # find out which ABI we are using ++ libsuff= ++ case "$host_cpu" in ++ x86_64*|s390*|powerpc*|ppc*|sparc*) ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *64-bit*) ++ libsuff=64 ++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then ++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ++ fi ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ esac ++ + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +diff -rcp ../binutils-2.20.51.0.7.original/gas/configure ./gas/configure +--- a/gas/configure 2010-04-08 14:53:47.000000000 +0100 ++++ b/gas/configure 2010-04-08 14:57:24.000000000 +0100 +@@ -10547,10 +10547,34 @@ + # before this can be enabled. + hardcode_into_libs=yes + ++ # find out which ABI we are using ++ libsuff= ++ case "$host_cpu" in ++ x86_64*|s390*|powerpc*|ppc*|sparc*) ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *64-bit*) ++ libsuff=64 ++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then ++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ++ fi ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ esac ++ + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +diff -rcp ../binutils-2.20.51.0.7.original/gprof/configure ./gprof/configure +--- a/gprof/configure 2010-04-08 14:53:45.000000000 +0100 ++++ b/gprof/configure 2010-04-08 14:57:50.000000000 +0100 +@@ -10485,10 +10485,34 @@ + # before this can be enabled. + hardcode_into_libs=yes + ++ # find out which ABI we are using ++ libsuff= ++ case "$host_cpu" in ++ x86_64*|s390*|powerpc*|ppc*|sparc*) ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *64-bit*) ++ libsuff=64 ++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then ++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ++ fi ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ esac ++ + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +diff -rcp ../binutils-2.20.51.0.7.original/ld/configure ./ld/configure +--- a/ld/configure 2010-04-08 14:53:44.000000000 +0100 ++++ b/ld/configure 2010-04-08 14:58:21.000000000 +0100 +@@ -10966,10 +10966,34 @@ + # before this can be enabled. + hardcode_into_libs=yes + ++ # find out which ABI we are using ++ libsuff= ++ case "$host_cpu" in ++ x86_64*|s390*|powerpc*|ppc*|sparc*) ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *64-bit*) ++ libsuff=64 ++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then ++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ++ fi ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ esac ++ + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +Only in .: .#libtool.m4 +Only in .: #libtool.m4# +diff -rcp ../binutils-2.20.51.0.7.original/opcodes/configure ./opcodes/configure +--- a/opcodes/configure 2010-04-08 14:53:45.000000000 +0100 ++++ b/opcodes/configure 2010-04-08 14:59:10.000000000 +0100 +@@ -10496,10 +10496,34 @@ + # before this can be enabled. + hardcode_into_libs=yes + ++ # find out which ABI we are using ++ libsuff= ++ case "$host_cpu" in ++ x86_64*|s390*|powerpc*|ppc*|sparc*) ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; then ++ case `/usr/bin/file conftest.$ac_objext` in ++ *64-bit*) ++ libsuff=64 ++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then ++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ++ fi ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ esac ++ + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on diff --git a/SOURCES/binutils-2.22.52.0.4-no-config-h-check.patch b/SOURCES/binutils-2.22.52.0.4-no-config-h-check.patch new file mode 100644 index 0000000..c89195a --- /dev/null +++ b/SOURCES/binutils-2.22.52.0.4-no-config-h-check.patch @@ -0,0 +1,28 @@ +--- a/bfd/bfd-in.h 2012-08-02 10:56:34.561769686 +0100 ++++ b/bfd/bfd-in.h 2012-08-02 11:13:27.134797755 +0100 +@@ -25,11 +25,6 @@ + #ifndef __BFD_H_SEEN__ + #define __BFD_H_SEEN__ + +-/* PR 14072: Ensure that config.h is included first. */ +-#if !defined PACKAGE && !defined PACKAGE_VERSION +-#error config.h must be included before this header +-#endif +- + #ifdef __cplusplus + extern "C" { + #endif +--- a/bfd/bfd-in2.h 2012-08-02 10:56:34.349769680 +0100 ++++ b/bfd/bfd-in2.h 2012-08-02 11:13:40.015798113 +0100 +@@ -32,11 +32,6 @@ + #ifndef __BFD_H_SEEN__ + #define __BFD_H_SEEN__ + +-/* PR 14072: Ensure that config.h is included first. */ +-#if !defined PACKAGE && !defined PACKAGE_VERSION +-#error config.h must be included before this header +-#endif +- + #ifdef __cplusplus + extern "C" { + #endif diff --git a/SOURCES/binutils-2.25-version.patch b/SOURCES/binutils-2.25-version.patch new file mode 100644 index 0000000..d97e81b --- /dev/null +++ b/SOURCES/binutils-2.25-version.patch @@ -0,0 +1,44 @@ +--- binutils-2.26.orig/bfd/Makefile.am 2016-01-25 10:11:33.505289018 +0000 ++++ binutils-2.26/bfd/Makefile.am 2016-01-25 10:13:23.489964145 +0000 +@@ -1043,8 +1043,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD + bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in + @echo "creating $@" + @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ +- bfd_version_string="\"$(VERSION)\"" ;\ +- bfd_soversion="$(VERSION)" ;\ ++ bfd_version_string="\"$(VERSION)-%{release}\"" ;\ ++ bfd_soversion="$(VERSION)-%{release}" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ + . $(srcdir)/development.sh ;\ +@@ -1055,7 +1055,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ + fi ;\ + $(SED) -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ +- -e "s,@bfd_version_package@,$$bfd_version_package," \ ++ -e "s,@bfd_version_package@,\"version \"," \ + -e "s,@report_bugs_to@,$$report_bugs_to," \ + < $(srcdir)/version.h > $@; \ + echo "$${bfd_soversion}" > libtool-soversion +--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:11:33.505289018 +0000 ++++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:14:17.818297941 +0000 +@@ -2111,8 +2111,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) + bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in + @echo "creating $@" + @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ +- bfd_version_string="\"$(VERSION)\"" ;\ +- bfd_soversion="$(VERSION)" ;\ ++ bfd_version_string="\"$(VERSION)-%{release}\"" ;\ ++ bfd_soversion="$(VERSION)-%{release}" ;\ + bfd_version_package="\"$(PKGVERSION)\"" ;\ + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ + . $(srcdir)/development.sh ;\ +@@ -2123,7 +2123,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ + fi ;\ + $(SED) -e "s,@bfd_version@,$$bfd_version," \ + -e "s,@bfd_version_string@,$$bfd_version_string," \ +- -e "s,@bfd_version_package@,$$bfd_version_package," \ ++ -e "s,@bfd_version_package@,\"version \"," \ + -e "s,@report_bugs_to@,$$report_bugs_to," \ + < $(srcdir)/version.h > $@; \ + echo "$${bfd_soversion}" > libtool-soversion diff --git a/SOURCES/binutils-2.27-aarch64-ifunc.patch b/SOURCES/binutils-2.27-aarch64-ifunc.patch new file mode 100644 index 0000000..562ef18 --- /dev/null +++ b/SOURCES/binutils-2.27-aarch64-ifunc.patch @@ -0,0 +1,11 @@ +diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.27/bfd/elfnn-aarch64.c +--- binutils.orig/bfd/elfnn-aarch64.c 2017-02-21 10:45:19.311956006 +0000 ++++ binutils-2.27/bfd/elfnn-aarch64.c 2017-02-21 11:55:07.517922655 +0000 +@@ -4947,6 +4947,7 @@ elfNN_aarch64_final_link_relocate (reloc + it here if it is defined in a non-shared object. */ + if (h != NULL + && h->type == STT_GNU_IFUNC ++ && (input_section->flags & SEC_ALLOC) + && h->def_regular) + { + asection *plt; diff --git a/SOURCES/binutils-2.29-filename-in-error-messages.patch b/SOURCES/binutils-2.29-filename-in-error-messages.patch new file mode 100644 index 0000000..1aa3737 --- /dev/null +++ b/SOURCES/binutils-2.29-filename-in-error-messages.patch @@ -0,0 +1,145 @@ +--- binutils.orig/binutils/readelf.c 2020-07-24 14:55:25.163647522 +0100 ++++ binutils-2.35/binutils/readelf.c 2020-07-24 15:02:39.613851369 +0100 +@@ -20729,79 +20729,92 @@ process_file (char * file_name) + Filedata * filedata = NULL; + struct stat statbuf; + char armag[SARMAG]; +- bfd_boolean ret = TRUE; ++ bfd_boolean ret = FALSE; ++ char * name; ++ char * saved_program_name; ++ ++ /* Overload program_name to include file_name. Doing this means ++ that warning/error messages will positively identify the file ++ concerned even when multiple instances of readelf are running. */ ++ name = xmalloc (strlen (program_name) + strlen (file_name) + 3); ++ sprintf (name, "%s: %s", program_name, file_name); ++ saved_program_name = program_name; ++ program_name = name; + + if (stat (file_name, &statbuf) < 0) + { + if (errno == ENOENT) +- error (_("'%s': No such file\n"), file_name); ++ error (_("No such file\n")); + else +- error (_("Could not locate '%s'. System error message: %s\n"), +- file_name, strerror (errno)); +- return FALSE; ++ error (_("Could not locate file. System error message: %s\n"), ++ strerror (errno)); ++ goto done; + } + + if (! S_ISREG (statbuf.st_mode)) + { +- error (_("'%s' is not an ordinary file\n"), file_name); +- return FALSE; ++ error (_("Not an ordinary file\n")); ++ goto done; + } + + filedata = calloc (1, sizeof * filedata); + if (filedata == NULL) + { + error (_("Out of memory allocating file data structure\n")); +- return FALSE; ++ goto done; + } + + filedata->file_name = file_name; + filedata->handle = fopen (file_name, "rb"); + if (filedata->handle == NULL) + { +- error (_("Input file '%s' is not readable.\n"), file_name); +- free (filedata); +- return FALSE; ++ error (_("Not readable\n")); ++ goto done; + } + + if (fread (armag, SARMAG, 1, filedata->handle) != 1) + { +- error (_("%s: Failed to read file's magic number\n"), file_name); ++ error (_("Failed to read file's magic number\n")); + fclose (filedata->handle); +- free (filedata); +- return FALSE; ++ goto done; + } + + filedata->file_size = (bfd_size_type) statbuf.st_size; + + if (memcmp (armag, ARMAG, SARMAG) == 0) + { +- if (! process_archive (filedata, FALSE)) +- ret = FALSE; ++ if (process_archive (filedata, FALSE)) ++ ret = TRUE; + } + else if (memcmp (armag, ARMAGT, SARMAG) == 0) + { +- if ( ! process_archive (filedata, TRUE)) +- ret = FALSE; ++ if (process_archive (filedata, TRUE)) ++ ret = TRUE; + } + else + { + if (do_archive_index && !check_all) +- error (_("File %s is not an archive so its index cannot be displayed.\n"), +- file_name); ++ error (_("Not an archive so its index cannot be displayed.\n")); + + rewind (filedata->handle); + filedata->archive_file_size = filedata->archive_file_offset = 0; + +- if (! process_object (filedata)) +- ret = FALSE; ++ if (process_object (filedata)) ++ ret = TRUE; + } + +- fclose (filedata->handle); +- free (filedata->section_headers); +- free (filedata->program_headers); +- free (filedata->string_table); +- free (filedata->dump.dump_sects); +- free (filedata); ++ done: ++ if (filedata) ++ { ++ fclose (filedata->handle); ++ free (filedata->section_headers); ++ free (filedata->program_headers); ++ free (filedata->string_table); ++ free (filedata->dump.dump_sects); ++ free (filedata); ++ } ++ free (program_name); ++ program_name = saved_program_name; + + free (ba_cache.strtab); + ba_cache.strtab = NULL; +--- binutils.orig/binutils/readelf.c 2021-01-07 12:59:35.802994842 +0000 ++++ binutils-2.35.1/binutils/readelf.c 2021-01-07 13:02:36.591754005 +0000 +@@ -20818,7 +20818,8 @@ process_file (char * file_name) + done: + if (filedata) + { +- fclose (filedata->handle); ++ if (filedata->handle != NULL) ++ fclose (filedata->handle); + free (filedata->section_headers); + free (filedata->program_headers); + free (filedata->string_table); +--- binutils.orig/binutils/readelf.c 2021-01-08 17:01:23.573093204 +0000 ++++ binutils-2.35.1/binutils/readelf.c 2021-01-08 17:02:23.095677242 +0000 +@@ -20787,7 +20787,6 @@ process_file (char * file_name) + if (fread (armag, SARMAG, 1, filedata->handle) != 1) + { + error (_("Failed to read file's magic number\n")); +- fclose (filedata->handle); + goto done; + } + diff --git a/SOURCES/binutils-2.29-revert-PLT-elision.patch b/SOURCES/binutils-2.29-revert-PLT-elision.patch new file mode 100644 index 0000000..746a551 --- /dev/null +++ b/SOURCES/binutils-2.29-revert-PLT-elision.patch @@ -0,0 +1,265 @@ +diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d +--- binutils.orig/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 13:32:39.335065263 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 15:03:55.649727195 +0000 +@@ -2,6 +2,7 @@ + #readelf: -S --wide + #as: --32 + ++#pass + #... + +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.* + #... +diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d +--- binutils.orig/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 13:32:39.329065335 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 15:04:20.803430034 +0000 +@@ -3,7 +3,6 @@ + #readelf: -d --wide + #as: --32 + +-#failif + #... + +0x[0-9a-f]+ +\(PLTREL.* + #... +diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d +--- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 13:32:39.336065251 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 15:03:00.413379749 +0000 +@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse + [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func + [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func + [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func +- ++#... + Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name + #... +diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d +--- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 13:32:39.330065323 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 15:03:28.928042882 +0000 +@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse + [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func + [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func + [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func +- ++#... + Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d +--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 13:32:39.415064300 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 15:08:39.333375801 +0000 +@@ -2,8 +2,4 @@ + #readelf: -S --wide + #as: --64 + +-#... +- +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.* +-#... +- +\[ *[0-9]+\] \.got\.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+18 +.* + #pass +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d +--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 13:32:39.404064432 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 15:08:59.031143095 +0000 +@@ -3,7 +3,6 @@ + #readelf: -d --wide + #as: --64 + +-#failif + #... + +0x[0-9a-f]+ +\(PLTREL.* + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 13:32:39.405064420 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 15:06:53.694623801 +0000 +@@ -1,7 +1,4 @@ +-#... +-Disassembly of section .plt.got: + +-[a-f0-9]+ <[a-z_]+@plt>: +-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*> ++#... + [ ]*[a-f0-9]+: 90 nop + #pass +diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 13:32:39.407064397 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 15:06:17.244054423 +0000 +@@ -1,4 +1,3 @@ +-#failif + #... + [0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0 + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 13:32:39.412064336 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 15:15:09.918750288 +0000 +@@ -20,6 +20,7 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop ++#pass + + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 13:32:39.413064324 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 15:16:08.227055104 +0000 +@@ -20,6 +20,7 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop ++#pass + + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 13:32:39.413064324 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 15:16:20.115913358 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 13:32:39.411064348 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 15:16:29.012807282 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 13:32:39.408064384 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 15:19:48.097433680 +0000 +@@ -19,7 +19,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 13:32:39.401064469 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 15:10:56.077760324 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 13:32:39.405064420 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 15:10:42.828916844 +0000 +@@ -19,6 +19,7 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop ++#pass + + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 13:32:39.416064288 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 15:11:11.550577531 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 13:32:39.411064348 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 15:09:52.664509478 +0000 +@@ -19,7 +19,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 13:32:39.413064324 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 15:11:22.975442559 +0000 +@@ -20,7 +20,8 @@ Contents of the .eh_frame section: + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop +- ++#pass ++ + 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231 + DW_CFA_nop + DW_CFA_nop +diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd +--- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 13:32:39.417064276 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 15:05:02.950932110 +0000 +@@ -14,6 +14,7 @@ Section Headers: + +\[[ 0-9]+\] .dynsym +.* + +\[[ 0-9]+\] .dynstr +.* + +\[[ 0-9]+\] .rela.dyn +.* ++#pass + +\[[ 0-9]+\] .plt +.* + +\[[ 0-9]+\] .plt.got +.* + +\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+31a 00 +AX +0 +0 4096 +--- binutils.orig/bfd/elfxx-x86.c 2018-01-22 15:59:25.875788033 +0000 ++++ binutils-2.30.0/bfd/elfxx-x86.c 2018-01-22 16:00:20.789146597 +0000 +@@ -107,7 +107,7 @@ elf_x86_allocate_dynrelocs (struct elf_l + plt_entry_size = htab->plt.plt_entry_size; + + resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); +- ++#if 0 + /* We can't use the GOT PLT if pointer equality is needed since + finish_dynamic_symbol won't clear symbol value and the dynamic + linker won't update the GOT slot. We will get into an infinite +@@ -125,7 +125,7 @@ elf_x86_allocate_dynrelocs (struct elf_l + /* Use the GOT PLT. */ + eh->plt_got.refcount = 1; + } +- ++#endif + /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it + here if it is defined and referenced in a non-shared object. */ + if (h->type == STT_GNU_IFUNC +--- binutils.orig/ld/testsuite/ld-i386/pr20830.d 2018-07-09 09:49:51.277239857 +0100 ++++ binutils-2.30.90/ld/testsuite/ld-i386/pr20830.d 2018-07-09 10:32:41.113356733 +0100 +@@ -19,7 +19,7 @@ Contents of the .eh_frame section: + DW_CFA_offset: r8 \(eip\) at cfa-4 + DW_CFA_nop + DW_CFA_nop +- ++#pass + 0+18 00000010 0000001c FDE cie=00000000 pc=00000128..00000133 + DW_CFA_nop + DW_CFA_nop +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2020-07-24 14:55:25.370646189 +0100 ++++ binutils-2.35/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2020-07-24 15:06:58.124189348 +0100 +@@ -1,7 +1,3 @@ + #... +-Disassembly of section .plt.got: +- +-[a-f0-9]+ <[_a-z]+@plt>: + [ ]*[a-f0-9]+: f3 0f 1e fa endbr64 +-[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*> + #pass diff --git a/SOURCES/binutils-CVE-2019-1010204.patch b/SOURCES/binutils-CVE-2019-1010204.patch new file mode 100644 index 0000000..56434b1 --- /dev/null +++ b/SOURCES/binutils-CVE-2019-1010204.patch @@ -0,0 +1,15 @@ +--- binutils.orig/gold/fileread.cc 2019-08-06 14:22:08.669313110 +0100 ++++ binutils-2.32/gold/fileread.cc 2019-08-06 14:22:28.799177543 +0100 +@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_ + ssize_t bytes; + if (this->whole_file_view_ != NULL) + { ++ // See PR 23765 for an example of a testcase that triggers this error. ++ if (((ssize_t) start) < 0) ++ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"), ++ this->filename().c_str(), ++ static_cast(start)); ++ + bytes = this->size_ - start; + if (static_cast(bytes) >= size) + { diff --git a/SOURCES/binutils-CVE-2020-35448.patch b/SOURCES/binutils-CVE-2020-35448.patch new file mode 100644 index 0000000..4fab54c --- /dev/null +++ b/SOURCES/binutils-CVE-2020-35448.patch @@ -0,0 +1,53 @@ +diff -rup binutils.orig/bfd/elf.c binutils-2.35/bfd/elf.c +--- binutils.orig/bfd/elf.c 2021-04-19 10:49:21.757290990 +0100 ++++ binutils-2.35/bfd/elf.c 2021-04-19 10:50:28.309839285 +0100 +@@ -12534,7 +12534,9 @@ _bfd_elf_slurp_secondary_reloc_section ( + Elf_Internal_Shdr * hdr = & elf_section_data (relsec)->this_hdr; + + if (hdr->sh_type == SHT_SECONDARY_RELOC +- && hdr->sh_info == (unsigned) elf_section_data (sec)->this_idx) ++ && hdr->sh_info == (unsigned) elf_section_data (sec)->this_idx ++ && (hdr->sh_entsize == ebd->s->sizeof_rel ++ || hdr->sh_entsize == ebd->s->sizeof_rela)) + { + bfd_byte * native_relocs; + bfd_byte * native_reloc; +diff -rup binutils.orig/bfd/elfcode.h binutils-2.35/bfd/elfcode.h +--- binutils.orig/bfd/elfcode.h 2021-04-19 10:49:21.767290922 +0100 ++++ binutils-2.35/bfd/elfcode.h 2021-04-19 10:52:22.196066303 +0100 +@@ -568,7 +568,7 @@ elf_object_p (bfd *abfd) + + /* If this is a relocatable file and there is no section header + table, then we're hosed. */ +- if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL) ++ if (i_ehdrp->e_shoff < sizeof (x_ehdr) && i_ehdrp->e_type == ET_REL) + goto got_wrong_format_error; + + /* As a simple sanity check, verify that what BFD thinks is the +@@ -578,7 +578,7 @@ elf_object_p (bfd *abfd) + goto got_wrong_format_error; + + /* Further sanity check. */ +- if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_shnum != 0) ++ if (i_ehdrp->e_shoff < sizeof (x_ehdr) && i_ehdrp->e_shnum != 0) + goto got_wrong_format_error; + + ebd = get_elf_backend_data (abfd); +@@ -615,7 +615,7 @@ elf_object_p (bfd *abfd) + && ebd->elf_osabi != ELFOSABI_NONE) + goto got_wrong_format_error; + +- if (i_ehdrp->e_shoff != 0) ++ if (i_ehdrp->e_shoff >= sizeof (x_ehdr)) + { + file_ptr where = (file_ptr) i_ehdrp->e_shoff; + +@@ -807,7 +807,7 @@ elf_object_p (bfd *abfd) + } + } + +- if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff != 0) ++ if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff >= sizeof (x_ehdr)) + { + unsigned int num_sec; + diff --git a/SOURCES/binutils-CVE-2021-20197.patch b/SOURCES/binutils-CVE-2021-20197.patch new file mode 100644 index 0000000..207f6be --- /dev/null +++ b/SOURCES/binutils-CVE-2021-20197.patch @@ -0,0 +1,1310 @@ +diff -rup binutils.orig/bfd/bfd-in2.h binutils-2.35.1/bfd/bfd-in2.h +--- binutils.orig/bfd/bfd-in2.h 2021-01-29 11:14:51.848568548 +0000 ++++ binutils-2.35.1/bfd/bfd-in2.h 2021-01-29 11:15:33.431322133 +0000 +@@ -583,6 +583,8 @@ bfd *bfd_openr (const char *filename, co + + bfd *bfd_fdopenr (const char *filename, const char *target, int fd); + ++bfd *bfd_fdopenw (const char *filename, const char *target, int fd); ++ + bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); + +diff -rup binutils.orig/bfd/opncls.c binutils-2.35.1/bfd/opncls.c +--- binutils.orig/bfd/opncls.c 2021-01-29 11:14:51.846568560 +0000 ++++ binutils-2.35.1/bfd/opncls.c 2021-01-29 11:15:33.431322133 +0000 +@@ -395,6 +395,39 @@ bfd_fdopenr (const char *filename, const + + /* + FUNCTION ++ bfd_fdopenw ++ ++SYNOPSIS ++ bfd *bfd_fdopenw (const char *filename, const char *target, int fd); ++ ++DESCRIPTION ++ <> is exactly like <> with the exception that ++ the resulting BFD is suitable for output. ++*/ ++ ++bfd * ++bfd_fdopenw (const char *filename, const char *target, int fd) ++{ ++ bfd *out = bfd_fdopenr (filename, target, fd); ++ ++ if (out != NULL) ++ { ++ if (!bfd_write_p (out)) ++ { ++ close (fd); ++ _bfd_delete_bfd (out); ++ out = NULL; ++ bfd_set_error (bfd_error_invalid_operation); ++ } ++ else ++ out->direction = write_direction; ++ } ++ ++ return out; ++} ++ ++/* ++FUNCTION + bfd_openstreamr + + SYNOPSIS +diff -rup binutils.orig/binutils/ar.c binutils-2.35.1/binutils/ar.c +--- binutils.orig/binutils/ar.c 2021-01-29 11:14:51.344571539 +0000 ++++ binutils-2.35.1/binutils/ar.c 2021-01-29 11:15:56.174187367 +0000 +@@ -25,6 +25,7 @@ + + #include "sysdep.h" + #include "bfd.h" ++#include "libbfd.h" + #include "libiberty.h" + #include "progress.h" + #include "getopt.h" +@@ -1195,20 +1196,26 @@ write_archive (bfd *iarch) + bfd *obfd; + char *old_name, *new_name; + bfd *contents_head = iarch->archive_next; ++ int ofd = -1; ++ struct stat target_stat; ++ bfd_boolean skip_stat = FALSE; + + old_name = (char *) xmalloc (strlen (bfd_get_filename (iarch)) + 1); + strcpy (old_name, bfd_get_filename (iarch)); +- new_name = make_tempname (old_name); ++ new_name = make_tempname (old_name, &ofd); + + if (new_name == NULL) + bfd_fatal (_("could not create temporary file whilst writing archive")); + + output_filename = new_name; + +- obfd = bfd_openw (new_name, bfd_get_target (iarch)); ++ obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), ofd); + + if (obfd == NULL) +- bfd_fatal (old_name); ++ { ++ close (ofd); ++ bfd_fatal (old_name); ++ } + + output_bfd = obfd; + +@@ -1237,6 +1244,14 @@ write_archive (bfd *iarch) + if (!bfd_set_archive_head (obfd, contents_head)) + bfd_fatal (old_name); + ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ ofd = dup (ofd); ++ if (iarch == NULL || iarch->iostream == NULL) ++ skip_stat = TRUE; ++ else if (ofd == -1 || fstat (fileno (iarch->iostream), &target_stat) != 0) ++ bfd_fatal (old_name); ++#endif ++ + if (!bfd_close (obfd)) + bfd_fatal (old_name); + +@@ -1246,7 +1261,7 @@ write_archive (bfd *iarch) + /* We don't care if this fails; we might be creating the archive. */ + bfd_close (iarch); + +- if (smart_rename (new_name, old_name, 0) != 0) ++ if (smart_rename (new_name, old_name, ofd, skip_stat ? NULL : &target_stat, 0) != 0) + xexit (1); + free (old_name); + free (new_name); +diff -rup binutils.orig/binutils/arsup.c binutils-2.35.1/binutils/arsup.c +--- binutils.orig/binutils/arsup.c 2021-01-29 11:14:51.350571503 +0000 ++++ binutils-2.35.1/binutils/arsup.c 2021-01-29 11:15:56.174187367 +0000 +@@ -345,13 +345,25 @@ ar_save (void) + else + { + char *ofilename = xstrdup (bfd_get_filename (obfd)); ++ bfd_boolean skip_stat = FALSE; ++ struct stat target_stat; ++ int ofd = -1; + + if (deterministic > 0) + obfd->flags |= BFD_DETERMINISTIC_OUTPUT; + ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ /* It's OK to fail; at worst it will result in SMART_RENAME using a slow ++ copy fallback to write the output. */ ++ ofd = dup (fileno (obfd->iostream)); ++ if (lstat (real_name, &target_stat) != 0) ++ skip_stat = TRUE; ++#endif ++ + bfd_close (obfd); + +- smart_rename (ofilename, real_name, 0); ++ smart_rename (ofilename, real_name, ofd, ++ skip_stat ? NULL : &target_stat, 0); + obfd = 0; + free (ofilename); + } +diff -rup binutils.orig/binutils/bucomm.c binutils-2.35.1/binutils/bucomm.c +--- binutils.orig/binutils/bucomm.c 2021-01-29 11:14:51.422571073 +0000 ++++ binutils-2.35.1/binutils/bucomm.c 2021-01-29 11:15:33.431322133 +0000 +@@ -532,7 +532,7 @@ template_in_dir (const char *path) + as FILENAME. */ + + char * +-make_tempname (const char *filename) ++make_tempname (const char *filename, int *ofd) + { + char *tmpname = template_in_dir (filename); + int fd; +@@ -550,7 +550,7 @@ make_tempname (const char *filename) + free (tmpname); + return NULL; + } +- close (fd); ++ *ofd = fd; + return tmpname; + } + +diff -rup binutils.orig/binutils/bucomm.h binutils-2.35.1/binutils/bucomm.h +--- binutils.orig/binutils/bucomm.h 2021-01-29 11:14:51.350571503 +0000 ++++ binutils-2.35.1/binutils/bucomm.h 2021-01-29 11:15:56.174187367 +0000 +@@ -51,7 +51,7 @@ int display_info (void); + + void print_arelt_descr (FILE *, bfd *, bfd_boolean, bfd_boolean); + +-char *make_tempname (const char *); ++char *make_tempname (const char *, int *); + char *make_tempdir (const char *); + + bfd_vma parse_vma (const char *, const char *); +@@ -71,7 +71,8 @@ extern void print_version (const char *) + /* In rename.c. */ + extern void set_times (const char *, const struct stat *); + +-extern int smart_rename (const char *, const char *, int); ++extern int smart_rename (const char *, const char *, int, struct stat *, int); ++ + + /* In libiberty. */ + void *xmalloc (size_t); +diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c +--- binutils.orig/binutils/objcopy.c 2021-01-29 11:14:51.342571551 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-01-29 11:15:56.175187361 +0000 +@@ -20,6 +20,7 @@ + + #include "sysdep.h" + #include "bfd.h" ++#include "libbfd.h" + #include "progress.h" + #include "getopt.h" + #include "libiberty.h" +@@ -3711,9 +3712,9 @@ set_long_section_mode (bfd *output_bfd, + /* The top-level control. */ + + static void +-copy_file (const char *input_filename, const char *output_filename, +- const char *input_target, const char *output_target, +- const bfd_arch_info_type *input_arch) ++copy_file (const char *input_filename, const char *output_filename, int ofd, ++ struct stat *in_stat, const char *input_target, ++ const char *output_target, const bfd_arch_info_type *input_arch) + { + bfd *ibfd; + char **obj_matching; +@@ -3732,7 +3733,7 @@ copy_file (const char *input_filename, c + /* To allow us to do "strip *" without dying on the first + non-object file, failures are nonfatal. */ + ibfd = bfd_openr (input_filename, input_target); +- if (ibfd == NULL) ++ if (ibfd == NULL || fstat (fileno (ibfd->iostream), in_stat) != 0) + { + bfd_nonfatal_message (input_filename, NULL, NULL, NULL); + status = 1; +@@ -3786,9 +3787,14 @@ copy_file (const char *input_filename, c + else + force_output_target = TRUE; + +- obfd = bfd_openw (output_filename, output_target); ++ if (ofd >= 0) ++ obfd = bfd_fdopenw (output_filename, output_target, ofd); ++ else ++ obfd = bfd_openw (output_filename, output_target); ++ + if (obfd == NULL) + { ++ close (ofd); + bfd_nonfatal_message (output_filename, NULL, NULL, NULL); + status = 1; + return; +@@ -3816,13 +3822,19 @@ copy_file (const char *input_filename, c + if (output_target == NULL) + output_target = bfd_get_target (ibfd); + +- obfd = bfd_openw (output_filename, output_target); ++ if (ofd >= 0) ++ obfd = bfd_fdopenw (output_filename, output_target, ofd); ++ else ++ obfd = bfd_openw (output_filename, output_target); ++ + if (obfd == NULL) + { ++ close (ofd); + bfd_nonfatal_message (output_filename, NULL, NULL, NULL); + status = 1; + return; + } ++ + /* This is a no-op on non-Coff targets. */ + set_long_section_mode (obfd, ibfd, long_section_names); + +@@ -4786,6 +4798,8 @@ strip_main (int argc, char *argv[]) + int hold_status = status; + struct stat statbuf; + char *tmpname; ++ int tmpfd = -1; ++ int copyfd = -1; + + if (get_file_size (argv[i]) < 1) + { +@@ -4793,18 +4807,18 @@ strip_main (int argc, char *argv[]) + continue; + } + +- if (preserve_dates) +- /* No need to check the return value of stat(). +- It has already been checked in get_file_size(). */ +- stat (argv[i], &statbuf); +- + if (output_file == NULL + || filename_cmp (argv[i], output_file) == 0) +- tmpname = make_tempname (argv[i]); ++ tmpname = make_tempname (argv[i], &tmpfd); + else + tmpname = output_file; + +- if (tmpname == NULL) ++ if (tmpname == NULL ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */ ++ || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1) ++#endif ++ ) + { + bfd_nonfatal_message (argv[i], NULL, NULL, + _("could not create temporary file to hold stripped copy")); +@@ -4813,7 +4827,8 @@ strip_main (int argc, char *argv[]) + } + + status = 0; +- copy_file (argv[i], tmpname, input_target, output_target, NULL); ++ copy_file (argv[i], tmpname, tmpfd, &statbuf, input_target, ++ output_target, NULL); + if (status == 0) + { + if (preserve_dates) +@@ -4821,12 +4836,18 @@ strip_main (int argc, char *argv[]) + if (output_file != tmpname) + status = (smart_rename (tmpname, + output_file ? output_file : argv[i], +- preserve_dates) != 0); ++ copyfd, &statbuf, preserve_dates) != 0); + if (status == 0) + status = hold_status; + } + else +- unlink_if_ordinary (tmpname); ++ { ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ if (copyfd >= 0) ++ close (copyfd); ++#endif ++ unlink_if_ordinary (tmpname); ++ } + if (output_file != tmpname) + free (tmpname); + } +@@ -5033,7 +5054,8 @@ copy_main (int argc, char *argv[]) + bfd_boolean formats_info = FALSE; + bfd_boolean use_globalize = FALSE; + bfd_boolean use_keep_global = FALSE; +- int c; ++ int c, tmpfd = -1; ++ int copyfd = -1; + struct stat statbuf; + const bfd_arch_info_type *input_arch = NULL; + +@@ -5870,34 +5892,43 @@ copy_main (int argc, char *argv[]) + convert_efi_target (efi); + } + +- if (preserve_dates) +- if (stat (input_filename, & statbuf) < 0) +- fatal (_("warning: could not locate '%s'. System error message: %s"), +- input_filename, strerror (errno)); +- + /* If there is no destination file, or the source and destination files + are the same, then create a temp and rename the result into the input. */ + if (output_filename == NULL + || filename_cmp (input_filename, output_filename) == 0) +- tmpname = make_tempname (input_filename); ++ tmpname = make_tempname (input_filename, &tmpfd); + else + tmpname = output_filename; + +- if (tmpname == NULL) +- fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"), +- input_filename, strerror (errno)); ++ if (tmpname == NULL ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */ ++ || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1) ++#endif ++ ) ++ { ++ fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"), ++ input_filename, strerror (errno)); ++ } + +- copy_file (input_filename, tmpname, input_target, output_target, input_arch); ++ copy_file (input_filename, tmpname, tmpfd, &statbuf, input_target, ++ output_target, input_arch); + if (status == 0) + { + if (preserve_dates) + set_times (tmpname, &statbuf); + if (tmpname != output_filename) +- status = (smart_rename (tmpname, input_filename, ++ status = (smart_rename (tmpname, input_filename, copyfd, &statbuf, + preserve_dates) != 0); + } + else +- unlink_if_ordinary (tmpname); ++ { ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ if (copyfd >= 0) ++ close (copyfd); ++#endif ++ unlink_if_ordinary (tmpname); ++ } + + if (tmpname != output_filename) + free (tmpname); +diff -rup binutils.orig/binutils/rename.c binutils-2.35.1/binutils/rename.c +--- binutils.orig/binutils/rename.c 2021-01-29 11:14:51.422571073 +0000 ++++ binutils-2.35.1/binutils/rename.c 2021-01-29 11:15:56.175187361 +0000 +@@ -131,17 +131,55 @@ set_times (const char *destination, cons + #endif + #endif + +-/* Rename FROM to TO, copying if TO is a link. +- Return 0 if ok, -1 if error. */ ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++/* Try to preserve the permission bits and ownership of an existing file when ++ rename overwrites it. FD is the file being renamed and TARGET_STAT has the ++ status of the file that was overwritten. */ ++static void ++try_preserve_permissions (int fd, struct stat *target_stat) ++{ ++ struct stat from_stat; ++ int ret = 0; ++ ++ if (fstat (fd, &from_stat) != 0) ++ return; ++ ++ int from_mode = from_stat.st_mode & 0777; ++ int to_mode = target_stat->st_mode & 0777; ++ ++ /* Fix up permissions before we potentially lose ownership with fchown. ++ Clear the setxid bits because in case the fchown below fails then we don't ++ want to end up with a sxid file owned by the invoking user. If the user ++ hasn't changed or if fchown succeeded, we add back the sxid bits at the ++ end. */ ++ if (from_mode != to_mode) ++ fchmod (fd, to_mode); ++ ++ /* Fix up ownership, this will clear the setxid bits. */ ++ if (from_stat.st_uid != target_stat->st_uid ++ || from_stat.st_gid != target_stat->st_gid) ++ ret = fchown (fd, target_stat->st_uid, target_stat->st_gid); ++ ++ /* Fix up the sxid bits if either the fchown wasn't needed or it ++ succeeded. */ ++ if (ret == 0) ++ fchmod (fd, target_stat->st_mode & 07777); ++} ++#endif ++ ++/* Rename FROM to TO, copying if TO is either a link or is not a regular file. ++ FD is an open file descriptor pointing to FROM that we can use to safely fix ++ up permissions of the file after renaming. TARGET_STAT has the file status ++ that is used to fix up permissions and timestamps after rename. Return 0 if ++ ok, -1 if error and FD is closed before returning. */ + + int +-smart_rename (const char *from, const char *to, int preserve_dates ATTRIBUTE_UNUSED) ++smart_rename (const char *from, const char *to, int fd ATTRIBUTE_UNUSED, ++ struct stat *target_stat ATTRIBUTE_UNUSED, ++ int preserve_dates ATTRIBUTE_UNUSED) + { +- bfd_boolean exists; +- struct stat s; + int ret = 0; +- +- exists = lstat (to, &s) == 0; ++ bfd_boolean exists = target_stat != NULL; + + #if defined (_WIN32) && !defined (__CYGWIN32__) + /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but +@@ -158,36 +196,35 @@ smart_rename (const char *from, const ch + unlink (from); + } + #else +- /* Use rename only if TO is not a symbolic link and has +- only one hard link, and we have permission to write to it. */ ++ /* Avoid a full copy and use rename if we can fix up permissions of the ++ file after renaming, i.e.: ++ ++ - TO is not a symbolic link ++ - TO is a regular file with only one hard link ++ - We have permission to write to TO ++ - FD is available to safely fix up permissions to be the same as the file ++ we overwrote with the rename. ++ ++ Note though that the actual file on disk that TARGET_STAT describes may ++ have changed and we're only trying to preserve the status we know about. ++ At no point do we try to interact with the new file changes, so there can ++ only be two outcomes, i.e. either the external file change survives ++ without knowledge of our change (if it happens after the rename syscall) ++ or our rename and permissions fixup survive without any knowledge of the ++ external change. */ + if (! exists +- || (!S_ISLNK (s.st_mode) +- && S_ISREG (s.st_mode) +- && (s.st_mode & S_IWUSR) +- && s.st_nlink == 1) ++ || (fd >= 0 ++ && !S_ISLNK (target_stat->st_mode) ++ && S_ISREG (target_stat->st_mode) ++ && (target_stat->st_mode & S_IWUSR) ++ && target_stat->st_nlink == 1) + ) + { + ret = rename (from, to); + if (ret == 0) + { + if (exists) +- { +- /* Try to preserve the permission bits and ownership of +- TO. First get the mode right except for the setuid +- bit. Then change the ownership. Then fix the setuid +- bit. We do the chmod before the chown because if the +- chown succeeds, and we are a normal user, we won't be +- able to do the chmod afterward. We don't bother to +- fix the setuid bit first because that might introduce +- a fleeting security problem, and because the chown +- will clear the setuid bit anyhow. We only fix the +- setuid bit if the chown succeeds, because we don't +- want to introduce an unexpected setuid file owned by +- the user running objcopy. */ +- chmod (to, s.st_mode & 0777); +- if (chown (to, s.st_uid, s.st_gid) >= 0) +- chmod (to, s.st_mode & 07777); +- } ++ try_preserve_permissions (fd, target_stat); + } + else + { +@@ -203,9 +240,11 @@ smart_rename (const char *from, const ch + non_fatal (_("unable to copy file '%s'; reason: %s"), to, strerror (errno)); + + if (preserve_dates) +- set_times (to, &s); ++ set_times (to, target_stat); + unlink (from); + } ++ if (fd >= 0) ++ close (fd); + #endif /* _WIN32 && !__CYGWIN32__ */ + + return ret; +diff -rup binutils.orig/binutils/ar.c binutils-2.35.1/binutils/ar.c +--- binutils.orig/binutils/ar.c 2021-02-02 13:01:42.257734944 +0000 ++++ binutils-2.35.1/binutils/ar.c 2021-02-02 13:11:13.340958352 +0000 +@@ -25,7 +25,6 @@ + + #include "sysdep.h" + #include "bfd.h" +-#include "libbfd.h" + #include "libiberty.h" + #include "progress.h" + #include "getopt.h" +@@ -1082,7 +1081,7 @@ open_output_file (bfd * abfd) + output_filename, base); + output_filename = base; + } +- ++ + if (output_dir) + { + size_t len = strlen (output_dir); +@@ -1099,7 +1098,7 @@ open_output_file (bfd * abfd) + + if (verbose) + printf ("x - %s\n", output_filename); +- ++ + FILE * ostream = fopen (output_filename, FOPEN_WB); + if (ostream == NULL) + { +@@ -1198,10 +1197,8 @@ write_archive (bfd *iarch) + bfd *contents_head = iarch->archive_next; + int ofd = -1; + struct stat target_stat; +- bfd_boolean skip_stat = FALSE; + +- old_name = (char *) xmalloc (strlen (bfd_get_filename (iarch)) + 1); +- strcpy (old_name, bfd_get_filename (iarch)); ++ old_name = xstrdup (bfd_get_filename (iarch)); + new_name = make_tempname (old_name, &ofd); + + if (new_name == NULL) +@@ -1246,11 +1243,9 @@ write_archive (bfd *iarch) + + #if !defined (_WIN32) || defined (__CYGWIN32__) + ofd = dup (ofd); +- if (iarch == NULL || iarch->iostream == NULL) +- skip_stat = TRUE; +- else if (ofd == -1 || fstat (fileno (iarch->iostream), &target_stat) != 0) +- bfd_fatal (old_name); + #endif ++ if (ofd == -1 || bfd_stat (iarch, &target_stat) != 0) ++ bfd_fatal (old_name); + + if (!bfd_close (obfd)) + bfd_fatal (old_name); +@@ -1261,7 +1256,7 @@ write_archive (bfd *iarch) + /* We don't care if this fails; we might be creating the archive. */ + bfd_close (iarch); + +- if (smart_rename (new_name, old_name, ofd, skip_stat ? NULL : &target_stat, 0) != 0) ++ if (smart_rename (new_name, old_name, ofd, &target_stat, 0) != 0) + xexit (1); + free (old_name); + free (new_name); +Only in binutils-2.35.1/binutils/: ar.c.orig +Only in binutils-2.35.1/binutils/: ar.c.rej +diff -rup binutils.orig/binutils/arsup.c binutils-2.35.1/binutils/arsup.c +--- binutils.orig/binutils/arsup.c 2021-02-02 13:01:42.208735269 +0000 ++++ binutils-2.35.1/binutils/arsup.c 2021-02-02 13:11:55.725678308 +0000 +@@ -42,6 +42,8 @@ extern int deterministic; + + static bfd *obfd; + static char *real_name; ++static char *temp_name; ++static int real_ofd; + static FILE *outfile; + + static void +@@ -149,27 +151,24 @@ maybequit (void) + void + ar_open (char *name, int t) + { +- char *tname; +- const char *bname = lbasename (name); +- real_name = name; +- +- /* Prepend tmp- to the beginning, to avoid file-name clashes after +- truncation on filesystems with limited namespaces (DOS). */ +- if (asprintf (&tname, "%.*stmp-%s", (int) (bname - name), name, bname) == -1) ++ real_name = xstrdup (name); ++ temp_name = make_tempname (real_name, &real_ofd); ++ ++ if (temp_name == NULL) + { +- fprintf (stderr, _("%s: Can't allocate memory for temp name (%s)\n"), ++ fprintf (stderr, _("%s: Can't open temporary file (%s)\n"), + program_name, strerror(errno)); + maybequit (); + return; + } + +- obfd = bfd_openw (tname, NULL); ++ obfd = bfd_fdopenw (temp_name, NULL, real_ofd); + + if (!obfd) + { + fprintf (stderr, + _("%s: Can't open output archive %s\n"), +- program_name, tname); ++ program_name, temp_name); + + maybequit (); + } +@@ -344,10 +343,9 @@ ar_save (void) + } + else + { +- char *ofilename = xstrdup (bfd_get_filename (obfd)); + bfd_boolean skip_stat = FALSE; + struct stat target_stat; +- int ofd = -1; ++ int ofd = real_ofd; + + if (deterministic > 0) + obfd->flags |= BFD_DETERMINISTIC_OUTPUT; +@@ -355,17 +353,18 @@ ar_save (void) + #if !defined (_WIN32) || defined (__CYGWIN32__) + /* It's OK to fail; at worst it will result in SMART_RENAME using a slow + copy fallback to write the output. */ +- ofd = dup (fileno (obfd->iostream)); +- if (lstat (real_name, &target_stat) != 0) +- skip_stat = TRUE; ++ ofd = dup (ofd); + #endif +- + bfd_close (obfd); + +- smart_rename (ofilename, real_name, ofd, ++ if (ofd == -1 || fstat (ofd, &target_stat) != 0) ++ skip_stat = TRUE; ++ ++ smart_rename (temp_name, real_name, ofd, + skip_stat ? NULL : &target_stat, 0); + obfd = 0; +- free (ofilename); ++ free (temp_name); ++ free (real_name); + } + } + +Only in binutils-2.35.1/binutils/: arsup.c.orig +Only in binutils-2.35.1/binutils/: arsup.c.rej +diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c +--- binutils.orig/binutils/objcopy.c 2021-02-02 13:01:42.214735229 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-02-02 13:13:27.613071192 +0000 +@@ -20,7 +20,6 @@ + + #include "sysdep.h" + #include "bfd.h" +-#include "libbfd.h" + #include "progress.h" + #include "getopt.h" + #include "libiberty.h" +@@ -3733,7 +3732,7 @@ copy_file (const char *input_filename, c + /* To allow us to do "strip *" without dying on the first + non-object file, failures are nonfatal. */ + ibfd = bfd_openr (input_filename, input_target); +- if (ibfd == NULL || fstat (fileno (ibfd->iostream), in_stat) != 0) ++ if (ibfd == NULL || bfd_stat (ibfd, in_stat) != 0) + { + bfd_nonfatal_message (input_filename, NULL, NULL, NULL); + status = 1; +Only in binutils-2.35.1/binutils/: objcopy.c.orig +Only in binutils-2.35.1/binutils/: objcopy.c.rej +--- binutils.orig/binutils/arsup.c 2021-02-04 10:42:03.265729780 +0000 ++++ binutils-2.35.1/binutils/arsup.c 2021-02-04 10:45:48.439166658 +0000 +@@ -357,8 +357,21 @@ ar_save (void) + #endif + bfd_close (obfd); + +- if (ofd == -1 || fstat (ofd, &target_stat) != 0) +- skip_stat = TRUE; ++ if (lstat (real_name, &target_stat) != 0) ++ { ++ /* The temp file created in ar_open has mode 0600 as per mkstemp. ++ Create the real empty output file here so smart_rename will ++ update the mode according to the process umask. */ ++ obfd = bfd_openw (real_name, NULL); ++ if (obfd == NULL ++ || bfd_stat (obfd, &target_stat) != 0) ++ skip_stat = TRUE; ++ if (obfd != NULL) ++ { ++ bfd_set_format (obfd, bfd_archive); ++ bfd_close (obfd); ++ } ++ } + + smart_rename (temp_name, real_name, ofd, + skip_stat ? NULL : &target_stat, 0); +--- binutils.orig/binutils/rename.c 2021-02-08 11:02:58.767933783 +0000 ++++ binutils-2.35.1/binutils/rename.c 2021-02-08 11:20:37.539179363 +0000 +@@ -179,7 +179,10 @@ smart_rename (const char *from, const ch + int preserve_dates ATTRIBUTE_UNUSED) + { + int ret = 0; +- bfd_boolean exists = target_stat != NULL; ++ struct stat to_stat; ++ bfd_boolean exists; ++ ++ exists = lstat (to, &to_stat) == 0; + + #if defined (_WIN32) && !defined (__CYGWIN32__) + /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but +@@ -214,16 +217,16 @@ smart_rename (const char *from, const ch + external change. */ + if (! exists + || (fd >= 0 +- && !S_ISLNK (target_stat->st_mode) +- && S_ISREG (target_stat->st_mode) +- && (target_stat->st_mode & S_IWUSR) +- && target_stat->st_nlink == 1) ++ && !S_ISLNK (to_stat.st_mode) ++ && S_ISREG (to_stat.st_mode) ++ && (to_stat.st_mode & S_IWUSR) ++ && to_stat.st_nlink == 1) + ) + { + ret = rename (from, to); + if (ret == 0) + { +- if (exists) ++ if (exists && target_stat != NULL) + try_preserve_permissions (fd, target_stat); + } + else +@@ -239,7 +242,7 @@ smart_rename (const char *from, const ch + if (ret != 0) + non_fatal (_("unable to copy file '%s'; reason: %s"), to, strerror (errno)); + +- if (preserve_dates) ++ if (preserve_dates && target_stat != NULL) + set_times (to, target_stat); + unlink (from); + } +diff -rup binutils.orig/binutils/ar.c binutils-2.35.1/binutils/ar.c +--- binutils.orig/binutils/ar.c 2021-03-11 12:38:18.183422774 +0000 ++++ binutils-2.35.1/binutils/ar.c 2021-03-11 12:45:09.279716067 +0000 +@@ -1195,22 +1195,21 @@ write_archive (bfd *iarch) + bfd *obfd; + char *old_name, *new_name; + bfd *contents_head = iarch->archive_next; +- int ofd = -1; +- struct stat target_stat; ++ int tmpfd = -1; + + old_name = xstrdup (bfd_get_filename (iarch)); +- new_name = make_tempname (old_name, &ofd); ++ new_name = make_tempname (old_name, &tmpfd); + + if (new_name == NULL) + bfd_fatal (_("could not create temporary file whilst writing archive")); + + output_filename = new_name; + +- obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), ofd); ++ obfd = bfd_fdopenw (new_name, bfd_get_target (iarch), tmpfd); + + if (obfd == NULL) + { +- close (ofd); ++ close (tmpfd); + bfd_fatal (old_name); + } + +@@ -1241,12 +1240,7 @@ write_archive (bfd *iarch) + if (!bfd_set_archive_head (obfd, contents_head)) + bfd_fatal (old_name); + +-#if !defined (_WIN32) || defined (__CYGWIN32__) +- ofd = dup (ofd); +-#endif +- if (ofd == -1 || bfd_stat (iarch, &target_stat) != 0) +- bfd_fatal (old_name); +- ++ tmpfd = dup (tmpfd); + if (!bfd_close (obfd)) + bfd_fatal (old_name); + +@@ -1256,7 +1250,7 @@ write_archive (bfd *iarch) + /* We don't care if this fails; we might be creating the archive. */ + bfd_close (iarch); + +- if (smart_rename (new_name, old_name, ofd, &target_stat, 0) != 0) ++ if (smart_rename (new_name, old_name, tmpfd, NULL, FALSE) != 0) + xexit (1); + free (old_name); + free (new_name); +diff -rup binutils.orig/binutils/arsup.c binutils-2.35.1/binutils/arsup.c +--- binutils.orig/binutils/arsup.c 2021-03-11 12:38:18.182422781 +0000 ++++ binutils-2.35.1/binutils/arsup.c 2021-03-11 12:47:43.246702325 +0000 +@@ -43,7 +43,7 @@ extern int deterministic; + static bfd *obfd; + static char *real_name; + static char *temp_name; +-static int real_ofd; ++static int temp_fd; + static FILE *outfile; + + static void +@@ -152,7 +152,7 @@ void + ar_open (char *name, int t) + { + real_name = xstrdup (name); +- temp_name = make_tempname (real_name, &real_ofd); ++ temp_name = make_tempname (real_name, &temp_fd); + + if (temp_name == NULL) + { +@@ -162,7 +162,7 @@ ar_open (char *name, int t) + return; + } + +- obfd = bfd_fdopenw (temp_name, NULL, real_ofd); ++ obfd = bfd_fdopenw (temp_name, NULL, temp_fd); + + if (!obfd) + { +@@ -343,29 +343,20 @@ ar_save (void) + } + else + { +- bfd_boolean skip_stat = FALSE; + struct stat target_stat; +- int ofd = real_ofd; + + if (deterministic > 0) + obfd->flags |= BFD_DETERMINISTIC_OUTPUT; + +-#if !defined (_WIN32) || defined (__CYGWIN32__) +- /* It's OK to fail; at worst it will result in SMART_RENAME using a slow +- copy fallback to write the output. */ +- ofd = dup (ofd); +-#endif ++ temp_fd = dup (temp_fd); + bfd_close (obfd); + +- if (lstat (real_name, &target_stat) != 0) ++ if (stat (real_name, &target_stat) != 0) + { + /* The temp file created in ar_open has mode 0600 as per mkstemp. + Create the real empty output file here so smart_rename will + update the mode according to the process umask. */ + obfd = bfd_openw (real_name, NULL); +- if (obfd == NULL +- || bfd_stat (obfd, &target_stat) != 0) +- skip_stat = TRUE; + if (obfd != NULL) + { + bfd_set_format (obfd, bfd_archive); +@@ -373,9 +364,8 @@ ar_save (void) + } + } + +- smart_rename (temp_name, real_name, ofd, +- skip_stat ? NULL : &target_stat, 0); +- obfd = 0; ++ smart_rename (temp_name, real_name, temp_fd, NULL, FALSE); ++ obfd = NULL; + free (temp_name); + free (real_name); + } +diff -rup binutils.orig/binutils/bucomm.h binutils-2.35.1/binutils/bucomm.h +--- binutils.orig/binutils/bucomm.h 2021-03-11 12:38:18.183422774 +0000 ++++ binutils-2.35.1/binutils/bucomm.h 2021-03-11 12:42:22.320815334 +0000 +@@ -71,7 +71,8 @@ extern void print_version (const char *) + /* In rename.c. */ + extern void set_times (const char *, const struct stat *); + +-extern int smart_rename (const char *, const char *, int, struct stat *, int); ++extern int smart_rename (const char *, const char *, int, ++ struct stat *, bfd_boolean); + + + /* In libiberty. */ +diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c +--- binutils.orig/binutils/objcopy.c 2021-03-11 12:38:18.181422787 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-03-11 12:51:09.486344417 +0000 +@@ -4802,12 +4802,7 @@ strip_main (int argc, char *argv[]) + else + tmpname = output_file; + +- if (tmpname == NULL +-#if !defined (_WIN32) || defined (__CYGWIN32__) +- /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */ +- || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1) +-#endif +- ) ++ if (tmpname == NULL) + { + bfd_nonfatal_message (argv[i], NULL, NULL, + _("could not create temporary file to hold stripped copy")); +@@ -4820,21 +4815,17 @@ strip_main (int argc, char *argv[]) + output_target, NULL); + if (status == 0) + { +- if (preserve_dates) +- set_times (tmpname, &statbuf); + if (output_file != tmpname) +- status = (smart_rename (tmpname, +- output_file ? output_file : argv[i], +- copyfd, &statbuf, preserve_dates) != 0); ++ status = smart_rename (tmpname, ++ output_file ? output_file : argv[i], ++ copyfd, &statbuf, preserve_dates) != 0; + if (status == 0) + status = hold_status; + } + else + { +-#if !defined (_WIN32) || defined (__CYGWIN32__) + if (copyfd >= 0) + close (copyfd); +-#endif + unlink_if_ordinary (tmpname); + } + if (output_file != tmpname) +@@ -5043,8 +5034,9 @@ copy_main (int argc, char *argv[]) + bfd_boolean formats_info = FALSE; + bfd_boolean use_globalize = FALSE; + bfd_boolean use_keep_global = FALSE; +- int c, tmpfd = -1; +- int copyfd = -1; ++ int c; ++ int tmpfd = -1; ++ int copyfd; + struct stat statbuf; + const bfd_arch_info_type *input_arch = NULL; + +@@ -5882,19 +5874,19 @@ copy_main (int argc, char *argv[]) + } + + /* If there is no destination file, or the source and destination files +- are the same, then create a temp and rename the result into the input. */ ++ are the same, then create a temp and copy the result into the input. */ ++ copyfd = -1; + if (output_filename == NULL + || filename_cmp (input_filename, output_filename) == 0) +- tmpname = make_tempname (input_filename, &tmpfd); ++ { ++ tmpname = make_tempname (input_filename, &tmpfd); ++ if (tmpfd >= 0) ++ copyfd = dup (tmpfd); ++ } + else + tmpname = output_filename; + +- if (tmpname == NULL +-#if !defined (_WIN32) || defined (__CYGWIN32__) +- /* Retain a copy of TMPFD since we will need it for SMART_RENAME. */ +- || (tmpfd >= 0 && (copyfd = dup (tmpfd)) == -1) +-#endif +- ) ++ if (tmpname == NULL) + { + fatal (_("warning: could not create temporary file whilst copying '%s', (error: %s)"), + input_filename, strerror (errno)); +@@ -5904,18 +5896,14 @@ copy_main (int argc, char *argv[]) + output_target, input_arch); + if (status == 0) + { +- if (preserve_dates) +- set_times (tmpname, &statbuf); + if (tmpname != output_filename) +- status = (smart_rename (tmpname, input_filename, copyfd, &statbuf, +- preserve_dates) != 0); ++ status = smart_rename (tmpname, input_filename, copyfd, ++ &statbuf, preserve_dates) != 0; + } + else + { +-#if !defined (_WIN32) || defined (__CYGWIN32__) + if (copyfd >= 0) + close (copyfd); +-#endif + unlink_if_ordinary (tmpname); + } + +diff -rup binutils.orig/binutils/rename.c binutils-2.35.1/binutils/rename.c +--- binutils.orig/binutils/rename.c 2021-03-11 12:38:18.183422774 +0000 ++++ binutils-2.35.1/binutils/rename.c 2021-03-11 12:41:41.824081969 +0000 +@@ -30,30 +30,25 @@ + #endif /* HAVE_UTIMES */ + #endif /* ! HAVE_GOOD_UTIME_H */ + +-#if ! defined (_WIN32) || defined (__CYGWIN32__) +-static int simple_copy (const char *, const char *); +- + /* The number of bytes to copy at once. */ + #define COPY_BUF 8192 + +-/* Copy file FROM to file TO, performing no translations. ++/* Copy file FROMFD to file TO, performing no translations. + Return 0 if ok, -1 if error. */ + + static int +-simple_copy (const char *from, const char *to) ++simple_copy (int fromfd, const char *to, ++ struct stat *target_stat ATTRIBUTE_UNUSED) + { +- int fromfd, tofd, nread; ++ int tofd, nread; + int saved; + char buf[COPY_BUF]; + +- fromfd = open (from, O_RDONLY | O_BINARY); +- if (fromfd < 0) ++ if (fromfd < 0 ++ || lseek (fromfd, 0, SEEK_SET) != 0) + return -1; +-#ifdef O_CREAT +- tofd = open (to, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0777); +-#else +- tofd = creat (to, 0777); +-#endif ++ ++ tofd = open (to, O_WRONLY | O_TRUNC | O_BINARY); + if (tofd < 0) + { + saved = errno; +@@ -61,6 +56,7 @@ simple_copy (const char *from, const cha + errno = saved; + return -1; + } ++ + while ((nread = read (fromfd, buf, sizeof buf)) > 0) + { + if (write (tofd, buf, nread) != nread) +@@ -72,7 +68,16 @@ simple_copy (const char *from, const cha + return -1; + } + } ++ + saved = errno; ++ ++#if !defined (_WIN32) || defined (__CYGWIN32__) ++ /* Writing to a setuid/setgid file may clear S_ISUID and S_ISGID. ++ Try to restore them, ignoring failure. */ ++ if (target_stat != NULL) ++ fchmod (tofd, target_stat->st_mode); ++#endif ++ + close (fromfd); + close (tofd); + if (nread < 0) +@@ -82,7 +87,6 @@ simple_copy (const char *from, const cha + } + return 0; + } +-#endif /* __CYGWIN32__ or not _WIN32 */ + + /* Set the times of the file DESTINATION to be the same as those in + STATBUF. */ +@@ -91,164 +95,52 @@ void + set_times (const char *destination, const struct stat *statbuf) + { + int result; +- +- { + #ifdef HAVE_GOOD_UTIME_H +- struct utimbuf tb; ++ struct utimbuf tb; + +- tb.actime = statbuf->st_atime; +- tb.modtime = statbuf->st_mtime; +- result = utime (destination, &tb); +-#else /* ! HAVE_GOOD_UTIME_H */ +-#ifndef HAVE_UTIMES +- long tb[2]; +- +- tb[0] = statbuf->st_atime; +- tb[1] = statbuf->st_mtime; +- result = utime (destination, tb); +-#else /* HAVE_UTIMES */ +- struct timeval tv[2]; +- +- tv[0].tv_sec = statbuf->st_atime; +- tv[0].tv_usec = 0; +- tv[1].tv_sec = statbuf->st_mtime; +- tv[1].tv_usec = 0; +- result = utimes (destination, tv); +-#endif /* HAVE_UTIMES */ +-#endif /* ! HAVE_GOOD_UTIME_H */ +- } +- +- if (result != 0) +- non_fatal (_("%s: cannot set time: %s"), destination, strerror (errno)); +-} +- +-#ifndef S_ISLNK +-#ifdef S_IFLNK +-#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) ++ tb.actime = statbuf->st_atime; ++ tb.modtime = statbuf->st_mtime; ++ result = utime (destination, &tb); ++#elif defined HAVE_UTIMES ++ struct timeval tv[2]; ++ ++ tv[0].tv_sec = statbuf->st_atime; ++ tv[0].tv_usec = 0; ++ tv[1].tv_sec = statbuf->st_mtime; ++ tv[1].tv_usec = 0; ++ result = utimes (destination, tv); + #else +-#define S_ISLNK(m) 0 +-#define lstat stat +-#endif +-#endif +- +-#if !defined (_WIN32) || defined (__CYGWIN32__) +-/* Try to preserve the permission bits and ownership of an existing file when +- rename overwrites it. FD is the file being renamed and TARGET_STAT has the +- status of the file that was overwritten. */ +-static void +-try_preserve_permissions (int fd, struct stat *target_stat) +-{ +- struct stat from_stat; +- int ret = 0; +- +- if (fstat (fd, &from_stat) != 0) +- return; ++ long tb[2]; + +- int from_mode = from_stat.st_mode & 0777; +- int to_mode = target_stat->st_mode & 0777; ++ tb[0] = statbuf->st_atime; ++ tb[1] = statbuf->st_mtime; ++ result = utime (destination, tb); ++#endif + +- /* Fix up permissions before we potentially lose ownership with fchown. +- Clear the setxid bits because in case the fchown below fails then we don't +- want to end up with a sxid file owned by the invoking user. If the user +- hasn't changed or if fchown succeeded, we add back the sxid bits at the +- end. */ +- if (from_mode != to_mode) +- fchmod (fd, to_mode); +- +- /* Fix up ownership, this will clear the setxid bits. */ +- if (from_stat.st_uid != target_stat->st_uid +- || from_stat.st_gid != target_stat->st_gid) +- ret = fchown (fd, target_stat->st_uid, target_stat->st_gid); +- +- /* Fix up the sxid bits if either the fchown wasn't needed or it +- succeeded. */ +- if (ret == 0) +- fchmod (fd, target_stat->st_mode & 07777); ++ if (result != 0) ++ non_fatal (_("%s: cannot set time: %s"), destination, strerror (errno)); + } +-#endif + +-/* Rename FROM to TO, copying if TO is either a link or is not a regular file. +- FD is an open file descriptor pointing to FROM that we can use to safely fix +- up permissions of the file after renaming. TARGET_STAT has the file status +- that is used to fix up permissions and timestamps after rename. Return 0 if +- ok, -1 if error and FD is closed before returning. */ ++/* Copy FROM to TO. TARGET_STAT has the file status that, if non-NULL, ++ is used to fix up timestamps. Return 0 if ok, -1 if error. ++ At one time this function renamed files, but file permissions are ++ tricky to update given the number of different schemes used by ++ various systems. So now we just copy. */ + + int +-smart_rename (const char *from, const char *to, int fd ATTRIBUTE_UNUSED, +- struct stat *target_stat ATTRIBUTE_UNUSED, +- int preserve_dates ATTRIBUTE_UNUSED) ++smart_rename (const char *from, const char *to, int fromfd, ++ struct stat *target_stat, bfd_boolean preserve_dates) + { +- int ret = 0; +- struct stat to_stat; +- bfd_boolean exists; +- +- exists = lstat (to, &to_stat) == 0; +- +-#if defined (_WIN32) && !defined (__CYGWIN32__) +- /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but +- fail instead. Also, chown is not present. */ ++ int ret; + +- if (exists) +- remove (to); +- +- ret = rename (from, to); ++ ret = simple_copy (fromfd, to, target_stat); + if (ret != 0) +- { +- /* We have to clean up here. */ +- non_fatal (_("unable to rename '%s'; reason: %s"), to, strerror (errno)); +- unlink (from); +- } +-#else +- /* Avoid a full copy and use rename if we can fix up permissions of the +- file after renaming, i.e.: ++ non_fatal (_("unable to copy file '%s'; reason: %s"), ++ to, strerror (errno)); + +- - TO is not a symbolic link +- - TO is a regular file with only one hard link +- - We have permission to write to TO +- - FD is available to safely fix up permissions to be the same as the file +- we overwrote with the rename. +- +- Note though that the actual file on disk that TARGET_STAT describes may +- have changed and we're only trying to preserve the status we know about. +- At no point do we try to interact with the new file changes, so there can +- only be two outcomes, i.e. either the external file change survives +- without knowledge of our change (if it happens after the rename syscall) +- or our rename and permissions fixup survive without any knowledge of the +- external change. */ +- if (! exists +- || (fd >= 0 +- && !S_ISLNK (to_stat.st_mode) +- && S_ISREG (to_stat.st_mode) +- && (to_stat.st_mode & S_IWUSR) +- && to_stat.st_nlink == 1) +- ) +- { +- ret = rename (from, to); +- if (ret == 0) +- { +- if (exists && target_stat != NULL) +- try_preserve_permissions (fd, target_stat); +- } +- else +- { +- /* We have to clean up here. */ +- non_fatal (_("unable to rename '%s'; reason: %s"), to, strerror (errno)); +- unlink (from); +- } +- } +- else +- { +- ret = simple_copy (from, to); +- if (ret != 0) +- non_fatal (_("unable to copy file '%s'; reason: %s"), to, strerror (errno)); +- +- if (preserve_dates && target_stat != NULL) +- set_times (to, target_stat); +- unlink (from); +- } +- if (fd >= 0) +- close (fd); +-#endif /* _WIN32 && !__CYGWIN32__ */ ++ if (preserve_dates) ++ set_times (to, target_stat); ++ unlink (from); + + return ret; + } +diff -rup binutils.orig/binutils/objcopy.c binutils-2.35.1/binutils/objcopy.c +--- binutils.orig/binutils/objcopy.c 2021-03-11 13:21:44.780223078 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-03-11 13:23:01.041718818 +0000 +@@ -4798,7 +4798,11 @@ strip_main (int argc, char *argv[]) + + if (output_file == NULL + || filename_cmp (argv[i], output_file) == 0) +- tmpname = make_tempname (argv[i], &tmpfd); ++ { ++ tmpname = make_tempname (argv[i], &tmpfd); ++ if (tmpfd >= 0) ++ copyfd = dup (tmpfd); ++ } + else + tmpname = output_file; + diff --git a/SOURCES/binutils-CVE-2021-20284.patch b/SOURCES/binutils-CVE-2021-20284.patch new file mode 100644 index 0000000..8b4a519 --- /dev/null +++ b/SOURCES/binutils-CVE-2021-20284.patch @@ -0,0 +1,58 @@ +diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.35.1/bfd/elf-bfd.h +--- binutils.orig/bfd/elf-bfd.h 2021-03-12 12:20:04.495125388 +0000 ++++ binutils-2.35.1/bfd/elf-bfd.h 2021-03-12 12:21:25.696583280 +0000 +@@ -1562,7 +1562,7 @@ struct elf_backend_data + const char *, unsigned int); + + /* Called when after loading the normal relocs for a section. */ +- bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **); ++ bfd_boolean (*slurp_secondary_relocs) (bfd *, asection *, asymbol **, bfd_boolean); + + /* Called after writing the normal relocs for a section. */ + bfd_boolean (*write_secondary_relocs) (bfd *, asection *); +@@ -2909,7 +2909,7 @@ extern bfd_boolean is_debuginfo_file (bf + extern bfd_boolean _bfd_elf_init_secondary_reloc_section + (bfd *, Elf_Internal_Shdr *, const char *, unsigned int); + extern bfd_boolean _bfd_elf_slurp_secondary_reloc_section +- (bfd *, asection *, asymbol **); ++(bfd *, asection *, asymbol **, bfd_boolean); + extern bfd_boolean _bfd_elf_copy_special_section_fields + (const bfd *, bfd *, const Elf_Internal_Shdr *, Elf_Internal_Shdr *); + extern bfd_boolean _bfd_elf_write_secondary_reloc_section +diff -rup binutils.orig/bfd/elf.c binutils-2.35.1/bfd/elf.c +--- binutils.orig/bfd/elf.c 2021-03-12 12:20:04.496125381 +0000 ++++ binutils-2.35.1/bfd/elf.c 2021-03-12 12:20:46.032848074 +0000 +@@ -12513,7 +12513,8 @@ _bfd_elf_init_secondary_reloc_section (b + bfd_boolean + _bfd_elf_slurp_secondary_reloc_section (bfd * abfd, + asection * sec, +- asymbol ** symbols) ++ asymbol ** symbols, ++ bfd_boolean dynamic) + { + const struct elf_backend_data * const ebd = get_elf_backend_data (abfd); + asection * relsec; +@@ -12590,7 +12591,10 @@ _bfd_elf_slurp_secondary_reloc_section ( + continue; + } + +- symcount = bfd_get_symcount (abfd); ++ if (dynamic) ++ symcount = bfd_get_dynamic_symcount (abfd); ++ else ++ symcount = bfd_get_symcount (abfd); + + for (i = 0, internal_reloc = internal_relocs, + native_reloc = native_relocs; +diff -rup binutils.orig/bfd/elfcode.h binutils-2.35.1/bfd/elfcode.h +--- binutils.orig/bfd/elfcode.h 2021-03-12 12:20:04.533125134 +0000 ++++ binutils-2.35.1/bfd/elfcode.h 2021-03-12 12:21:59.568357132 +0000 +@@ -1591,7 +1591,7 @@ elf_slurp_reloc_table (bfd *abfd, + symbols, dynamic)) + return FALSE; + +- if (!bed->slurp_secondary_relocs (abfd, asect, symbols)) ++ if (!bed->slurp_secondary_relocs (abfd, asect, symbols, dynamic)) + return FALSE; + + asect->relocation = relents; diff --git a/SOURCES/binutils-CVE-2021-3487.patch b/SOURCES/binutils-CVE-2021-3487.patch new file mode 100644 index 0000000..6ba1244 --- /dev/null +++ b/SOURCES/binutils-CVE-2021-3487.patch @@ -0,0 +1,34 @@ +--- binutils.orig/bfd/dwarf2.c 2021-04-09 16:59:18.345187116 +0100 ++++ binutils-2.35/bfd/dwarf2.c 2021-04-09 17:02:03.614064723 +0100 +@@ -539,6 +539,8 @@ read_section (bfd * abfd, + /* The section may have already been read. */ + if (contents == NULL) + { ++ ufile_ptr filesize; ++ + msec = bfd_get_section_by_name (abfd, section_name); + if (! msec) + { +@@ -554,10 +556,20 @@ read_section (bfd * abfd, + return FALSE; + } + +- *section_size = msec->rawsize ? msec->rawsize : msec->size; ++ amt = bfd_get_section_limit_octets (abfd, msec); ++ filesize = bfd_get_file_size (abfd); ++ if (amt >= filesize) ++ { ++ /* PR 26946 */ ++ _bfd_error_handler (_("DWARF error: section %s is larger than its filesize! (0x%lx vs 0x%lx)"), ++ section_name, (long) amt, (long) filesize); ++ bfd_set_error (bfd_error_bad_value); ++ return FALSE; ++ } ++ *section_size = amt; + /* Paranoia - alloc one extra so that we can make sure a string + section is NUL terminated. */ +- amt = *section_size + 1; ++ amt += 1; + if (amt == 0) + { + bfd_set_error (bfd_error_no_memory); diff --git a/SOURCES/binutils-SHF_LINK_ORDER.patch b/SOURCES/binutils-SHF_LINK_ORDER.patch new file mode 100644 index 0000000..98a8a62 --- /dev/null +++ b/SOURCES/binutils-SHF_LINK_ORDER.patch @@ -0,0 +1,223 @@ +diff -rup binutils.orig/bfd/bfd-in2.h binutils-2.35.1/bfd/bfd-in2.h +--- binutils.orig/bfd/bfd-in2.h 2021-01-04 13:18:10.234368481 +0000 ++++ binutils-2.35.1/bfd/bfd-in2.h 2021-01-04 13:18:20.596301287 +0000 +@@ -1177,6 +1177,9 @@ typedef struct bfd_section + struct bfd_symbol *symbol; + struct bfd_symbol **symbol_ptr_ptr; + ++ /* The matching section name pattern in linker script. */ ++ const char *pattern; ++ + /* Early in the link process, map_head and map_tail are used to build + a list of input sections attached to an output section. Later, + output sections use these fields for a list of bfd_link_order +@@ -1370,8 +1373,8 @@ discarded_section (const asection *sec) + /* target_index, used_by_bfd, constructor_chain, owner, */ \ + 0, NULL, NULL, NULL, \ + \ +- /* symbol, symbol_ptr_ptr, */ \ +- (struct bfd_symbol *) SYM, &SEC.symbol, \ ++ /* symbol, symbol_ptr_ptr, pattern, */ \ ++ (struct bfd_symbol *) SYM, &SEC.symbol, NULL, \ + \ + /* map_head, map_tail, already_assigned */ \ + { NULL }, { NULL }, NULL \ +diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c +--- binutils.orig/bfd/elflink.c 2021-01-04 13:18:10.223368552 +0000 ++++ binutils-2.35.1/bfd/elflink.c 2021-01-04 13:18:20.599301268 +0000 +@@ -11662,8 +11662,21 @@ compare_link_order (const void *a, const + const struct bfd_link_order *blo = *(const struct bfd_link_order **) b; + asection *asec = elf_linked_to_section (alo->u.indirect.section); + asection *bsec = elf_linked_to_section (blo->u.indirect.section); +- bfd_vma apos = asec->output_section->lma + asec->output_offset; +- bfd_vma bpos = bsec->output_section->lma + bsec->output_offset; ++ bfd_vma apos, bpos; ++ ++ /* Check if any sections are unordered. */ ++ if (asec == NULL || bsec == NULL) ++ { ++ /* Place ordered sections before unordered sections. */ ++ if (bsec != NULL) ++ return 1; ++ else if (asec != NULL) ++ return -1; ++ return 0; ++ } ++ ++ apos = asec->output_section->lma + asec->output_offset; ++ bpos = bsec->output_section->lma + bsec->output_offset; + + if (apos < bpos) + return -1; +@@ -11698,14 +11711,14 @@ compare_link_order (const void *a, const + sections. Ideally we'd do this in the linker proper. */ + + static bfd_boolean +-elf_fixup_link_order (bfd *abfd, asection *o) ++elf_fixup_link_order (struct bfd_link_info *info, bfd *abfd, asection *o) + { + size_t seen_linkorder; + size_t seen_other; + size_t n; + struct bfd_link_order *p; + bfd *sub; +- struct bfd_link_order **sections; ++ struct bfd_link_order **sections, **indirect_sections; + asection *other_sec, *linkorder_sec; + bfd_vma offset; /* Octets. */ + +@@ -11736,7 +11749,9 @@ elf_fixup_link_order (bfd *abfd, asectio + else + seen_other++; + +- if (seen_other && seen_linkorder) ++ /* Allow mixed ordered and unordered input sections for ++ non-relocatable link. */ ++ if (bfd_link_relocatable (info) && seen_other && seen_linkorder) + { + if (other_sec && linkorder_sec) + _bfd_error_handler +@@ -11756,6 +11771,10 @@ elf_fixup_link_order (bfd *abfd, asectio + if (!seen_linkorder) + return TRUE; + ++ /* Non-relocatable output can have both ordered and unordered input ++ sections. */ ++ seen_linkorder += seen_other; ++ + sections = bfd_malloc (seen_linkorder * sizeof (*sections)); + if (sections == NULL) + return FALSE; +@@ -11764,22 +11783,51 @@ elf_fixup_link_order (bfd *abfd, asectio + for (p = o->map_head.link_order; p != NULL; p = p->next) + sections[seen_linkorder++] = p; + +- /* Sort the input sections in the order of their linked section. */ +- qsort (sections, seen_linkorder, sizeof (*sections), compare_link_order); ++ for (indirect_sections = sections, n = 0; n < seen_linkorder;) ++ { ++ /* Find the first bfd_indirect_link_order section. */ ++ if (indirect_sections[0]->type == bfd_indirect_link_order) ++ { ++ /* Count the consecutive bfd_indirect_link_order sections ++ with the same pattern. */ ++ size_t i, n_indirect; ++ const char *pattern ++ = indirect_sections[0]->u.indirect.section->pattern; ++ for (i = n + 1; i < seen_linkorder; i++) ++ if (sections[i]->type != bfd_indirect_link_order ++ || sections[i]->u.indirect.section->pattern != pattern) ++ break; ++ n_indirect = i - n; ++ /* Sort the bfd_indirect_link_order sections in the order of ++ their linked section. */ ++ qsort (indirect_sections, n_indirect, sizeof (*sections), ++ compare_link_order); ++ indirect_sections += n_indirect; ++ n += n_indirect; ++ } ++ else ++ { ++ indirect_sections++; ++ n++; ++ } ++ } + +- /* Change the offsets of the sections. */ ++ /* Change the offsets of the bfd_indirect_link_order sections. */ + offset = 0; + for (n = 0; n < seen_linkorder; n++) +- { +- bfd_vma mask; +- asection *s = sections[n]->u.indirect.section; +- unsigned int opb = bfd_octets_per_byte (abfd, s); +- +- mask = ~(bfd_vma) 0 << s->alignment_power * opb; +- offset = (offset + ~mask) & mask; +- sections[n]->offset = s->output_offset = offset / opb; +- offset += sections[n]->size; +- } ++ if (sections[n]->type == bfd_indirect_link_order) ++ { ++ bfd_vma mask; ++ asection *s = sections[n]->u.indirect.section; ++ unsigned int opb = bfd_octets_per_byte (abfd, s); ++ ++ mask = ~(bfd_vma) 0 << s->alignment_power * opb; ++ offset = (offset + ~mask) & mask; ++ sections[n]->offset = s->output_offset = offset / opb; ++ offset += sections[n]->size; ++ } ++ else ++ offset = sections[n]->offset + sections[n]->size; + + free (sections); + return TRUE; +@@ -12408,7 +12456,7 @@ bfd_elf_final_link (bfd *abfd, struct bf + /* Reorder SHF_LINK_ORDER sections. */ + for (o = abfd->sections; o != NULL; o = o->next) + { +- if (!elf_fixup_link_order (abfd, o)) ++ if (!elf_fixup_link_order (info, abfd, o)) + return FALSE; + } + +diff -rup binutils.orig/bfd/section.c binutils-2.35.1/bfd/section.c +--- binutils.orig/bfd/section.c 2021-01-04 13:18:10.233368487 +0000 ++++ binutils-2.35.1/bfd/section.c 2021-01-04 13:18:20.599301268 +0000 +@@ -541,6 +541,9 @@ CODE_FRAGMENT + . struct bfd_symbol *symbol; + . struct bfd_symbol **symbol_ptr_ptr; + . ++. {* The matching section name pattern in linker script. *} ++. const char *pattern; ++. + . {* Early in the link process, map_head and map_tail are used to build + . a list of input sections attached to an output section. Later, + . output sections use these fields for a list of bfd_link_order +@@ -734,8 +737,8 @@ CODE_FRAGMENT + . {* target_index, used_by_bfd, constructor_chain, owner, *} \ + . 0, NULL, NULL, NULL, \ + . \ +-. {* symbol, symbol_ptr_ptr, *} \ +-. (struct bfd_symbol *) SYM, &SEC.symbol, \ ++. {* symbol, symbol_ptr_ptr, pattern, *} \ ++. (struct bfd_symbol *) SYM, &SEC.symbol, NULL, \ + . \ + . {* map_head, map_tail, already_assigned *} \ + . { NULL }, { NULL }, NULL \ +diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.35.1/gas/config/obj-elf.c +--- binutils.orig/gas/config/obj-elf.c 2021-01-04 13:18:09.942370375 +0000 ++++ binutils-2.35.1/gas/config/obj-elf.c 2021-01-04 13:18:20.599301268 +0000 +@@ -659,7 +659,9 @@ obj_elf_change_section (const char *name + } + } + +- if (old_sec == NULL && ((attr & ~(SHF_MASKOS | SHF_MASKPROC)) ++ if (old_sec == NULL && ((attr & ~(SHF_LINK_ORDER ++ | SHF_MASKOS ++ | SHF_MASKPROC)) + & ~ssect->attr) != 0) + { + /* As a GNU extension, we permit a .note section to be +diff -rup binutils.orig/ld/ldlang.c binutils-2.35.1/ld/ldlang.c +--- binutils.orig/ld/ldlang.c 2021-01-04 13:18:09.691372002 +0000 ++++ binutils-2.35.1/ld/ldlang.c 2021-01-04 13:18:20.600301261 +0000 +@@ -7421,7 +7421,7 @@ lang_reset_memory_regions (void) + + static void + gc_section_callback (lang_wild_statement_type *ptr, +- struct wildcard_list *sec ATTRIBUTE_UNUSED, ++ struct wildcard_list *sec, + asection *section, + struct flag_info *sflag_info ATTRIBUTE_UNUSED, + lang_input_statement_type *file ATTRIBUTE_UNUSED, +@@ -7431,6 +7431,8 @@ gc_section_callback (lang_wild_statement + should be as well. */ + if (ptr->keep_sections) + section->flags |= SEC_KEEP; ++ if (sec) ++ section->pattern = sec->spec.name; + } + + /* Iterate over sections marking them against GC. */ diff --git a/SOURCES/binutils-aarch64-condbranch-relocs.patch b/SOURCES/binutils-aarch64-condbranch-relocs.patch new file mode 100644 index 0000000..b12070f --- /dev/null +++ b/SOURCES/binutils-aarch64-condbranch-relocs.patch @@ -0,0 +1,93 @@ +diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c +--- binutils.orig/bfd/elfnn-aarch64.c 2020-09-10 17:03:31.738458044 +0100 ++++ binutils-2.35/bfd/elfnn-aarch64.c 2020-09-10 17:04:03.643344898 +0100 +@@ -5445,7 +5445,6 @@ elfNN_aarch64_final_link_relocate (reloc + bfd_vma orig_value = value; + bfd_boolean resolved_to_zero; + bfd_boolean abs_symbol_p; +- bfd_boolean via_plt_p; + + globals = elf_aarch64_hash_table (info); + +@@ -5467,8 +5466,6 @@ elfNN_aarch64_final_link_relocate (reloc + : bfd_is_und_section (sym_sec)); + abs_symbol_p = h != NULL && bfd_is_abs_symbol (&h->root); + +- via_plt_p = (globals->root.splt != NULL && h != NULL +- && h->plt.offset != (bfd_vma) - 1); + + /* Since STT_GNU_IFUNC symbol must go through PLT, we handle + it here if it is defined in a non-shared object. */ +@@ -5805,23 +5802,12 @@ elfNN_aarch64_final_link_relocate (reloc + value += signed_addend; + break; + +- case BFD_RELOC_AARCH64_BRANCH19: +- case BFD_RELOC_AARCH64_TSTBR14: +- /* A conditional branch to an undefined weak symbol is converted to a +- branch to itself. */ +- if (weak_undef_p && !via_plt_p) +- { +- value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, +- place, value, +- signed_addend, +- weak_undef_p); +- break; +- } +- /* Fall through. */ + case BFD_RELOC_AARCH64_CALL26: + case BFD_RELOC_AARCH64_JUMP26: + { + asection *splt = globals->root.splt; ++ bfd_boolean via_plt_p = ++ splt != NULL && h != NULL && h->plt.offset != (bfd_vma) - 1; + + /* A call to an undefined weak symbol is converted to a jump to + the next instruction unless a PLT entry will be created. +@@ -5902,6 +5888,23 @@ elfNN_aarch64_final_link_relocate (reloc + bfd_set_error (bfd_error_bad_value); + return bfd_reloc_notsupported; + } ++ value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, ++ place, value, ++ signed_addend, ++ weak_undef_p); ++ break; ++ ++ case BFD_RELOC_AARCH64_BRANCH19: ++ case BFD_RELOC_AARCH64_TSTBR14: ++ if (h && h->root.type == bfd_link_hash_undefined) ++ { ++ _bfd_error_handler ++ /* xgettext:c-format */ ++ (_("%pB: conditional branch to undefined symbol `%s' " ++ "not allowed"), input_bfd, h->root.root.string); ++ bfd_set_error (bfd_error_bad_value); ++ return bfd_reloc_notsupported; ++ } + /* Fall through. */ + + case BFD_RELOC_AARCH64_16: +@@ -7967,8 +7970,6 @@ elfNN_aarch64_check_relocs (bfd *abfd, s + break; + } + +- case BFD_RELOC_AARCH64_BRANCH19: +- case BFD_RELOC_AARCH64_TSTBR14: + case BFD_RELOC_AARCH64_CALL26: + case BFD_RELOC_AARCH64_JUMP26: + /* If this is a local symbol then we resolve it +Only in binutils-2.35/bfd: elfnn-aarch64.c.orig +diff -rup binutils.orig/ld/testsuite/ld-aarch64/emit-relocs-560.d binutils-2.35/ld/testsuite/ld-aarch64/emit-relocs-560.d +--- binutils.orig/ld/testsuite/ld-aarch64/emit-relocs-560.d 2020-09-10 17:03:31.067460424 +0100 ++++ binutils-2.35/ld/testsuite/ld-aarch64/emit-relocs-560.d 2020-09-10 17:04:03.644344895 +0100 +@@ -1,8 +1,3 @@ + #source: emit-relocs-560.s + #ld: -shared +-#readelf: -r +- +-Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 2 entries: +- Offset Info Type Sym. Value Sym. Name \+ Addend +-[0-9a-f]+ 000100000402 R_AARCH64_JUMP_SL 0000000000000000 baz \+ 0 +-[0-9a-f]+ 000200000402 R_AARCH64_JUMP_SL 0000000000000000 bar \+ 0 ++#error: .*: conditional branch to undefined symbol `bar' not allowed diff --git a/SOURCES/binutils-add-sym-cache-to-elf-link-hash.patch b/SOURCES/binutils-add-sym-cache-to-elf-link-hash.patch new file mode 100644 index 0000000..85b2006 --- /dev/null +++ b/SOURCES/binutils-add-sym-cache-to-elf-link-hash.patch @@ -0,0 +1,1981 @@ +diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.35/bfd/elf-bfd.h +--- binutils.orig/bfd/elf-bfd.h 2020-07-30 15:04:05.366466702 +0100 ++++ binutils-2.35/bfd/elf-bfd.h 2020-07-30 15:04:16.707393960 +0100 +@@ -549,6 +549,16 @@ enum elf_target_os + is_nacl /* Native Client. */ + }; + ++/* Used by bfd_sym_from_r_symndx to cache a small number of local ++ symbols. */ ++#define LOCAL_SYM_CACHE_SIZE 32 ++struct sym_cache ++{ ++ bfd *abfd; ++ unsigned long indx[LOCAL_SYM_CACHE_SIZE]; ++ Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE]; ++}; ++ + /* ELF linker hash table. */ + + struct elf_link_hash_table +@@ -676,6 +686,9 @@ struct elf_link_hash_table + /* A linked list of dynamic BFD's loaded in the link. */ + struct elf_link_loaded_list *dyn_loaded; + ++ /* Small local sym cache. */ ++ struct sym_cache sym_cache; ++ + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *sgotplt; +@@ -717,16 +730,6 @@ struct elf_link_hash_table + /* Returns TRUE if the hash table is a struct elf_link_hash_table. */ + #define is_elf_hash_table(htab) \ + (((struct bfd_link_hash_table *) (htab))->type == bfd_link_elf_hash_table) +- +-/* Used by bfd_sym_from_r_symndx to cache a small number of local +- symbols. */ +-#define LOCAL_SYM_CACHE_SIZE 32 +-struct sym_cache +-{ +- bfd *abfd; +- unsigned long indx[LOCAL_SYM_CACHE_SIZE]; +- Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE]; +-}; + + /* Constant information held for an ELF backend. */ + +diff -rup binutils.orig/bfd/elf32-arm.c binutils-2.35/bfd/elf32-arm.c +--- binutils.orig/bfd/elf32-arm.c 2020-07-30 15:04:05.376466638 +0100 ++++ binutils-2.35/bfd/elf32-arm.c 2020-07-30 15:04:16.708393953 +0100 +@@ -3390,9 +3390,6 @@ struct elf32_arm_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* For convenience in allocate_dynrelocs. */ + bfd * obfd; + +@@ -15316,7 +15313,7 @@ elf32_arm_check_relocs (bfd *abfd, struc + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -16871,7 +16868,8 @@ elf32_arm_size_dynamic_sections (bfd * o + s->size += 4; + } + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, symndx); ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ibfd, ++ symndx); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf32-bfin.c binutils-2.35/bfd/elf32-bfin.c +--- binutils.orig/bfd/elf32-bfin.c 2020-07-30 15:04:05.377466632 +0100 ++++ binutils-2.35/bfd/elf32-bfin.c 2020-07-30 15:04:16.709393947 +0100 +@@ -4791,16 +4791,6 @@ struct bfin_link_hash_entry + struct bfin_pcrel_relocs_copied *pcrel_relocs_copied; + }; + +-/* bfin ELF linker hash table. */ +- +-struct bfin_link_hash_table +-{ +- struct elf_link_hash_table root; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +-}; +- + #define bfin_hash_entry(ent) ((struct bfin_link_hash_entry *) (ent)) + + static struct bfd_hash_entry * +@@ -4829,15 +4819,14 @@ bfin_link_hash_newfunc (struct bfd_hash_ + static struct bfd_link_hash_table * + bfin_link_hash_table_create (bfd * abfd) + { +- struct bfin_link_hash_table *ret; +- size_t amt = sizeof (struct bfin_link_hash_table); ++ struct elf_link_hash_table *ret; ++ size_t amt = sizeof (struct elf_link_hash_table); + + ret = bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + +- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, +- bfin_link_hash_newfunc, ++ if (!_bfd_elf_link_hash_table_init (ret, abfd, bfin_link_hash_newfunc, + sizeof (struct elf_link_hash_entry), + BFIN_ELF_DATA)) + { +@@ -4845,9 +4834,7 @@ bfin_link_hash_table_create (bfd * abfd) + return NULL; + } + +- ret->sym_cache.abfd = NULL; +- +- return &ret->root.root; ++ return &ret->root; + } + + /* The size in bytes of an entry in the procedure linkage table. */ +@@ -5418,10 +5405,6 @@ struct bfd_elf_special_section const elf + + #define bfd_elf32_bfd_is_local_label_name \ + bfin_is_local_label_name +-#define bfin_hash_table(p) \ +- ((struct bfin_link_hash_table *) (p)->hash) +- +- + + #define elf_backend_create_dynamic_sections \ + _bfd_elf_create_dynamic_sections +diff -rup binutils.orig/bfd/elf32-csky.c binutils-2.35/bfd/elf32-csky.c +--- binutils.orig/bfd/elf32-csky.c 2020-07-30 15:04:05.378466625 +0100 ++++ binutils-2.35/bfd/elf32-csky.c 2020-07-30 15:04:16.709393947 +0100 +@@ -1208,9 +1208,6 @@ struct csky_elf_link_hash_table + { + struct elf_link_hash_table elf; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Data for R_CKCORE_TLS_LDM32 relocations. */ + union + { +@@ -2477,7 +2474,7 @@ csky_elf_check_relocs (bfd * abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -2584,7 +2581,7 @@ csky_elf_check_relocs (bfd * abfd, + asection *s; + Elf_Internal_Sym *loc_isym; + +- loc_isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ loc_isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (loc_isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-hppa.c binutils-2.35/bfd/elf32-hppa.c +--- binutils.orig/bfd/elf32-hppa.c 2020-07-30 15:04:05.368466689 +0100 ++++ binutils-2.35/bfd/elf32-hppa.c 2020-07-30 15:04:16.709393947 +0100 +@@ -286,9 +286,6 @@ struct elf32_hppa_link_hash_table + /* Set if we need a .plt stub to support lazy dynamic linking. */ + unsigned int need_plt_stub:1; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Data for LDM relocations. */ + union + { +@@ -1465,7 +1462,7 @@ elf32_hppa_check_relocs (bfd *abfd, + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -4038,7 +4035,7 @@ elf32_hppa_relocate_section (bfd *output + else + { + Elf_Internal_Sym *isym +- = bfd_sym_from_r_symndx (&htab->sym_cache, ++ = bfd_sym_from_r_symndx (&htab->etab.sym_cache, + input_bfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.35/bfd/elf32-i386.c +--- binutils.orig/bfd/elf32-i386.c 2020-07-30 15:04:05.380466612 +0100 ++++ binutils-2.35/bfd/elf32-i386.c 2020-07-30 15:04:16.710393941 +0100 +@@ -1158,7 +1158,7 @@ elf_i386_tls_transition (struct bfd_link + { + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL); + } +@@ -1251,7 +1251,7 @@ elf_i386_convert_load_reloc (bfd *abfd, + else + { + local_ref = TRUE; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, + r_symndx); + abs_symbol = isym->st_shndx == SHN_ABS; + } +@@ -1529,7 +1529,7 @@ elf_i386_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +@@ -1859,7 +1859,7 @@ elf_i386_check_relocs (bfd *abfd, + void **vpp; + asection *s; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +diff -rup binutils.orig/bfd/elf32-m32r.c binutils-2.35/bfd/elf32-m32r.c +--- binutils.orig/bfd/elf32-m32r.c 2020-07-30 15:04:05.370466676 +0100 ++++ binutils-2.35/bfd/elf32-m32r.c 2020-07-30 15:04:16.710393941 +0100 +@@ -1498,20 +1498,6 @@ struct elf_m32r_pcrel_relocs_copied + bfd_size_type count; + }; + +-/* m32r ELF linker hash table. */ +- +-struct elf_m32r_link_hash_table +-{ +- struct elf_link_hash_table root; +- +- /* Short-cuts to get to dynamic linker sections. */ +- asection *sdynbss; +- asection *srelbss; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +-}; +- + /* Traverse an m32r ELF linker hash table. */ + + #define m32r_elf_link_hash_traverse(table, func, info) \ +@@ -1524,21 +1510,21 @@ struct elf_m32r_link_hash_table + + #define m32r_elf_hash_table(p) \ + (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ +- == M32R_ELF_DATA ? ((struct elf_m32r_link_hash_table *) ((p)->hash)) : NULL) ++ == M32R_ELF_DATA ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL) + + /* Create an m32r ELF linker hash table. */ + + static struct bfd_link_hash_table * + m32r_elf_link_hash_table_create (bfd *abfd) + { +- struct elf_m32r_link_hash_table *ret; +- size_t amt = sizeof (struct elf_m32r_link_hash_table); ++ struct elf_link_hash_table *ret; ++ size_t amt = sizeof (struct elf_link_hash_table); + + ret = bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + +- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, ++ if (!_bfd_elf_link_hash_table_init (ret, abfd, + _bfd_elf_link_hash_newfunc, + sizeof (struct elf_link_hash_entry), + M32R_ELF_DATA)) +@@ -1547,7 +1533,7 @@ m32r_elf_link_hash_table_create (bfd *ab + return NULL; + } + +- return &ret->root.root; ++ return &ret->root; + } + + /* Create dynamic sections when linking against a dynamic object. */ +@@ -1555,7 +1541,7 @@ m32r_elf_link_hash_table_create (bfd *ab + static bfd_boolean + m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + flagword flags, pltflags; + asection *s; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); +@@ -1578,7 +1564,7 @@ m32r_elf_create_dynamic_sections (bfd *a + pltflags |= SEC_READONLY; + + s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags); +- htab->root.splt = s; ++ htab->splt = s; + if (s == NULL + || !bfd_set_section_alignment (s, bed->plt_alignment)) + return FALSE; +@@ -1598,7 +1584,7 @@ m32r_elf_create_dynamic_sections (bfd *a + h = (struct elf_link_hash_entry *) bh; + h->def_regular = 1; + h->type = STT_OBJECT; +- htab->root.hplt = h; ++ htab->hplt = h; + + if (bfd_link_pic (info) + && ! bfd_elf_link_record_dynamic_symbol (info, h)) +@@ -1609,12 +1595,12 @@ m32r_elf_create_dynamic_sections (bfd *a + bed->default_use_rela_p + ? ".rela.plt" : ".rel.plt", + flags | SEC_READONLY); +- htab->root.srelplt = s; ++ htab->srelplt = s; + if (s == NULL + || !bfd_set_section_alignment (s, ptralign)) + return FALSE; + +- if (htab->root.sgot == NULL ++ if (htab->sgot == NULL + && !_bfd_elf_create_got_section (abfd, info)) + return FALSE; + +@@ -1669,7 +1655,7 @@ static bfd_boolean + m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *s; + +@@ -1796,7 +1782,7 @@ static bfd_boolean + allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) + { + struct bfd_link_info *info; +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + struct elf_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) +@@ -1807,7 +1793,7 @@ allocate_dynrelocs (struct elf_link_hash + if (htab == NULL) + return FALSE; + +- if (htab->root.dynamic_sections_created ++ if (htab->dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. +@@ -1821,7 +1807,7 @@ allocate_dynrelocs (struct elf_link_hash + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h)) + { +- asection *s = htab->root.splt; ++ asection *s = htab->splt; + + /* If this is the first .plt entry, make room for the special + first entry. */ +@@ -1847,10 +1833,10 @@ allocate_dynrelocs (struct elf_link_hash + + /* We also need to make an entry in the .got.plt section, which + will be placed in the .got section by the linker script. */ +- htab->root.sgotplt->size += 4; ++ htab->sgotplt->size += 4; + + /* We also need to make an entry in the .rel.plt section. */ +- htab->root.srelplt->size += sizeof (Elf32_External_Rela); ++ htab->srelplt->size += sizeof (Elf32_External_Rela); + } + else + { +@@ -1878,13 +1864,13 @@ allocate_dynrelocs (struct elf_link_hash + return FALSE; + } + +- s = htab->root.sgot; ++ s = htab->sgot; + + h->got.offset = s->size; + s->size += 4; +- dyn = htab->root.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)) +- htab->root.srelgot->size += sizeof (Elf32_External_Rela); ++ htab->srelgot->size += sizeof (Elf32_External_Rela); + } + else + h->got.offset = (bfd_vma) -1; +@@ -1944,7 +1930,7 @@ allocate_dynrelocs (struct elf_link_hash + if (!h->non_got_ref + && ((h->def_dynamic + && !h->def_regular) +- || (htab->root.dynamic_sections_created ++ || (htab->dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { +@@ -1984,7 +1970,7 @@ static bfd_boolean + m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *s; + bfd_boolean relocs; +@@ -1998,10 +1984,10 @@ m32r_elf_size_dynamic_sections (bfd *out + if (htab == NULL) + return FALSE; + +- dynobj = htab->root.dynobj; ++ dynobj = htab->dynobj; + BFD_ASSERT (dynobj != NULL); + +- if (htab->root.dynamic_sections_created) ++ if (htab->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (bfd_link_executable (info) && !info->nointerp) +@@ -2060,8 +2046,8 @@ m32r_elf_size_dynamic_sections (bfd *out + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; +- s = htab->root.sgot; +- srel = htab->root.srelgot; ++ s = htab->sgot; ++ srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got) + { + if (*local_got > 0) +@@ -2078,7 +2064,7 @@ m32r_elf_size_dynamic_sections (bfd *out + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ +- elf_link_hash_traverse (&htab->root, allocate_dynrelocs, info); ++ elf_link_hash_traverse (htab, allocate_dynrelocs, info); + + /* We now have determined the sizes of the various dynamic sections. + Allocate memory for them. */ +@@ -2088,9 +2074,9 @@ m32r_elf_size_dynamic_sections (bfd *out + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + +- if (s == htab->root.splt +- || s == htab->root.sgot +- || s == htab->root.sgotplt ++ if (s == htab->splt ++ || s == htab->sgot ++ || s == htab->sgotplt + || s == htab->sdynbss) + { + /* Strip this section if we don't need it; see the +@@ -2098,7 +2084,7 @@ m32r_elf_size_dynamic_sections (bfd *out + } + else if (CONST_STRNEQ (bfd_section_name (s), ".rela")) + { +- if (s->size != 0 && s != htab->root.srelplt) ++ if (s->size != 0 && s != htab->srelplt) + relocs = TRUE; + + /* We use the reloc_count field as a counter if we need +@@ -2188,7 +2174,7 @@ m32r_elf_relocate_section (bfd *output_b + Elf_Internal_Rela *rel, *relend; + /* Assume success. */ + bfd_boolean ret = TRUE; +- struct elf_m32r_link_hash_table *htab = m32r_elf_hash_table (info); ++ struct elf_link_hash_table *htab = m32r_elf_hash_table (info); + bfd_vma *local_got_offsets; + asection *sgot, *splt, *sreloc; + bfd_vma high_address = bfd_get_section_limit (input_bfd, input_section); +@@ -2198,8 +2184,8 @@ m32r_elf_relocate_section (bfd *output_b + + local_got_offsets = elf_local_got_offsets (input_bfd); + +- sgot = htab->root.sgot; +- splt = htab->root.splt; ++ sgot = htab->sgot; ++ splt = htab->splt; + sreloc = NULL; + + rel = relocs; +@@ -2295,7 +2281,7 @@ m32r_elf_relocate_section (bfd *output_b + bfd_boolean dyn; + sec = h->root.u.def.section; + +- dyn = htab->root.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + sec = h->root.u.def.section; + if (r_type == R_M32R_GOTPC24 + || (r_type == R_M32R_GOTPC_HI_ULO +@@ -2516,7 +2502,7 @@ m32r_elf_relocate_section (bfd *output_b + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) -1); + +- dyn = htab->root.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + bfd_link_pic (info), + h) +@@ -2576,7 +2562,7 @@ m32r_elf_relocate_section (bfd *output_b + + /* We need to generate a R_M32R_RELATIVE reloc + for the dynamic linker. */ +- srelgot = htab->root.srelgot; ++ srelgot = htab->srelgot; + BFD_ASSERT (srelgot != NULL); + + outrel.r_offset = (sgot->output_section->vma +@@ -2892,7 +2878,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd_byte *loc; + + #ifdef DEBUG_PIC +@@ -2918,9 +2904,9 @@ m32r_elf_finish_dynamic_symbol (bfd *out + + BFD_ASSERT (h->dynindx != -1); + +- splt = htab->root.splt; +- sgot = htab->root.sgotplt; +- srela = htab->root.srelplt; ++ splt = htab->splt; ++ sgot = htab->sgotplt; ++ srela = htab->srelplt; + BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL); + + /* Get the index in the procedure linkage table which +@@ -3014,8 +3000,8 @@ m32r_elf_finish_dynamic_symbol (bfd *out + /* This symbol has an entry in the global offset table. Set it + up. */ + +- sgot = htab->root.sgot; +- srela = htab->root.srelgot; ++ sgot = htab->sgot; ++ srela = htab->srelgot; + BFD_ASSERT (sgot != NULL && srela != NULL); + + rela.r_offset = (sgot->output_section->vma +@@ -3063,7 +3049,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)); + +- s = bfd_get_linker_section (htab->root.dynobj, ".rela.bss"); ++ s = bfd_get_linker_section (htab->dynobj, ".rela.bss"); + BFD_ASSERT (s != NULL); + + rela.r_offset = (h->root.u.def.value +@@ -3078,7 +3064,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out + } + + /* Mark some specially defined symbols as absolute. */ +- if (h == htab->root.hdynamic || h == htab->root.hgot) ++ if (h == htab->hdynamic || h == htab->hgot) + sym->st_shndx = SHN_ABS; + + return TRUE; +@@ -3091,7 +3077,7 @@ static bfd_boolean + m32r_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) + { +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *sdyn; + asection *sgot; +@@ -3104,12 +3090,12 @@ m32r_elf_finish_dynamic_sections (bfd *o + if (htab == NULL) + return FALSE; + +- dynobj = htab->root.dynobj; ++ dynobj = htab->dynobj; + +- sgot = htab->root.sgotplt; ++ sgot = htab->sgotplt; + sdyn = bfd_get_linker_section (dynobj, ".dynamic"); + +- if (htab->root.dynamic_sections_created) ++ if (htab->dynamic_sections_created) + { + asection *splt; + Elf32_External_Dyn *dyncon, *dynconend; +@@ -3132,17 +3118,17 @@ m32r_elf_finish_dynamic_sections (bfd *o + break; + + case DT_PLTGOT: +- s = htab->root.sgotplt; ++ s = htab->sgotplt; + goto get_vma; + case DT_JMPREL: +- s = htab->root.srelplt; ++ s = htab->srelplt; + get_vma: + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_PLTRELSZ: +- s = htab->root.srelplt; ++ s = htab->srelplt; + dyn.d_un.d_val = s->size; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; +@@ -3150,7 +3136,7 @@ m32r_elf_finish_dynamic_sections (bfd *o + } + + /* Fill in the first entry in the procedure linkage table. */ +- splt = htab->root.splt; ++ splt = htab->splt; + if (splt && splt->size > 0) + { + if (bfd_link_pic (info)) +@@ -3369,7 +3355,7 @@ m32r_elf_check_relocs (bfd *abfd, + struct elf_link_hash_entry **sym_hashes; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; +- struct elf_m32r_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *sreloc; + +@@ -3384,7 +3370,7 @@ m32r_elf_check_relocs (bfd *abfd, + if (htab == NULL) + return FALSE; + +- dynobj = htab->root.dynobj; ++ dynobj = htab->dynobj; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) +@@ -3406,7 +3392,7 @@ m32r_elf_check_relocs (bfd *abfd, + } + + /* Some relocs require a global offset table. */ +- if (htab->root.sgot == NULL) ++ if (htab->sgot == NULL) + { + switch (r_type) + { +@@ -3423,7 +3409,7 @@ m32r_elf_check_relocs (bfd *abfd, + case R_M32R_GOTPC_LO: + case R_M32R_GOT24: + if (dynobj == NULL) +- htab->root.dynobj = dynobj = abfd; ++ htab->dynobj = dynobj = abfd; + if (!_bfd_elf_create_got_section (dynobj, info)) + return FALSE; + break; +@@ -3540,7 +3526,7 @@ m32r_elf_check_relocs (bfd *abfd, + struct elf_dyn_relocs **head; + + if (dynobj == NULL) +- htab->root.dynobj = dynobj = abfd; ++ htab->dynobj = dynobj = abfd; + + /* When creating a shared object, we must copy these + relocs into the output file. We create a reloc +diff -rup binutils.orig/bfd/elf32-m68hc1x.h binutils-2.35/bfd/elf32-m68hc1x.h +--- binutils.orig/bfd/elf32-m68hc1x.h 2020-07-30 15:04:05.378466625 +0100 ++++ binutils-2.35/bfd/elf32-m68hc1x.h 2020-07-30 15:04:16.710393941 +0100 +@@ -120,9 +120,6 @@ struct m68hc11_elf_link_hash_table + int top_index; + asection **input_list; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + bfd_boolean (* size_one_stub) (struct bfd_hash_entry*, void*); + bfd_boolean (* build_one_stub) (struct bfd_hash_entry*, void*); + }; +diff -rup binutils.orig/bfd/elf32-m68k.c binutils-2.35/bfd/elf32-m68k.c +--- binutils.orig/bfd/elf32-m68k.c 2020-07-30 15:04:05.363466721 +0100 ++++ binutils-2.35/bfd/elf32-m68k.c 2020-07-30 15:04:16.710393941 +0100 +@@ -889,9 +889,6 @@ struct elf_m68k_link_hash_table + { + struct elf_link_hash_table root; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* The PLT format used by this link, or NULL if the format has not + yet been chosen. */ + const struct elf_m68k_plt_info *plt_info; +@@ -2836,7 +2833,7 @@ elf_m68k_check_relocs (bfd *abfd, + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->sym_cache, ++ isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-metag.c binutils-2.35/bfd/elf32-metag.c +--- binutils.orig/bfd/elf32-metag.c 2020-07-30 15:04:05.379466619 +0100 ++++ binutils-2.35/bfd/elf32-metag.c 2020-07-30 15:04:16.711393934 +0100 +@@ -823,9 +823,6 @@ struct elf_metag_link_hash_table + asection **input_list; + Elf_Internal_Sym **all_local_syms; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Data for LDM relocations. */ + union + { +@@ -2098,7 +2095,7 @@ elf_metag_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-microblaze.c binutils-2.35/bfd/elf32-microblaze.c +--- binutils.orig/bfd/elf32-microblaze.c 2020-07-30 15:04:05.367466696 +0100 ++++ binutils-2.35/bfd/elf32-microblaze.c 2020-07-30 15:04:16.711393934 +0100 +@@ -744,9 +744,6 @@ struct elf32_mb_link_hash_table + { + struct elf_link_hash_table elf; + +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_sec; +- + /* TLS Local Dynamic GOT Entry */ + union { + bfd_signed_vma refcount; +@@ -2523,7 +2520,7 @@ microblaze_elf_check_relocs (bfd * abfd, + Elf_Internal_Sym *isym; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_sec, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-nds32.c binutils-2.35/bfd/elf32-nds32.c +--- binutils.orig/bfd/elf32-nds32.c 2020-07-30 15:04:05.365466709 +0100 ++++ binutils-2.35/bfd/elf32-nds32.c 2020-07-30 15:04:16.712393928 +0100 +@@ -3696,8 +3696,6 @@ nds32_elf_link_hash_table_create (bfd *a + return NULL; + } + +- ret->sdynbss = NULL; +- ret->srelbss = NULL; + ret->sym_ld_script = NULL; + + return &ret->root.root; +@@ -3833,7 +3831,7 @@ nds32_elf_create_dynamic_sections (bfd * + initialize them at run time. The linker script puts the .dynbss + section into the .bss section of the final image. */ + s = bfd_make_section (abfd, ".dynbss"); +- htab->sdynbss = s; ++ htab->root.sdynbss = s; + if (s == NULL + || !bfd_set_section_flags (s, SEC_ALLOC | SEC_LINKER_CREATED)) + return FALSE; +@@ -3852,7 +3850,7 @@ nds32_elf_create_dynamic_sections (bfd * + { + s = bfd_make_section (abfd, (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss")); +- htab->srelbss = s; ++ htab->root.srelbss = s; + if (s == NULL + || !bfd_set_section_flags (s, flags | SEC_READONLY) + || !bfd_set_section_alignment (s, ptralign)) +@@ -3988,7 +3986,7 @@ nds32_elf_adjust_dynamic_symbol (struct + same memory location for the variable. */ + + htab = nds32_elf_hash_table (info); +- s = htab->sdynbss; ++ s = htab->root.sdynbss; + BFD_ASSERT (s != NULL); + + /* We must generate a R_NDS32_COPY reloc to tell the dynamic linker +@@ -3999,7 +3997,7 @@ nds32_elf_adjust_dynamic_symbol (struct + { + asection *srel; + +- srel = htab->srelbss; ++ srel = htab->root.srelbss; + BFD_ASSERT (srel != NULL); + srel->size += sizeof (Elf32_External_Rela); + h->needs_copy = 1; +@@ -7277,7 +7275,8 @@ nds32_elf_check_relocs (bfd *abfd, struc + void *vpp; + + Elf_Internal_Sym *isym; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ++ abfd, r_symndx); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf32-nds32.h binutils-2.35/bfd/elf32-nds32.h +--- binutils.orig/bfd/elf32-nds32.h 2020-07-30 15:04:05.378466625 +0100 ++++ binutils-2.35/bfd/elf32-nds32.h 2020-07-30 15:04:16.712393928 +0100 +@@ -122,13 +122,6 @@ struct elf_nds32_link_hash_table + { + struct elf_link_hash_table root; + +- /* Short-cuts to get to dynamic linker sections. */ +- asection *sdynbss; +- asection *srelbss; +- +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; +- + /* Target dependent options. */ + int relax_fp_as_gp; /* --mrelax-omit-fp. */ + int eliminate_gc_relocs; /* --meliminate-gc-relocs. */ +diff -rup binutils.orig/bfd/elf32-nios2.c binutils-2.35/bfd/elf32-nios2.c +--- binutils.orig/bfd/elf32-nios2.c 2020-07-30 15:04:05.375466645 +0100 ++++ binutils-2.35/bfd/elf32-nios2.c 2020-07-30 15:04:16.712393928 +0100 +@@ -1808,9 +1808,6 @@ struct elf32_nios2_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + bfd_vma res_n_size; + }; + +@@ -4902,7 +4899,7 @@ nios2_elf32_check_relocs (bfd *abfd, str + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-or1k.c binutils-2.35/bfd/elf32-or1k.c +--- binutils.orig/bfd/elf32-or1k.c 2020-07-30 15:04:05.371466670 +0100 ++++ binutils-2.35/bfd/elf32-or1k.c 2020-07-30 15:04:16.713393921 +0100 +@@ -916,9 +916,6 @@ struct elf_or1k_link_hash_table + { + struct elf_link_hash_table root; + +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_sec; +- + bfd_boolean saw_plta; + }; + +@@ -2151,7 +2148,7 @@ or1k_elf_check_relocs (bfd *abfd, + Elf_Internal_Sym *isym; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_sec, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-ppc.c binutils-2.35/bfd/elf32-ppc.c +--- binutils.orig/bfd/elf32-ppc.c 2020-07-30 15:04:05.359466747 +0100 ++++ binutils-2.35/bfd/elf32-ppc.c 2020-07-30 15:04:16.713393921 +0100 +@@ -2212,9 +2212,6 @@ struct ppc_elf_link_hash_table + int plt_slot_size; + /* The size of the first PLT entry. */ + int plt_initial_entry_size; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; + }; + + /* Rename some of the generic section flags to better document how they +@@ -2952,7 +2949,7 @@ ppc_elf_check_relocs (bfd *abfd, + ifunc = NULL; + if (h == NULL && htab->elf.target_os != is_vxworks) + { +- Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -3335,7 +3332,7 @@ ppc_elf_check_relocs (bfd *abfd, + asection *s; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -3495,7 +3492,7 @@ ppc_elf_check_relocs (bfd *abfd, + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.35/bfd/elf32-s390.c +--- binutils.orig/bfd/elf32-s390.c 2020-07-30 15:04:05.376466638 +0100 ++++ binutils-2.35/bfd/elf32-s390.c 2020-07-30 15:04:16.714393915 +0100 +@@ -746,9 +746,6 @@ struct elf_s390_link_hash_table + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; + }; + + /* Get the s390 ELF linker hash table from a link_info structure. */ +@@ -930,7 +927,7 @@ elf_s390_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -1281,7 +1278,7 @@ elf_s390_check_relocs (bfd *abfd, + asection *s; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -3722,7 +3719,7 @@ elf_s390_finish_dynamic_sections (bfd *o + if (local_plt[i].plt.offset != (bfd_vma) -1) + { + asection *sec = local_plt[i].sec; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf32-sh.c binutils-2.35/bfd/elf32-sh.c +--- binutils.orig/bfd/elf32-sh.c 2020-07-30 15:04:05.376466638 +0100 ++++ binutils-2.35/bfd/elf32-sh.c 2020-07-30 15:04:16.714393915 +0100 +@@ -2160,8 +2160,6 @@ struct elf_sh_link_hash_table + struct elf_link_hash_table root; + + /* Short-cuts to get to dynamic linker sections. */ +- asection *sdynbss; +- asection *srelbss; + asection *sfuncdesc; + asection *srelfuncdesc; + asection *srofixup; +@@ -2169,9 +2167,6 @@ struct elf_sh_link_hash_table + /* The (unloaded but important) VxWorks .rela.plt.unloaded section. */ + asection *srelplt2; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* A counter or offset to track a TLS got entry. */ + union + { +@@ -2439,7 +2434,7 @@ sh_elf_create_dynamic_sections (bfd *abf + section into the .bss section of the final image. */ + s = bfd_make_section_anyway_with_flags (abfd, ".dynbss", + SEC_ALLOC | SEC_LINKER_CREATED); +- htab->sdynbss = s; ++ htab->root.sdynbss = s; + if (s == NULL) + return FALSE; + +@@ -2460,7 +2455,7 @@ sh_elf_create_dynamic_sections (bfd *abf + (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss"), + flags | SEC_READONLY); +- htab->srelbss = s; ++ htab->root.srelbss = s; + if (s == NULL + || !bfd_set_section_alignment (s, ptralign)) + return FALSE; +@@ -2580,7 +2575,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd + both the dynamic object and the regular object will refer to the + same memory location for the variable. */ + +- s = htab->sdynbss; ++ s = htab->root.sdynbss; + BFD_ASSERT (s != NULL); + + /* We must generate a R_SH_COPY reloc to tell the dynamic linker to +@@ -2591,7 +2586,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd + { + asection *srel; + +- srel = htab->srelbss; ++ srel = htab->root.srelbss; + BFD_ASSERT (srel != NULL); + srel->size += sizeof (Elf32_External_Rela); + h->needs_copy = 1; +@@ -3151,7 +3146,7 @@ sh_elf_size_dynamic_sections (bfd *outpu + || s == htab->root.sgotplt + || s == htab->sfuncdesc + || s == htab->srofixup +- || s == htab->sdynbss) ++ || s == htab->root.sdynbss) + { + /* Strip this section if we don't need it; see the + comment below. */ +@@ -5679,7 +5674,7 @@ sh_elf_check_relocs (bfd *abfd, struct b + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-tic6x.c binutils-2.35/bfd/elf32-tic6x.c +--- binutils.orig/bfd/elf32-tic6x.c 2020-07-30 15:04:05.366466702 +0100 ++++ binutils-2.35/bfd/elf32-tic6x.c 2020-07-30 15:04:16.714393915 +0100 +@@ -46,9 +46,6 @@ struct elf32_tic6x_link_hash_table + /* C6X specific command line arguments. */ + struct elf32_tic6x_params params; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* The output BFD, for convenience. */ + bfd *obfd; + +@@ -2729,7 +2726,7 @@ elf32_tic6x_check_relocs (bfd *abfd, str + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf32-tilepro.c binutils-2.35/bfd/elf32-tilepro.c +--- binutils.orig/bfd/elf32-tilepro.c 2020-07-30 15:04:05.364466715 +0100 ++++ binutils-2.35/bfd/elf32-tilepro.c 2020-07-30 15:04:16.715393908 +0100 +@@ -727,19 +727,11 @@ tilepro_elf_mkobject (bfd *abfd) + #include "elf/common.h" + #include "elf/internal.h" + +-struct tilepro_elf_link_hash_table +-{ +- struct elf_link_hash_table elf; +- +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; +-}; +- + /* Get the Tilepro ELF linker hash table from a link_info structure. */ + #define tilepro_elf_hash_table(p) \ + (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ + == TILEPRO_ELF_DATA \ +- ? ((struct tilepro_elf_link_hash_table *) ((p)->hash)) : NULL) ++ ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL) + + static reloc_howto_type * + tilepro_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, +@@ -1184,14 +1176,14 @@ link_hash_newfunc (struct bfd_hash_entry + static struct bfd_link_hash_table * + tilepro_elf_link_hash_table_create (bfd *abfd) + { +- struct tilepro_elf_link_hash_table *ret; +- size_t amt = sizeof (struct tilepro_elf_link_hash_table); ++ struct elf_link_hash_table *ret; ++ size_t amt = sizeof (struct elf_link_hash_table); + +- ret = (struct tilepro_elf_link_hash_table *) bfd_zmalloc (amt); ++ ret = (struct elf_link_hash_table *) bfd_zmalloc (amt); + if (ret == NULL) + return NULL; + +- if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc, ++ if (!_bfd_elf_link_hash_table_init (ret, abfd, link_hash_newfunc, + sizeof (struct tilepro_elf_link_hash_entry), + TILEPRO_ELF_DATA)) + { +@@ -1199,7 +1191,7 @@ tilepro_elf_link_hash_table_create (bfd + return NULL; + } + +- return &ret->elf.root; ++ return &ret->root; + } + + /* Create the .got section. */ +@@ -1402,7 +1394,7 @@ static bfd_boolean + tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, + asection *sec, const Elf_Internal_Rela *relocs) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + const Elf_Internal_Rela *rel; +@@ -1423,8 +1415,8 @@ tilepro_elf_check_relocs (bfd *abfd, str + + BFD_ASSERT (is_tilepro_elf (abfd) || num_relocs == 0); + +- if (htab->elf.dynobj == NULL) +- htab->elf.dynobj = abfd; ++ if (htab->dynobj == NULL) ++ htab->dynobj = abfd; + + rel_end = relocs + num_relocs; + for (rel = relocs; rel < rel_end; rel++) +@@ -1569,9 +1561,9 @@ tilepro_elf_check_relocs (bfd *abfd, str + } + } + +- if (htab->elf.sgot == NULL) ++ if (htab->sgot == NULL) + { +- if (!tilepro_elf_create_got_section (htab->elf.dynobj, info)) ++ if (!tilepro_elf_create_got_section (htab->dynobj, info)) + return FALSE; + } + break; +@@ -1716,7 +1708,7 @@ tilepro_elf_check_relocs (bfd *abfd, str + if (sreloc == NULL) + { + sreloc = _bfd_elf_make_dynamic_reloc_section +- (sec, htab->elf.dynobj, 2, abfd, /*rela?*/ TRUE); ++ (sec, htab->dynobj, 2, abfd, /*rela?*/ TRUE); + + if (sreloc == NULL) + return FALSE; +@@ -1754,7 +1746,7 @@ tilepro_elf_check_relocs (bfd *abfd, str + { + size_t amt = sizeof *p; + p = ((struct elf_dyn_relocs *) +- bfd_alloc (htab->elf.dynobj, amt)); ++ bfd_alloc (htab->dynobj, amt)); + if (p == NULL) + return FALSE; + p->next = *head; +@@ -1850,14 +1842,14 @@ static bfd_boolean + tilepro_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + asection *s, *srel; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); + + /* Make sure we know what is going on here. */ +- BFD_ASSERT (htab->elf.dynobj != NULL ++ BFD_ASSERT (htab->dynobj != NULL + && (h->needs_plt + || h->is_weakalias + || (h->def_dynamic +@@ -1947,13 +1939,13 @@ tilepro_elf_adjust_dynamic_symbol (struc + .rel.bss section we are going to use. */ + if ((h->root.u.def.section->flags & SEC_READONLY) != 0) + { +- s = htab->elf.sdynrelro; +- srel = htab->elf.sreldynrelro; ++ s = htab->sdynrelro; ++ srel = htab->sreldynrelro; + } + else + { +- s = htab->elf.sdynbss; +- srel = htab->elf.srelbss; ++ s = htab->sdynbss; ++ srel = htab->srelbss; + } + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0) + { +@@ -1971,7 +1963,7 @@ static bfd_boolean + allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) + { + struct bfd_link_info *info; +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + struct elf_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) +@@ -1981,7 +1973,7 @@ allocate_dynrelocs (struct elf_link_hash + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); + +- if (htab->elf.dynamic_sections_created ++ if (htab->dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. +@@ -1995,7 +1987,7 @@ allocate_dynrelocs (struct elf_link_hash + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h)) + { +- asection *s = htab->elf.splt; ++ asection *s = htab->splt; + + /* Allocate room for the header. */ + if (s->size == 0) +@@ -2021,10 +2013,10 @@ allocate_dynrelocs (struct elf_link_hash + s->size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .got.plt section. */ +- htab->elf.sgotplt->size += GOT_ENTRY_SIZE; ++ htab->sgotplt->size += GOT_ENTRY_SIZE; + + /* We also need to make an entry in the .rela.plt section. */ +- htab->elf.srelplt->size += TILEPRO_ELF_RELA_BYTES; ++ htab->srelplt->size += TILEPRO_ELF_RELA_BYTES; + } + else + { +@@ -2060,22 +2052,22 @@ allocate_dynrelocs (struct elf_link_hash + return FALSE; + } + +- s = htab->elf.sgot; ++ s = htab->sgot; + h->got.offset = s->size; + s->size += TILEPRO_BYTES_PER_WORD; + /* R_TILEPRO_IMM16_Xn_TLS_GD entries need 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->size += TILEPRO_BYTES_PER_WORD; +- dyn = htab->elf.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + /* R_TILEPRO_IMM16_Xn_TLS_IE_xxx needs one dynamic relocation, + R_TILEPRO_IMM16_Xn_TLS_GD_xxx needs two if local symbol and two if + global. */ + if (tls_type == GOT_TLS_GD || tls_type == GOT_TLS_IE) +- htab->elf.srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES; ++ htab->srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES; + else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + bfd_link_pic (info), + h)) +- htab->elf.srelgot->size += TILEPRO_ELF_RELA_BYTES; ++ htab->srelgot->size += TILEPRO_ELF_RELA_BYTES; + } + else + h->got.offset = (bfd_vma) -1; +@@ -2134,7 +2126,7 @@ allocate_dynrelocs (struct elf_link_hash + if (!h->non_got_ref + && ((h->def_dynamic + && !h->def_regular) +- || (htab->elf.dynamic_sections_created ++ || (htab->dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { +@@ -2195,14 +2187,14 @@ tilepro_elf_size_dynamic_sections (bfd * + { + (void)output_bfd; + +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + bfd *dynobj; + asection *s; + bfd *ibfd; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +- dynobj = htab->elf.dynobj; ++ dynobj = htab->dynobj; + BFD_ASSERT (dynobj != NULL); + + if (elf_hash_table (info)->dynamic_sections_created) +@@ -2268,8 +2260,8 @@ tilepro_elf_size_dynamic_sections (bfd * + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + local_tls_type = _bfd_tilepro_elf_local_got_tls_type (ibfd); +- s = htab->elf.sgot; +- srel = htab->elf.srelgot; ++ s = htab->sgot; ++ srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got, ++local_tls_type) + { + if (*local_got > 0) +@@ -2290,19 +2282,19 @@ tilepro_elf_size_dynamic_sections (bfd * + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ +- elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info); ++ elf_link_hash_traverse (htab, allocate_dynrelocs, info); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* If the .got section is more than 0x8000 bytes, we add + 0x8000 to the value of _GLOBAL_OFFSET_TABLE_, so that 16 + bit relocations have a greater chance of working. */ +- if (htab->elf.sgot->size >= 0x8000 ++ if (htab->sgot->size >= 0x8000 + && elf_hash_table (info)->hgot->root.u.def.value == 0) + elf_hash_table (info)->hgot->root.u.def.value = 0x8000; + } + +- if (htab->elf.sgotplt) ++ if (htab->sgotplt) + { + struct elf_link_hash_entry *got; + got = elf_link_hash_lookup (elf_hash_table (info), +@@ -2313,14 +2305,14 @@ tilepro_elf_size_dynamic_sections (bfd * + entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */ + if ((got == NULL + || !got->ref_regular_nonweak) +- && (htab->elf.sgotplt->size ++ && (htab->sgotplt->size + == GOTPLT_HEADER_SIZE) +- && (htab->elf.splt == NULL +- || htab->elf.splt->size == 0) +- && (htab->elf.sgot == NULL +- || (htab->elf.sgot->size ++ && (htab->splt == NULL ++ || htab->splt->size == 0) ++ && (htab->sgot == NULL ++ || (htab->sgot->size + == get_elf_backend_data (output_bfd)->got_header_size))) +- htab->elf.sgotplt->size = 0; ++ htab->sgotplt->size = 0; + } + + /* The check_relocs and adjust_dynamic_symbol entry points have +@@ -2331,11 +2323,11 @@ tilepro_elf_size_dynamic_sections (bfd * + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + +- if (s == htab->elf.splt +- || s == htab->elf.sgot +- || s == htab->elf.sgotplt +- || s == htab->elf.sdynbss +- || s == htab->elf.sdynrelro) ++ if (s == htab->splt ++ || s == htab->sgot ++ || s == htab->sgotplt ++ || s == htab->sdynbss ++ || s == htab->sdynrelro) + { + /* Strip this section if we don't need it; see the + comment below. */ +@@ -2527,7 +2519,7 @@ tilepro_elf_relocate_section (bfd *outpu + Elf_Internal_Sym *local_syms, + asection **local_sections) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_vma *local_got_offsets; +@@ -2758,7 +2750,7 @@ tilepro_elf_relocate_section (bfd *outpu + case R_TILEPRO_IMM16_X1_GOT_HA: + /* Relocation is to the entry for this symbol in the global + offset table. */ +- if (htab->elf.sgot == NULL) ++ if (htab->sgot == NULL) + abort (); + + if (h != NULL) +@@ -2792,7 +2784,7 @@ tilepro_elf_relocate_section (bfd *outpu + else + { + bfd_put_32 (output_bfd, relocation, +- htab->elf.sgot->contents + off); ++ htab->sgot->contents + off); + h->got.offset |= 1; + } + } +@@ -2820,11 +2812,11 @@ tilepro_elf_relocate_section (bfd *outpu + + /* We need to generate a R_TILEPRO_RELATIVE reloc + for the dynamic linker. */ +- s = htab->elf.srelgot; ++ s = htab->srelgot; + BFD_ASSERT (s != NULL); + +- outrel.r_offset = (htab->elf.sgot->output_section->vma +- + htab->elf.sgot->output_offset ++ outrel.r_offset = (htab->sgot->output_section->vma ++ + htab->sgot->output_offset + + off); + outrel.r_info = ELF32_R_INFO (0, R_TILEPRO_RELATIVE); + outrel.r_addend = relocation; +@@ -2833,7 +2825,7 @@ tilepro_elf_relocate_section (bfd *outpu + } + + bfd_put_32 (output_bfd, relocation, +- htab->elf.sgot->contents + off); ++ htab->sgot->contents + off); + local_got_offsets[r_symndx] |= 1; + } + } +@@ -2845,7 +2837,7 @@ tilepro_elf_relocate_section (bfd *outpu + procedure linkage table. */ + BFD_ASSERT (h != NULL); + +- if (h->plt.offset == (bfd_vma) -1 || htab->elf.splt == NULL) ++ if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) + { + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when +@@ -2853,8 +2845,8 @@ tilepro_elf_relocate_section (bfd *outpu + break; + } + +- relocation = (htab->elf.splt->output_section->vma +- + htab->elf.splt->output_offset ++ relocation = (htab->splt->output_section->vma ++ + htab->splt->output_offset + + h->plt.offset); + unresolved_reloc = FALSE; + break; +@@ -2993,7 +2985,7 @@ tilepro_elf_relocate_section (bfd *outpu + outrel.r_addend = relocation + rel->r_addend; + + if (is_plt) +- sec = htab->elf.splt; ++ sec = htab->splt; + + if (bfd_is_abs_section (sec)) + indx = 0; +@@ -3016,7 +3008,7 @@ tilepro_elf_relocate_section (bfd *outpu + + if (indx == 0) + { +- osec = htab->elf.text_index_section; ++ osec = htab->text_index_section; + indx = elf_section_data (osec)->dynindx; + } + +@@ -3142,7 +3134,7 @@ tilepro_elf_relocate_section (bfd *outpu + local_got_offsets[r_symndx] |= 1; + } + +- if (htab->elf.sgot == NULL) ++ if (htab->sgot == NULL) + abort (); + + if ((off & 1) != 0) +@@ -3153,13 +3145,13 @@ tilepro_elf_relocate_section (bfd *outpu + int indx = 0; + bfd_boolean need_relocs = FALSE; + +- if (htab->elf.srelgot == NULL) ++ if (htab->srelgot == NULL) + abort (); + + if (h != NULL) + { + bfd_boolean dyn; +- dyn = htab->elf.dynamic_sections_created; ++ dyn = htab->dynamic_sections_created; + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, + bfd_link_pic (info), +@@ -3190,18 +3182,18 @@ tilepro_elf_relocate_section (bfd *outpu + case R_TILEPRO_IMM16_X0_TLS_IE_HA: + case R_TILEPRO_IMM16_X1_TLS_IE_HA: + if (need_relocs) { +- bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off); +- outrel.r_offset = (htab->elf.sgot->output_section->vma +- + htab->elf.sgot->output_offset + off); ++ bfd_put_32 (output_bfd, 0, htab->sgot->contents + off); ++ outrel.r_offset = (htab->sgot->output_section->vma ++ + htab->sgot->output_offset + off); + outrel.r_addend = 0; + if (indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_TPOFF32); +- tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot, ++ tilepro_elf_append_rela_32 (output_bfd, htab->srelgot, + &outrel); + } else { + bfd_put_32 (output_bfd, tpoff (info, relocation), +- htab->elf.sgot->contents + off); ++ htab->sgot->contents + off); + } + break; + +@@ -3214,31 +3206,31 @@ tilepro_elf_relocate_section (bfd *outpu + case R_TILEPRO_IMM16_X0_TLS_GD_HA: + case R_TILEPRO_IMM16_X1_TLS_GD_HA: + if (need_relocs) { +- outrel.r_offset = (htab->elf.sgot->output_section->vma +- + htab->elf.sgot->output_offset + off); ++ outrel.r_offset = (htab->sgot->output_section->vma ++ + htab->sgot->output_offset + off); + outrel.r_addend = 0; + outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_DTPMOD32); +- bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off); +- tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot, ++ bfd_put_32 (output_bfd, 0, htab->sgot->contents + off); ++ tilepro_elf_append_rela_32 (output_bfd, htab->srelgot, + &outrel); + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, + relocation - dtpoff_base (info), +- (htab->elf.sgot->contents + off + ++ (htab->sgot->contents + off + + TILEPRO_BYTES_PER_WORD)); + } + else + { + bfd_put_32 (output_bfd, 0, +- (htab->elf.sgot->contents + off + ++ (htab->sgot->contents + off + + TILEPRO_BYTES_PER_WORD)); + outrel.r_info = ELF32_R_INFO (indx, + R_TILEPRO_TLS_DTPOFF32); + outrel.r_offset += TILEPRO_BYTES_PER_WORD; + tilepro_elf_append_rela_32 (output_bfd, +- htab->elf.srelgot, &outrel); ++ htab->srelgot, &outrel); + } + } + +@@ -3249,9 +3241,9 @@ tilepro_elf_relocate_section (bfd *outpu + symbol binding locally. Mark it as belonging + to module 1, the executable. */ + bfd_put_32 (output_bfd, 1, +- htab->elf.sgot->contents + off ); ++ htab->sgot->contents + off ); + bfd_put_32 (output_bfd, relocation - dtpoff_base (info), +- htab->elf.sgot->contents + off + ++ htab->sgot->contents + off + + TILEPRO_BYTES_PER_WORD); + } + break; +@@ -3411,7 +3403,7 @@ tilepro_elf_finish_dynamic_symbol (bfd * + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) + { +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +@@ -3431,9 +3423,9 @@ tilepro_elf_finish_dynamic_symbol (bfd * + + BFD_ASSERT (h->dynindx != -1); + +- splt = htab->elf.splt; +- srela = htab->elf.srelplt; +- sgotplt = htab->elf.sgotplt; ++ splt = htab->splt; ++ srela = htab->srelplt; ++ sgotplt = htab->sgotplt; + + if (splt == NULL || srela == NULL) + abort (); +@@ -3481,8 +3473,8 @@ tilepro_elf_finish_dynamic_symbol (bfd * + + /* This symbol has an entry in the GOT. Set it up. */ + +- sgot = htab->elf.sgot; +- srela = htab->elf.srelgot; ++ sgot = htab->sgot; ++ srela = htab->srelgot; + BFD_ASSERT (sgot != NULL && srela != NULL); + + rela.r_offset = (sgot->output_section->vma +@@ -3528,16 +3520,16 @@ tilepro_elf_finish_dynamic_symbol (bfd * + + h->root.u.def.section->output_offset); + rela.r_info = ELF32_R_INFO (h->dynindx, R_TILEPRO_COPY); + rela.r_addend = 0; +- if (h->root.u.def.section == htab->elf.sdynrelro) +- s = htab->elf.sreldynrelro; ++ if (h->root.u.def.section == htab->sdynrelro) ++ s = htab->sreldynrelro; + else +- s = htab->elf.srelbss; ++ s = htab->srelbss; + tilepro_elf_append_rela_32 (output_bfd, s, &rela); + } + + /* Mark some specially defined symbols as absolute. */ +- if (h == htab->elf.hdynamic +- || (h == htab->elf.hgot || h == htab->elf.hplt)) ++ if (h == htab->hdynamic ++ || (h == htab->hgot || h == htab->hplt)) + sym->st_shndx = SHN_ABS; + + return TRUE; +@@ -3551,7 +3543,7 @@ tilepro_finish_dyn (bfd *output_bfd, str + asection *splt ATTRIBUTE_UNUSED) + { + Elf32_External_Dyn *dyncon, *dynconend; +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +@@ -3567,15 +3559,15 @@ tilepro_finish_dyn (bfd *output_bfd, str + switch (dyn.d_tag) + { + case DT_PLTGOT: +- s = htab->elf.sgotplt; ++ s = htab->sgotplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; + case DT_JMPREL: +- s = htab->elf.srelplt; ++ s = htab->srelplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; + case DT_PLTRELSZ: +- s = htab->elf.srelplt; ++ s = htab->srelplt; + dyn.d_un.d_val = s->size; + break; + default: +@@ -3593,11 +3585,11 @@ tilepro_elf_finish_dynamic_sections (bfd + { + bfd *dynobj; + asection *sdyn; +- struct tilepro_elf_link_hash_table *htab; ++ struct elf_link_hash_table *htab; + + htab = tilepro_elf_hash_table (info); + BFD_ASSERT (htab != NULL); +- dynobj = htab->elf.dynobj; ++ dynobj = htab->dynobj; + + sdyn = bfd_get_linker_section (dynobj, ".dynamic"); + +@@ -3606,7 +3598,7 @@ tilepro_elf_finish_dynamic_sections (bfd + asection *splt; + bfd_boolean ret; + +- splt = htab->elf.splt; ++ splt = htab->splt; + BFD_ASSERT (splt != NULL && sdyn != NULL); + + ret = tilepro_finish_dyn (output_bfd, info, dynobj, sdyn, splt); +@@ -3627,42 +3619,42 @@ tilepro_elf_finish_dynamic_sections (bfd + = PLT_ENTRY_SIZE; + } + +- if (htab->elf.sgotplt) ++ if (htab->sgotplt) + { +- if (bfd_is_abs_section (htab->elf.sgotplt->output_section)) ++ if (bfd_is_abs_section (htab->sgotplt->output_section)) + { + _bfd_error_handler +- (_("discarded output section: `%pA'"), htab->elf.sgotplt); ++ (_("discarded output section: `%pA'"), htab->sgotplt); + return FALSE; + } + +- if (htab->elf.sgotplt->size > 0) ++ if (htab->sgotplt->size > 0) + { + /* Write the first two entries in .got.plt, needed for the dynamic + linker. */ + bfd_put_32 (output_bfd, (bfd_vma) -1, +- htab->elf.sgotplt->contents); ++ htab->sgotplt->contents); + bfd_put_32 (output_bfd, (bfd_vma) 0, +- htab->elf.sgotplt->contents + GOT_ENTRY_SIZE); ++ htab->sgotplt->contents + GOT_ENTRY_SIZE); + } + +- elf_section_data (htab->elf.sgotplt->output_section)->this_hdr.sh_entsize ++ elf_section_data (htab->sgotplt->output_section)->this_hdr.sh_entsize + = GOT_ENTRY_SIZE; + } + +- if (htab->elf.sgot) ++ if (htab->sgot) + { +- if (htab->elf.sgot->size > 0) ++ if (htab->sgot->size > 0) + { + /* Set the first entry in the global offset table to the address of + the dynamic section. */ + bfd_vma val = (sdyn ? + sdyn->output_section->vma + sdyn->output_offset : + 0); +- bfd_put_32 (output_bfd, val, htab->elf.sgot->contents); ++ bfd_put_32 (output_bfd, val, htab->sgot->contents); + } + +- elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize ++ elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize + = GOT_ENTRY_SIZE; + } + +diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.35/bfd/elf64-ppc.c +--- binutils.orig/bfd/elf64-ppc.c 2020-07-30 15:04:05.363466721 +0100 ++++ binutils-2.35/bfd/elf64-ppc.c 2020-07-30 15:04:16.716393902 +0100 +@@ -3250,9 +3250,6 @@ struct ppc_link_hash_table + + /* Incremented every time we size stubs. */ + unsigned int stub_iteration; +- +- /* Small local sym cache. */ +- struct sym_cache sym_cache; + }; + + /* Rename some of the generic section flags to better document how they +@@ -4383,7 +4380,8 @@ ppc64_elf_before_check_relocs (bfd *ibfd + Elf_Internal_Sym *isym; + asection *s; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, r_symndx); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, ++ r_symndx); + if (isym == NULL) + { + if (elf_section_data (opd)->relocs != relocs) +@@ -4684,7 +4682,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc + } + else + { +- Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -4955,7 +4953,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc + { + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -5231,7 +5229,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.35/bfd/elf64-s390.c +--- binutils.orig/bfd/elf64-s390.c 2020-07-30 15:04:05.369466683 +0100 ++++ binutils-2.35/bfd/elf64-s390.c 2020-07-30 15:04:16.716393902 +0100 +@@ -663,9 +663,6 @@ struct elf_s390_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Options passed from the linker. */ + struct s390_elf_params *params; + }; +@@ -852,7 +849,7 @@ elf_s390_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -1216,7 +1213,7 @@ elf_s390_check_relocs (bfd *abfd, + asection *s; + void *vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -2258,7 +2255,7 @@ elf_s390_relocate_section (bfd *output_b + & 0xff00f000) == 0xe300c000 + && bfd_get_8 (input_bfd, + contents + rel->r_offset + 3) == 0x04)) +- && (isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ && (isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + input_bfd, r_symndx)) + && isym->st_shndx != SHN_ABS + && h != htab->elf.hdynamic +@@ -3572,7 +3569,7 @@ elf_s390_finish_dynamic_sections (bfd *o + if (local_plt[i].plt.offset != (bfd_vma) -1) + { + asection *sec = local_plt[i].sec; +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.35/bfd/elf64-x86-64.c +--- binutils.orig/bfd/elf64-x86-64.c 2020-07-30 15:04:05.365466709 +0100 ++++ binutils-2.35/bfd/elf64-x86-64.c 2020-07-30 15:04:16.717393895 +0100 +@@ -1371,7 +1371,7 @@ elf_x86_64_tls_transition (struct bfd_li + { + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL); + } +@@ -1559,7 +1559,7 @@ elf_x86_64_convert_load_reloc (bfd *abfd + if (h == NULL) + { + Elf_Internal_Sym *isym +- = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); ++ = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, r_symndx); + + /* Skip relocation against undefined symbols. */ + if (isym->st_shndx == SHN_UNDEF) +@@ -1907,7 +1907,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +@@ -2308,7 +2308,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru + asection *s; + void **vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + goto error_return; +diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c +--- binutils.orig/bfd/elfnn-aarch64.c 2020-07-30 15:04:05.371466670 +0100 ++++ binutils-2.35/bfd/elfnn-aarch64.c 2020-07-30 15:04:16.717393895 +0100 +@@ -2643,9 +2643,6 @@ struct elf_aarch64_link_hash_table + /* The bytes of the subsequent PLT entry. */ + const bfd_byte *plt_entry; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* For convenience in allocate_dynrelocs. */ + bfd *obfd; + +@@ -7611,7 +7608,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +@@ -7838,7 +7835,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s + asection *s; + void **vpp; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +Only in binutils-2.35/bfd: elfnn-aarch64.c.orig +diff -rup binutils.orig/bfd/elfnn-riscv.c binutils-2.35/bfd/elfnn-riscv.c +--- binutils.orig/bfd/elfnn-riscv.c 2020-07-30 15:04:05.365466709 +0100 ++++ binutils-2.35/bfd/elfnn-riscv.c 2020-07-30 15:04:16.718393889 +0100 +@@ -113,9 +113,6 @@ struct riscv_elf_link_hash_table + /* Short-cuts to get to dynamic linker sections. */ + asection *sdyntdata; + +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; +- + /* The max alignment of output sections. */ + bfd_vma max_alignment; + }; +@@ -681,7 +678,7 @@ riscv_elf_check_relocs (bfd *abfd, struc + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elfxx-mips.c binutils-2.35/bfd/elfxx-mips.c +--- binutils.orig/bfd/elfxx-mips.c 2020-07-30 15:04:05.376466638 +0100 ++++ binutils-2.35/bfd/elfxx-mips.c 2020-07-30 15:04:16.719393882 +0100 +@@ -527,9 +527,6 @@ struct mips_elf_link_hash_table + returns null. */ + asection *(*add_stub_section) (const char *, asection *, asection *); + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Is the PLT header compressed? */ + unsigned int plt_header_is_comp : 1; + }; +@@ -4401,7 +4398,7 @@ mips_elf_resolve_got_page_ref (void **re + Elf_Internal_Sym *isym; + + /* Read in the symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ref->u.abfd, ++ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ref->u.abfd, + ref->symndx); + if (isym == NULL) + { +diff -rup binutils.orig/bfd/elfxx-sparc.c binutils-2.35/bfd/elfxx-sparc.c +--- binutils.orig/bfd/elfxx-sparc.c 2020-07-30 15:04:05.360466741 +0100 ++++ binutils-2.35/bfd/elfxx-sparc.c 2020-07-30 15:04:16.719393882 +0100 +@@ -1391,7 +1391,8 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, + if (r_symndx < symtab_hdr->sh_info) + { + /* A local symbol. */ +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, ++ r_symndx); + if (isym == NULL) + return FALSE; + +diff -rup binutils.orig/bfd/elfxx-sparc.h binutils-2.35/bfd/elfxx-sparc.h +--- binutils.orig/bfd/elfxx-sparc.h 2020-07-30 15:04:05.367466696 +0100 ++++ binutils-2.35/bfd/elfxx-sparc.h 2020-07-30 15:04:16.719393882 +0100 +@@ -55,9 +55,6 @@ struct _bfd_sparc_elf_link_hash_table + bfd_vma offset; + } tls_ldm_got; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* Used by local STT_GNU_IFUNC symbols. */ + htab_t loc_hash_table; + void *loc_hash_memory; +diff -rup binutils.orig/bfd/elfxx-tilegx.c binutils-2.35/bfd/elfxx-tilegx.c +--- binutils.orig/bfd/elfxx-tilegx.c 2020-07-30 15:04:05.362466728 +0100 ++++ binutils-2.35/bfd/elfxx-tilegx.c 2020-07-30 15:04:16.719393882 +0100 +@@ -835,9 +835,6 @@ struct tilegx_elf_link_hash_table + /* Whether LE transition has been disabled for some of the + sections. */ + bfd_boolean disable_le_transition; +- +- /* Small local sym to section mapping cache. */ +- struct sym_cache sym_cache; + }; + + +@@ -1979,7 +1976,7 @@ tilegx_elf_check_relocs (bfd *abfd, stru + void *vpp; + Elf_Internal_Sym *isym; + +- isym = bfd_sym_from_r_symndx (&htab->sym_cache, ++ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, + abfd, r_symndx); + if (isym == NULL) + return FALSE; +diff -rup binutils.orig/bfd/elfxx-x86.h binutils-2.35/bfd/elfxx-x86.h +--- binutils.orig/bfd/elfxx-x86.h 2020-07-30 15:04:05.378466625 +0100 ++++ binutils-2.35/bfd/elfxx-x86.h 2020-07-30 15:04:16.720393876 +0100 +@@ -468,9 +468,6 @@ struct elf_x86_link_hash_table + /* The amount of space used by the jump slots in the GOT. */ + bfd_vma sgotplt_jump_table_size; + +- /* Small local sym cache. */ +- struct sym_cache sym_cache; +- + /* _TLS_MODULE_BASE_ symbol. */ + struct bfd_link_hash_entry *tls_module_base; + diff --git a/SOURCES/binutils-attach-to-group.patch b/SOURCES/binutils-attach-to-group.patch new file mode 100644 index 0000000..2164011 --- /dev/null +++ b/SOURCES/binutils-attach-to-group.patch @@ -0,0 +1,70 @@ +diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.34/gas/config/obj-elf.c +--- binutils.orig/gas/config/obj-elf.c 2020-02-02 11:34:11.858321477 +0000 ++++ binutils-2.34/gas/config/obj-elf.c 2020-02-02 11:34:30.099247619 +0000 +@@ -78,9 +78,11 @@ static void obj_elf_gnu_attribute (int); + static void obj_elf_tls_common (int); + static void obj_elf_lcomm (int); + static void obj_elf_struct (int); ++static void obj_elf_attach_to_group (int); + + static const pseudo_typeS elf_pseudo_table[] = + { ++ {"attach_to_group", obj_elf_attach_to_group, 0}, + {"comm", obj_elf_common, 0}, + {"common", obj_elf_common, 1}, + {"ident", obj_elf_ident, 0}, +@@ -1003,6 +1005,27 @@ obj_elf_section_name (void) + return name; + } + ++static void ++obj_elf_attach_to_group (int dummy ATTRIBUTE_UNUSED) ++{ ++ const char * gname = obj_elf_section_name (); ++ ++ if (gname == NULL) ++ { ++ as_warn ("group name not parseable"); ++ return; ++ } ++ ++ if (elf_group_name (now_seg)) ++ { ++ as_warn ("already has a group"); ++ return; ++ } ++ ++ elf_group_name (now_seg) = xstrdup (gname); ++ elf_section_flags (now_seg) |= SHF_GROUP; ++} ++ + void + obj_elf_section (int push) + { +Only in binutils-2.34/gas/config: obj-elf.c.orig +diff -rup binutils.orig/gas/doc/as.texi binutils-2.34/gas/doc/as.texi +--- binutils.orig/gas/doc/as.texi 2020-02-02 11:34:11.850321509 +0000 ++++ binutils-2.34/gas/doc/as.texi 2020-02-02 11:35:11.359080560 +0000 +@@ -4359,6 +4359,7 @@ Some machine configurations provide addi + * Altmacro:: @code{.altmacro} + * Ascii:: @code{.ascii "@var{string}"}@dots{} + * Asciz:: @code{.asciz "@var{string}"}@dots{} ++* Attach_to_group:: @code{.attach_to_group @var{name}} + * Balign:: @code{.balign [@var{abs-expr}[, @var{abs-expr}]]} + * Bundle directives:: @code{.bundle_align_mode @var{abs-expr}}, etc + * Byte:: @code{.byte @var{expressions}} +@@ -4656,6 +4657,12 @@ trailing zero byte) into consecutive add + @code{.asciz} is just like @code{.ascii}, but each string is followed by + a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''. + ++@node Attach_to_group ++@section @code{.attach_to_group @var{name}} ++Attaches the current section to the named group. This is like declaring ++the section with the @code{G} attribute, but can be done after the section ++has been created. ++ + @node Balign + @section @code{.balign[wl] [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]} + +Only in binutils-2.34/gas/doc: as.texi.orig +Only in binutils-2.34/gas/doc: as.texi.rej diff --git a/SOURCES/binutils-config.patch b/SOURCES/binutils-config.patch new file mode 100644 index 0000000..8456584 --- /dev/null +++ b/SOURCES/binutils-config.patch @@ -0,0 +1,44 @@ +diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 +--- a/libiberty/aclocal.m4 2019-01-19 09:01:34.000000000 -0700 ++++ b/libiberty/aclocal.m4 2020-01-09 22:00:27.183312982 -0700 +@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then + fi + + AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, +-[AC_TRY_RUN([find_stack_direction () ++[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction () + { + static char *addr = 0; + auto char dummy; +diff --git a/config/intdiv0.m4 b/config/intdiv0.m4 +index 55dddcf1..ba906efc 100644 +--- a/config/intdiv0.m4 ++++ b/config/intdiv0.m4 +@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig; + exit (sig != SIGFPE); + } + +-int x = 1; +-int y = 0; +-int z; +-int nan; ++volatile int x = 1; ++volatile int y = 0; ++volatile int z; ++volatile int nan; + + int main () + { +diff --git a/libiberty/configure.ac b/libiberty/configure.ac +index f1ce7601..fc20d228 100644 +--- a/libiberty/configure.ac ++++ b/libiberty/configure.ac +@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then + for v in $vars; do + AC_MSG_CHECKING([for $v]) + AC_CACHE_VAL(libiberty_cv_var_$v, +- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])], ++ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])], + [eval "libiberty_cv_var_$v=yes"], + [eval "libiberty_cv_var_$v=no"])]) + if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then diff --git a/SOURCES/binutils-do-not-link-with-static-libstdc++.patch b/SOURCES/binutils-do-not-link-with-static-libstdc++.patch new file mode 100644 index 0000000..49d46c2 --- /dev/null +++ b/SOURCES/binutils-do-not-link-with-static-libstdc++.patch @@ -0,0 +1,83 @@ +diff -rup binutils.orig/configure binutils-2.30/configure +--- binutils.orig/configure 2018-09-24 17:50:06.967172922 +0100 ++++ binutils-2.30/configure 2018-09-24 17:51:16.648624865 +0100 +@@ -4996,49 +4996,6 @@ if test -z "$LD"; then + fi + fi + +-# Check whether -static-libstdc++ -static-libgcc is supported. +-have_static_libs=no +-if test "$GCC" = yes; then +- saved_LDFLAGS="$LDFLAGS" +- +- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++ -static-libgcc" >&5 +-$as_echo_n "checking whether g++ accepts -static-libstdc++ -static-libgcc... " >&6; } +- ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' +-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +- +- +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) +-#error -static-libstdc++ not implemented +-#endif +-int main() {} +-_ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; }; have_static_libs=yes +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_c_compiler_gnu +- +- +- LDFLAGS="$saved_LDFLAGS" +-fi +- +- + + + if test -n "$ac_tool_prefix"; then +diff -rup binutils.orig/configure.ac binutils-2.30/configure.ac +--- binutils.orig/configure.ac 2018-09-24 17:50:07.241170767 +0100 ++++ binutils-2.30/configure.ac 2018-09-24 17:50:29.908992486 +0100 +@@ -1288,26 +1288,6 @@ if test -z "$LD"; then + fi + fi + +-# Check whether -static-libstdc++ -static-libgcc is supported. +-have_static_libs=no +-if test "$GCC" = yes; then +- saved_LDFLAGS="$LDFLAGS" +- +- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" +- AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc]) +- AC_LANG_PUSH(C++) +- AC_LINK_IFELSE([AC_LANG_SOURCE([ +-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) +-#error -static-libstdc++ not implemented +-#endif +-int main() {}])], +- [AC_MSG_RESULT([yes]); have_static_libs=yes], +- [AC_MSG_RESULT([no])]) +- AC_LANG_POP(C++) +- +- LDFLAGS="$saved_LDFLAGS" +-fi +- + ACX_PROG_GNAT + ACX_PROG_CMP_IGNORE_INITIAL + diff --git a/SOURCES/binutils-duplicate-sections.patch b/SOURCES/binutils-duplicate-sections.patch new file mode 100644 index 0000000..441bb2e --- /dev/null +++ b/SOURCES/binutils-duplicate-sections.patch @@ -0,0 +1,34 @@ +diff -rup binutils.orig/ld/ldlang.c binutils-2.35.1/ld/ldlang.c +--- binutils.orig/ld/ldlang.c 2021-01-04 15:20:32.901498036 +0000 ++++ binutils-2.35.1/ld/ldlang.c 2021-01-04 15:22:03.151916333 +0000 +@@ -1529,6 +1529,8 @@ lang_output_section_statement_lookup (co + + entry->s.output_section_statement.name = name; + entry->s.output_section_statement.constraint = constraint; ++ entry->s.output_section_statement.dup_output = (create == 2 ++ || constraint == SPECIAL); + return &entry->s.output_section_statement; + } + +@@ -2390,7 +2392,7 @@ init_os (lang_output_section_statement_t + if (strcmp (s->name, DISCARD_SECTION_NAME) == 0) + einfo (_("%F%P: illegal use of `%s' section\n"), DISCARD_SECTION_NAME); + +- if (s->constraint != SPECIAL) ++ if (!s->dup_output) + s->bfd_section = bfd_get_section_by_name (link_info.output_bfd, s->name); + if (s->bfd_section == NULL) + s->bfd_section = bfd_make_section_anyway_with_flags (link_info.output_bfd, +diff -rup binutils.orig/ld/ldlang.h binutils-2.35.1/ld/ldlang.h +--- binutils.orig/ld/ldlang.h 2021-01-04 15:20:32.627499830 +0000 ++++ binutils-2.35.1/ld/ldlang.h 2021-01-04 15:21:06.688277003 +0000 +@@ -173,6 +173,9 @@ typedef struct lang_output_section_state + unsigned int after_end : 1; + /* If this section uses the alignment of its input sections. */ + unsigned int align_lma_with_input : 1; ++ /* If script has duplicate output section statements of the same name ++ create duplicate output sections. */ ++ unsigned int dup_output : 1; + } lang_output_section_statement_type; + + typedef struct diff --git a/SOURCES/binutils-dwarf-5-dir0.patch b/SOURCES/binutils-dwarf-5-dir0.patch new file mode 100644 index 0000000..72c7592 --- /dev/null +++ b/SOURCES/binutils-dwarf-5-dir0.patch @@ -0,0 +1,186 @@ +diff -rup binutils.orig/gas/dwarf2dbg.c binutils-2.35.2/gas/dwarf2dbg.c +--- binutils.orig/gas/dwarf2dbg.c 2021-08-09 17:50:48.324447191 +0100 ++++ binutils-2.35.2/gas/dwarf2dbg.c 2021-08-09 17:51:03.308359865 +0100 +@@ -616,7 +616,22 @@ get_directory_table_entry (const char * + if (can_use_zero) + { + if (dirs == NULL || dirs[0] == NULL) +- d = 0; ++ { ++ const char * pwd = getpwd (); ++ ++ if (dwarf_level >= 5 && strcmp (dirname, pwd) != 0) ++ { ++ /* In DWARF-5 the 0 entry in the directory table is expected to be ++ the same as the DW_AT_comp_dir (which is set to the current build ++ directory). Since we are about to create a directory entry that ++ is not the same, allocate the current directory first. ++ FIXME: Alternatively we could generate an error message here. */ ++ (void) get_directory_table_entry (pwd, strlen (pwd), TRUE); ++ d = 1; ++ } ++ else ++ d = 0; ++ } + } + else if (d == 0) + d = 1; +@@ -624,8 +639,8 @@ get_directory_table_entry (const char * + if (d >= dirs_allocated) + { + unsigned int old = dirs_allocated; +- +- dirs_allocated = d + 32; ++#define DIR_TABLE_INCREMENT 32 ++ dirs_allocated = d + DIR_TABLE_INCREMENT; + dirs = XRESIZEVEC (char *, dirs, dirs_allocated); + memset (dirs + old, 0, (dirs_allocated - old) * sizeof (char *)); + } +@@ -820,7 +835,7 @@ allocate_filename_to_slot (const char * + dirlen = strlen (dirname); + file = filename; + } +- ++ + d = get_directory_table_entry (dirname, dirlen, num == 0); + i = num; + +@@ -2062,7 +2077,12 @@ out_dir_and_file_list (segT line_seg, in + Otherwise use pwd as main file directory. */ + if (dirs_in_use > 0 && dirs != NULL && dirs[0] != NULL) + dir = remap_debug_filename (dirs[0]); +- else if (dirs_in_use > 1 && dirs != NULL && dirs[1] != NULL) ++ else if (dirs_in_use > 1 ++ && dirs != NULL ++ && dirs[1] != NULL ++ /* DWARF-5 directory tables expect dir[0] to be the same as ++ DW_AT_comp_dir, which is the same as pwd. */ ++ && dwarf_level < 5) + dir = remap_debug_filename (dirs[1]); + else + dir = remap_debug_filename (getpwd ()); +@@ -2165,8 +2185,8 @@ out_dir_and_file_list (segT line_seg, in + uses slot zero, but that is only set explicitly using a + .file 0 directive. If that isn't used, but file 1 is, + then use that as main file name. */ +- if (DWARF2_LINE_VERSION >= 5 && i == 0 && files_in_use >= 1) +- files[0].filename = files[1].filename; ++ if (DWARF2_LINE_VERSION >= 5 && i == 0 && files_in_use >= 1 && files[0].filename == NULL) ++ files[0].filename = files[1].filename; + else + files[i].filename = ""; + if (DWARF2_LINE_VERSION < 5 || i != 0) +Only in binutils-2.35.2/gas/: dwarf2dbg.c.orig +Only in binutils-2.35.2/gas/: dwarf2dbg.c.rej +diff -rup binutils.orig/gas/testsuite/gas/elf/dwarf-5-file0.d binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-file0.d +--- binutils.orig/gas/testsuite/gas/elf/dwarf-5-file0.d 2021-08-09 17:50:48.394446783 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-file0.d 2021-08-09 17:53:36.567466668 +0100 +@@ -3,17 +3,18 @@ + #readelf: -wl + + #... +- The Directory Table \(offset 0x.*, lines 3, columns 1\): ++ The Directory Table \(offset 0x.*, lines 4, columns 1\): + Entry Name +- 0 \(indirect line string, offset: 0x.*\): master directory +- 1 \(indirect line string, offset: 0x.*\): secondary directory +- 2 \(indirect line string, offset: 0x.*\): /tmp ++#... ++ 1 \(indirect line string, offset: 0x.*\): master directory ++ 2 \(indirect line string, offset: 0x.*\): secondary directory ++ 3 \(indirect line string, offset: 0x.*\): /tmp + + The File Name Table \(offset 0x.*, lines 3, columns 3\): + Entry Dir MD5 Name +- 0 0 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): master source file +- 1 1 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): secondary source file +- 2 2 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c ++ 0 1 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): master source file ++ 1 2 0x00000000000000000000000000000000 \(indirect line string, offset: 0x.*\): secondary source file ++ 2 3 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c + #pass + + +Only in binutils-2.35.2/gas/testsuite/gas/elf: dwarf-5-file0.d.orig +Only in binutils-2.35.2/gas/testsuite/gas/elf: dwarf-5-file0.d.rej +diff -rup binutils.orig/gas/testsuite/gas/elf/elf.exp binutils-2.35.2/gas/testsuite/gas/elf/elf.exp +--- binutils.orig/gas/testsuite/gas/elf/elf.exp 2021-08-09 17:50:48.395446778 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/elf/elf.exp 2021-08-09 17:51:03.308359865 +0100 +@@ -274,6 +274,7 @@ if { [is_elf_format] } then { + run_dump_test "dwarf2-18" $dump_opts + run_dump_test "dwarf2-19" $dump_opts + run_dump_test "dwarf-5-file0" $dump_opts ++ run_dump_test "dwarf-5-dir0" $dump_opts + run_dump_test "dwarf-4-cu" $dump_opts + run_dump_test "dwarf-5-cu" $dump_opts + run_dump_test "dwarf-5-nop-for-line-table" $dump_opts +Only in binutils-2.35.2/gas/testsuite/gas/elf: elf.exp.orig +diff -rup binutils.orig/gas/testsuite/gas/i386/dwarf5-line-1.d binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-1.d +--- binutils.orig/gas/testsuite/gas/i386/dwarf5-line-1.d 2021-08-09 17:50:48.363446964 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-1.d 2021-08-09 17:51:03.308359865 +0100 +@@ -33,7 +33,7 @@ Raw dump of debug contents of section \. + + The Directory Table \(offset 0x.*, lines 2, columns 1\): + Entry Name +- 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 ++ 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite + 1 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 + + The File Name Table \(offset 0x.*, lines 2, columns 3\): +diff -rup binutils.orig/gas/testsuite/gas/i386/dwarf5-line-2.d binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-2.d +--- binutils.orig/gas/testsuite/gas/i386/dwarf5-line-2.d 2021-08-09 17:50:48.365446953 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/i386/dwarf5-line-2.d 2021-08-09 17:51:03.308359865 +0100 +@@ -33,7 +33,7 @@ Raw dump of debug contents of section \. + + The Directory Table \(offset 0x.*, lines 2, columns 1\): + Entry Name +- 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 ++ 0 \(indirect line string, offset: 0x.*\): .*/gas/testsuite + 1 \(indirect line string, offset: 0x.*\): .*/gas/testsuite/gas/i386 + + The File Name Table \(offset 0x.*, lines 1, columns 3\): +--- /dev/null 2021-08-09 07:51:33.817495606 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-dir0.s 2021-08-09 17:55:06.745941103 +0100 +@@ -0,0 +1,19 @@ ++ .section .debug_info,"",%progbits ++ .4byte 0x8a ++ .2byte 0x2 ++ .4byte .Ldebug_abbrev0 ++ .byte 0x4 ++ .uleb128 0x1 ++ ++ .file 0 "../not-the-build-directory/master-source-file.c" ++ .line 1 ++ .text ++ .octa 0x12345678901234567890123456789012 ++ ++ .file 1 "secondary directory/secondary source file" ++ .line 2 ++ .word 2 ++ ++ .file 2 "/tmp" "foo.c" md5 0x95828e8bc4f7404dbf7526fb7bd0f192 ++ .line 5 ++ .word 6 +--- /dev/null 2021-08-09 07:51:33.817495606 +0100 ++++ binutils-2.35.2/gas/testsuite/gas/elf/dwarf-5-dir0.d 2021-08-09 17:55:06.745941103 +0100 +@@ -0,0 +1,20 @@ ++#as: --gdwarf-5 ++#name: DWARF5 dir[0] ++#readelf: -wl ++ ++#... ++ The Directory Table \(offset 0x.*, lines 4, columns 1\): ++ Entry Name ++ 0 \(indirect line string, offset: 0x0\): .*/gas/testsuite ++ 1 \(indirect line string, offset: 0x.*\): ../not-the-build-directory ++ 2 \(indirect line string, offset: 0x.*\): secondary directory ++ 3 \(indirect line string, offset: 0x.*\): /tmp ++ ++ The File Name Table \(offset 0x.*, lines 3, columns 3\): ++ Entry Dir MD5 Name ++ 0 1 0x0 \(indirect line string, offset: 0x.*\): master-source-file.c ++ 1 2 0x0 \(indirect line string, offset: 0x.*\): secondary source file ++ 2 3 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c ++#pass ++ ++ diff --git a/SOURCES/binutils-elf-add-objects.patch b/SOURCES/binutils-elf-add-objects.patch new file mode 100644 index 0000000..fbe73bb --- /dev/null +++ b/SOURCES/binutils-elf-add-objects.patch @@ -0,0 +1,36 @@ +--- binutils.orig/bfd/elflink.c 2020-07-31 10:45:48.747912761 +0100 ++++ binutils-2.35/bfd/elflink.c 2020-07-31 10:47:26.336262770 +0100 +@@ -505,6 +505,16 @@ bfd_elf_link_record_dynamic_symbol (stru + const char *name; + size_t indx; + ++ if (h->root.type == bfd_link_hash_defined ++ || h->root.type == bfd_link_hash_defweak) ++ { ++ /* An IR symbol should not be made dynamic. */ ++ if (h->root.u.def.section != NULL ++ && h->root.u.def.section->owner != NULL ++ && (h->root.u.def.section->owner->flags & BFD_PLUGIN) != 0) ++ return TRUE; ++ } ++ + /* XXX: The ABI draft says the linker must turn hidden and + internal symbols into STB_LOCAL symbols when producing the + DSO. However, if ld.so honors st_other in the dynamic table, +@@ -5199,15 +5209,11 @@ elf_link_add_object_symbols (bfd *abfd, + break; + } + +- /* Don't add DT_NEEDED for references from the dummy bfd nor +- for unmatched symbol. */ + if (!add_needed + && matched + && definition + && ((dynsym +- && h->ref_regular_nonweak +- && (old_bfd == NULL +- || (old_bfd->flags & BFD_PLUGIN) == 0)) ++ && h->ref_regular_nonweak) + || (h->ref_dynamic_nonweak + && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0 + && !on_needed_list (elf_dt_name (abfd), diff --git a/SOURCES/binutils-export-demangle.h.patch b/SOURCES/binutils-export-demangle.h.patch new file mode 100644 index 0000000..6e47d7d --- /dev/null +++ b/SOURCES/binutils-export-demangle.h.patch @@ -0,0 +1,33 @@ +diff -rup binutils.orig/bfd/Makefile.am binutils-2.32/bfd/Makefile.am +--- binutils.orig/bfd/Makefile.am 2019-02-08 12:22:51.395684251 +0000 ++++ binutils-2.32/bfd/Makefile.am 2019-02-08 12:22:53.970664973 +0000 +@@ -33,7 +33,7 @@ bfdlibdir = @bfdlibdir@ + bfdincludedir = @bfdincludedir@ + bfdlib_LTLIBRARIES = libbfd.la + bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ +- bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h ++ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h + else !INSTALL_LIBBFD + # Empty these so that the respective installation directories will not be created. + bfdlibdir = +diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in +--- binutils.orig/bfd/Makefile.in 2019-02-08 12:21:35.291254044 +0000 ++++ binutils-2.32/bfd/Makefile.in 2019-02-08 12:22:10.163992947 +0000 +@@ -249,7 +249,7 @@ am__can_run_installinfo = \ + esac + am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bfd_stdint.h \ +- $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h ++ $(INCDIR)/diagnostics.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h + HEADERS = $(bfdinclude_HEADERS) + RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +@@ -468,7 +468,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel + @INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2) + @INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \ + @INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ +-@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h \ ++@INSTALL_LIBBFD_TRUE@ bfd_stdint.h $(INCDIR)/diagnostics.h $(INCDIR)/demangle.h \ + @INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2) + @INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@ + @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la diff --git a/SOURCES/binutils-extend-s390-arch14-support.patch b/SOURCES/binutils-extend-s390-arch14-support.patch new file mode 100644 index 0000000..0db6ac5 --- /dev/null +++ b/SOURCES/binutils-extend-s390-arch14-support.patch @@ -0,0 +1,657 @@ +Only in binutils-2.35.1/gas: ChangeLog.orig +Only in binutils-2.35.1/gas: ChangeLog.rej +Only in binutils-2.35.1/gas/config: tc-s390.c.rej +diff -rup binutils.orig/gas/doc/c-s390.texi binutils-2.35.1/gas/doc/c-s390.texi +--- binutils.orig/gas/doc/c-s390.texi 2021-03-25 14:35:40.951633346 +0000 ++++ binutils-2.35.1/gas/doc/c-s390.texi 2021-03-25 14:39:39.910468584 +0000 +@@ -313,7 +313,7 @@ field. The notation changes as follows: + @cindex instruction formats, s390 + @cindex s390 instruction formats + +-The Principles of Operation manuals lists 26 instruction formats where ++The Principles of Operation manuals lists 35 instruction formats where + some of the formats have multiple variants. For the @samp{.insn} + pseudo directive the assembler recognizes some of the formats. + Typically, the most general variant of the instruction format is used +@@ -545,6 +545,54 @@ with the @samp{.insn} pseudo directive: + 0 8 12 16 20 32 36 47 + @end verbatim + ++@item VRV format: V1,D2(V2,B2),M3 ++@verbatim +++--------+----+----+----+-------------+----+------------+ ++| OpCode | V1 | V2 | B2 | D2 | M3 | Opcode | +++--------+----+----+----+-------------+----+------------+ ++0 8 12 16 20 32 36 47 ++@end verbatim ++ ++@item VRI format: V1,V2,I3,M4,M5 ++@verbatim +++--------+----+----+-------------+----+----+------------+ ++| OpCode | V1 | V2 | I3 | M5 | M4 | Opcode | +++--------+----+----+-------------+----+----+------------+ ++0 8 12 16 28 32 36 47 ++@end verbatim ++ ++@item VRX format: V1,D2(R2,B2),M3 ++@verbatim +++--------+----+----+----+-------------+----+------------+ ++| OpCode | V1 | R2 | B2 | D2 | M3 | Opcode | +++--------+----+----+----+-------------+----+------------+ ++0 8 12 16 20 32 36 47 ++@end verbatim ++ ++@item VRS format: R1,V3,D2(B2),M4 ++@verbatim +++--------+----+----+----+-------------+----+------------+ ++| OpCode | R1 | V3 | B2 | D2 | M4 | Opcode | +++--------+----+----+----+-------------+----+------------+ ++0 8 12 16 20 32 36 47 ++@end verbatim ++ ++@item VRR format: V1,V2,V3,M4,M5,M6 ++@verbatim +++--------+----+----+----+---+----+----+----+------------+ ++| OpCode | V1 | V2 | V3 |///| M6 | M5 | M4 | Opcode | +++--------+----+----+----+---+----+----+----+------------+ ++0 8 12 16 24 28 32 36 47 ++@end verbatim ++ ++@item VSI format: V1,D2(B2),I3 ++@verbatim +++--------+---------+----+-------------+----+------------+ ++| OpCode | I3 | B2 | D2 | V1 | Opcode | +++--------+---------+----+-------------+----+------------+ ++0 8 16 20 32 36 47 ++@end verbatim ++ + @end table + + For the complete list of all instruction format variants see the +Only in binutils-2.35.1/gas/doc: c-s390.texi.orig +Only in binutils-2.35.1/gas/doc: c-s390.texi.rej +diff -rup binutils.orig/gas/testsuite/gas/s390/esa-g5.d binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.d +--- binutils.orig/gas/testsuite/gas/s390/esa-g5.d 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.d 2021-03-25 14:39:56.533387550 +0000 +@@ -78,10 +78,14 @@ Disassembly of section .text: + .*: 07 29 [ ]*bhr %r9 + .*: 07 f9 [ ]*br %r9 + .*: a7 95 00 00 [ ]*bras %r9,e2 +-.*: a7 64 00 00 [ ]*jlh e6 +-.*: a7 66 00 00 [ ]*brct %r6,ea +-.*: 84 69 00 00 [ ]*brxh %r6,%r9,ee +-.*: 85 69 00 00 [ ]*brxle %r6,%r9,f2 ++.*: a7 65 00 00 [ ]*bras %r6,e6 ++.*: a7 64 00 00 [ ]*jlh ea ++.*: a7 66 00 00 [ ]*brct %r6,ee ++.*: a7 66 00 00 [ ]*brct %r6,f2 ++.*: 84 69 00 00 [ ]*brxh %r6,%r9,f6 ++.*: 84 69 00 00 [ ]*brxh %r6,%r9,fa ++.*: 85 69 00 00 [ ]*brxle %r6,%r9,fe ++.*: 85 69 00 00 [ ]*brxle %r6,%r9,102 + .*: b2 5a 00 69 [ ]*bsa %r6,%r9 + .*: b2 58 00 69 [ ]*bsg %r6,%r9 + .*: 0b 69 [ ]*bsm %r6,%r9 +@@ -180,27 +184,49 @@ Disassembly of section .text: + .*: b2 21 00 69 [ ]*ipte %r6,%r9 + .*: b2 29 00 69 [ ]*iske %r6,%r9 + .*: b2 23 00 69 [ ]*ivsk %r6,%r9 +-.*: a7 f4 00 00 [ ]*j 278 +-.*: a7 84 00 00 [ ]*je 27c +-.*: a7 24 00 00 [ ]*jh 280 +-.*: a7 a4 00 00 [ ]*jhe 284 +-.*: a7 44 00 00 [ ]*jl 288 +-.*: a7 c4 00 00 [ ]*jle 28c +-.*: a7 64 00 00 [ ]*jlh 290 +-.*: a7 44 00 00 [ ]*jl 294 +-.*: a7 74 00 00 [ ]*jne 298 +-.*: a7 d4 00 00 [ ]*jnh 29c +-.*: a7 54 00 00 [ ]*jnhe 2a0 +-.*: a7 b4 00 00 [ ]*jnl 2a4 +-.*: a7 34 00 00 [ ]*jnle 2a8 +-.*: a7 94 00 00 [ ]*jnlh 2ac +-.*: a7 b4 00 00 [ ]*jnl 2b0 +-.*: a7 e4 00 00 [ ]*jno 2b4 +-.*: a7 d4 00 00 [ ]*jnh 2b8 +-.*: a7 74 00 00 [ ]*jne 2bc +-.*: a7 14 00 00 [ ]*jo 2c0 +-.*: a7 24 00 00 [ ]*jh 2c4 +-.*: a7 84 00 00 [ ]*je 2c8 ++.*: a7 f4 00 00 [ ]*j 288 ++.*: a7 84 00 00 [ ]*je 28c ++.*: a7 24 00 00 [ ]*jh 290 ++.*: a7 a4 00 00 [ ]*jhe 294 ++.*: a7 44 00 00 [ ]*jl 298 ++.*: a7 c4 00 00 [ ]*jle 29c ++.*: a7 64 00 00 [ ]*jlh 2a0 ++.*: a7 44 00 00 [ ]*jl 2a4 ++.*: a7 74 00 00 [ ]*jne 2a8 ++.*: a7 d4 00 00 [ ]*jnh 2ac ++.*: a7 54 00 00 [ ]*jnhe 2b0 ++.*: a7 b4 00 00 [ ]*jnl 2b4 ++.*: a7 34 00 00 [ ]*jnle 2b8 ++.*: a7 94 00 00 [ ]*jnlh 2bc ++.*: a7 b4 00 00 [ ]*jnl 2c0 ++.*: a7 e4 00 00 [ ]*jno 2c4 ++.*: a7 d4 00 00 [ ]*jnh 2c8 ++.*: a7 74 00 00 [ ]*jne 2cc ++.*: a7 14 00 00 [ ]*jo 2d0 ++.*: a7 24 00 00 [ ]*jh 2d4 ++.*: a7 84 00 00 [ ]*je 2d8 ++.*: a7 04 00 00 [ ]*jnop 2dc ++.*: a7 14 00 00 [ ]*jo 2e0 ++.*: a7 24 00 00 [ ]*jh 2e4 ++.*: a7 24 00 00 [ ]*jh 2e8 ++.*: a7 34 00 00 [ ]*jnle 2ec ++.*: a7 44 00 00 [ ]*jl 2f0 ++.*: a7 44 00 00 [ ]*jl 2f4 ++.*: a7 54 00 00 [ ]*jnhe 2f8 ++.*: a7 64 00 00 [ ]*jlh 2fc ++.*: a7 74 00 00 [ ]*jne 300 ++.*: a7 74 00 00 [ ]*jne 304 ++.*: a7 84 00 00 [ ]*je 308 ++.*: a7 84 00 00 [ ]*je 30c ++.*: a7 94 00 00 [ ]*jnlh 310 ++.*: a7 a4 00 00 [ ]*jhe 314 ++.*: a7 b4 00 00 [ ]*jnl 318 ++.*: a7 b4 00 00 [ ]*jnl 31c ++.*: a7 c4 00 00 [ ]*jle 320 ++.*: a7 d4 00 00 [ ]*jnh 324 ++.*: a7 d4 00 00 [ ]*jnh 328 ++.*: a7 e4 00 00 [ ]*jno 32c ++.*: a7 f4 00 00 [ ]*j 330 + .*: ed 65 af ff 00 18 [ ]*kdb %f6,4095\(%r5,%r10\) + .*: b3 18 00 69 [ ]*kdbr %f6,%f9 + .*: ed 65 af ff 00 08 [ ]*keb %f6,4095\(%r5,%r10\) +@@ -483,4 +509,4 @@ Disassembly of section .text: + .*: f8 58 5f ff af ff [ ]*zap 4095\(6,%r5\),4095\(9,%r10\) + .*: b2 21 b0 69 [ ]*ipte %r6,%r9,%r11 + .*: b2 21 bd 69 [ ]*ipte %r6,%r9,%r11,13 +-.*: 07 07 [ ]*nopr %r7 ++.*: 07 07 [ ]*nopr %r7 +diff -rup binutils.orig/gas/testsuite/gas/s390/esa-g5.s binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.s +--- binutils.orig/gas/testsuite/gas/s390/esa-g5.s 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/esa-g5.s 2021-03-25 14:39:56.534387545 +0000 +@@ -72,10 +72,14 @@ foo: + bpr %r9 + br %r9 + bras %r9,. ++ jas %r6,. + brc 6,. + brct 6,. ++ jct %r6,. + brxh %r6,%r9,. ++ jxh %r6,%r9,. + brxle %r6,%r9,. ++ jxle %r6,%r9,. + bsa %r6,%r9 + bsg %r6,%r9 + bsm %r6,%r9 +@@ -195,6 +199,28 @@ foo: + jo . + jp . + jz . ++ jnop . ++ bro . ++ brh . ++ brp . ++ brnle . ++ brl . ++ brm . ++ brnhe . ++ brlh . ++ brne . ++ brnz . ++ bre . ++ brz . ++ brnlh . ++ brhe . ++ brnl . ++ brnm . ++ brle . ++ brnh . ++ brnp . ++ brno . ++ bru . + kdb %f6,4095(%r5,%r10) + kdbr %f6,%f9 + keb %f6,4095(%r5,%r10) +diff -rup binutils.orig/gas/testsuite/gas/s390/esa-z900.d binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.d +--- binutils.orig/gas/testsuite/gas/s390/esa-z900.d 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.d 2021-03-25 14:39:56.534387545 +0000 +@@ -6,29 +6,52 @@ + Disassembly of section .text: + + .* : +-.*: c0 f4 00 00 00 00 [ ]*jg 0 \ +-.*: c0 14 00 00 00 00 [ ]*jgo 6 \ +-.*: c0 24 00 00 00 00 [ ]*jgh c \ +-.*: c0 24 00 00 00 00 [ ]*jgh 12 \ +-.*: c0 34 00 00 00 00 [ ]*jgnle 18 \ +-.*: c0 44 00 00 00 00 [ ]*jgl 1e \ +-.*: c0 44 00 00 00 00 [ ]*jgl 24 \ +-.*: c0 54 00 00 00 00 [ ]*jgnhe 2a \ +-.*: c0 64 00 00 00 00 [ ]*jglh 30 \ +-.*: c0 74 00 00 00 00 [ ]*jgne 36 \ +-.*: c0 74 00 00 00 00 [ ]*jgne 3c \ +-.*: c0 84 00 00 00 00 [ ]*jge 42 \ +-.*: c0 84 00 00 00 00 [ ]*jge 48 \ +-.*: c0 94 00 00 00 00 [ ]*jgnlh 4e \ +-.*: c0 a4 00 00 00 00 [ ]*jghe 54 \ +-.*: c0 b4 00 00 00 00 [ ]*jgnl 5a \ +-.*: c0 b4 00 00 00 00 [ ]*jgnl 60 \ +-.*: c0 c4 00 00 00 00 [ ]*jgle 66 \ +-.*: c0 d4 00 00 00 00 [ ]*jgnh 6c \ +-.*: c0 d4 00 00 00 00 [ ]*jgnh 72 \ +-.*: c0 e4 00 00 00 00 [ ]*jgno 78 \ +-.*: c0 f4 00 00 00 00 [ ]*jg 7e \ +-.*: c0 65 00 00 00 00 [ ]*brasl %r6,84 \ ++.*: c0 f4 00 00 00 00 [ ]*jg 0 ++.*: c0 04 00 00 00 00 [ ]*jgnop 6 ++.*: c0 14 00 00 00 00 [ ]*jgo c ++.*: c0 24 00 00 00 00 [ ]*jgh 12 ++.*: c0 24 00 00 00 00 [ ]*jgh 18 ++.*: c0 34 00 00 00 00 [ ]*jgnle 1e ++.*: c0 44 00 00 00 00 [ ]*jgl 24 ++.*: c0 44 00 00 00 00 [ ]*jgl 2a ++.*: c0 54 00 00 00 00 [ ]*jgnhe 30 ++.*: c0 64 00 00 00 00 [ ]*jglh 36 ++.*: c0 74 00 00 00 00 [ ]*jgne 3c ++.*: c0 74 00 00 00 00 [ ]*jgne 42 ++.*: c0 84 00 00 00 00 [ ]*jge 48 ++.*: c0 84 00 00 00 00 [ ]*jge 4e ++.*: c0 94 00 00 00 00 [ ]*jgnlh 54 ++.*: c0 a4 00 00 00 00 [ ]*jghe 5a ++.*: c0 b4 00 00 00 00 [ ]*jgnl 60 ++.*: c0 b4 00 00 00 00 [ ]*jgnl 66 ++.*: c0 c4 00 00 00 00 [ ]*jgle 6c ++.*: c0 d4 00 00 00 00 [ ]*jgnh 72 ++.*: c0 d4 00 00 00 00 [ ]*jgnh 78 ++.*: c0 e4 00 00 00 00 [ ]*jgno 7e ++.*: c0 f4 00 00 00 00 [ ]*jg 84 ++.*: c0 14 00 00 00 00 [ ]*jgo 8a ++.*: c0 24 00 00 00 00 [ ]*jgh 90 ++.*: c0 24 00 00 00 00 [ ]*jgh 96 ++.*: c0 34 00 00 00 00 [ ]*jgnle 9c ++.*: c0 44 00 00 00 00 [ ]*jgl a2 ++.*: c0 44 00 00 00 00 [ ]*jgl a8 ++.*: c0 54 00 00 00 00 [ ]*jgnhe ae ++.*: c0 64 00 00 00 00 [ ]*jglh b4 ++.*: c0 74 00 00 00 00 [ ]*jgne ba ++.*: c0 74 00 00 00 00 [ ]*jgne c0 ++.*: c0 84 00 00 00 00 [ ]*jge c6 ++.*: c0 84 00 00 00 00 [ ]*jge cc ++.*: c0 94 00 00 00 00 [ ]*jgnlh d2 ++.*: c0 a4 00 00 00 00 [ ]*jghe d8 ++.*: c0 b4 00 00 00 00 [ ]*jgnl de ++.*: c0 b4 00 00 00 00 [ ]*jgnl e4 ++.*: c0 c4 00 00 00 00 [ ]*jgle ea ++.*: c0 d4 00 00 00 00 [ ]*jgnh f0 ++.*: c0 d4 00 00 00 00 [ ]*jgnh f6 ++.*: c0 e4 00 00 00 00 [ ]*jgno fc ++.*: c0 f4 00 00 00 00 [ ]*jg 102 ++.*: c0 65 00 00 00 00 [ ]*brasl %r6,108 ++.*: c0 65 00 00 00 00 [ ]*brasl %r6,10e + .*: 01 0b [ ]*tam + .*: 01 0c [ ]*sam24 + .*: 01 0d [ ]*sam31 +@@ -39,7 +62,7 @@ Disassembly of section .text: + .*: b9 97 00 69 [ ]*dlr %r6,%r9 + .*: b9 98 00 69 [ ]*alcr %r6,%r9 + .*: b9 99 00 69 [ ]*slbr %r6,%r9 +-.*: c0 60 00 00 00 00 [ ]*larl %r6,ac \ ++.*: c0 60 00 00 00 00 [ ]*larl %r6,136 + .*: e3 65 af ff 00 1e [ ]*lrv %r6,4095\(%r5,%r10\) + .*: e3 65 af ff 00 1f [ ]*lrvh %r6,4095\(%r5,%r10\) + .*: e3 65 af ff 00 3e [ ]*strv %r6,4095\(%r5,%r10\) +@@ -49,3 +72,4 @@ Disassembly of section .text: + .*: e3 65 af ff 00 98 [ ]*alc %r6,4095\(%r5,%r10\) + .*: e3 65 af ff 00 99 [ ]*slb %r6,4095\(%r5,%r10\) + .*: eb 69 5f ff 00 1d [ ]*rll %r6,%r9,4095\(%r5\) ++.*: 07 07 [ ]*nopr %r7 +diff -rup binutils.orig/gas/testsuite/gas/s390/esa-z900.s binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.s +--- binutils.orig/gas/testsuite/gas/s390/esa-z900.s 2021-03-25 14:35:41.037632927 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/esa-z900.s 2021-03-25 14:39:56.534387545 +0000 +@@ -1,6 +1,7 @@ + .text + foo: + brcl 15,. ++ jgnop . + jgo . + jgh . + jgp . +@@ -22,7 +23,29 @@ foo: + jgnp . + jgno . + jg . ++ brol . ++ brhl . ++ brpl . ++ brnlel . ++ brll . ++ brml . ++ brnhel . ++ brlhl . ++ brnel . ++ brnzl . ++ brel . ++ brzl . ++ brnlhl . ++ brhel . ++ brnll . ++ brnml . ++ brlel . ++ brnhl . ++ brnpl . ++ brnol . ++ brul . + brasl %r6,. ++ jasl %r6,. + tam + sam24 + sam31 +Only in binutils-2.35.1/gas/testsuite/gas/s390: s390.exp.rej +Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.d +Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.s +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z10.d binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.d +--- binutils.orig/gas/testsuite/gas/s390/zarch-z10.d 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.d 2021-03-25 14:39:49.766420543 +0000 +@@ -362,11 +362,13 @@ Disassembly of section .text: + .*: ec 67 d2 dc e6 54 [ ]*rnsbg %r6,%r7,210,220,230 + .*: ec 67 d2 dc e6 57 [ ]*rxsbg %r6,%r7,210,220,230 + .*: ec 67 d2 dc e6 56 [ ]*rosbg %r6,%r7,210,220,230 +-.*: ec 67 d2 dc e6 55 [ ]*risbg %r6,%r7,210,220,230 +-.*: c4 6f 00 00 00 00 [ ]*strl %r6,7f6 +-.*: c4 6b 00 00 00 00 [ ]*stgrl %r6,7fc +-.*: c4 67 00 00 00 00 [ ]*sthrl %r6,802 +-.*: c6 60 00 00 00 00 [ ]*exrl %r6,808 ++.*: ec 67 d2 14 e6 55 [ ]*risbg %r6,%r7,210,20,230 ++.*: ec 67 d2 bc e6 55 [ ]*risbgz %r6,%r7,210,60,230 ++.*: ec 67 d2 94 e6 55 [ ]*risbgz %r6,%r7,210,20,230 ++.*: c4 6f 00 00 00 00 [ ]*strl %r6,802 ++.*: c4 6b 00 00 00 00 [ ]*stgrl %r6,808 ++.*: c4 67 00 00 00 00 [ ]*sthrl %r6,80e ++.*: c6 60 00 00 00 00 [ ]*exrl %r6,814 + .*: af ee 6d 05 [ ]*mc 3333\(%r6\),238 + .*: b9 a2 00 60 [ ]*ptf %r6 + .*: b9 af 00 67 [ ]*pfmf %r6,%r7 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z10.s binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.s +--- binutils.orig/gas/testsuite/gas/s390/zarch-z10.s 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z10.s 2021-03-25 14:39:49.766420543 +0000 +@@ -356,7 +356,9 @@ foo: + rnsbg %r6,%r7,210,220,230 + rxsbg %r6,%r7,210,220,230 + rosbg %r6,%r7,210,220,230 +- risbg %r6,%r7,210,220,230 ++ risbg %r6,%r7,210,20,230 ++ risbg %r6,%r7,210,188,230 ++ risbgz %r6,%r7,210,20,230 + strl %r6,. + stgrl %r6,. + sthrl %r6,. +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z900.d binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.d +--- binutils.orig/gas/testsuite/gas/s390/zarch-z900.d 2021-03-25 14:35:41.037632927 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.d 2021-03-25 14:39:56.534387545 +0000 +@@ -20,8 +20,11 @@ Disassembly of section .text: + .*: e3 95 af ff 00 46 [ ]*bctg %r9,4095\(%r5,%r10\) + .*: b9 46 00 96 [ ]*bctgr %r9,%r6 + .*: a7 97 00 00 [ ]*brctg %r9,40 \ +-.*: ec 96 00 00 00 44 [ ]*brxhg %r9,%r6,44 +-.*: ec 96 00 00 00 45 [ ]*brxlg %r9,%r6,4a ++.*: a7 67 00 00 [ ]*brctg %r6,44 ++.*: ec 96 00 00 00 44 [ ]*brxhg %r9,%r6,48 ++.*: ec 69 00 00 00 44 [ ]*brxhg %r6,%r9,4e ++.*: ec 96 00 00 00 45 [ ]*brxlg %r9,%r6,54 ++.*: ec 69 00 00 00 45 [ ]*brxlg %r6,%r9,5a + .*: eb 96 5f ff 00 44 [ ]*bxhg %r9,%r6,4095\(%r5\) + .*: eb 96 5f ff 00 45 [ ]*bxleg %r9,%r6,4095\(%r5\) + .*: b3 a5 00 96 [ ]*cdgbr %f9,%r6 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z900.s binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.s +--- binutils.orig/gas/testsuite/gas/s390/zarch-z900.s 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-z900.s 2021-03-25 14:39:56.534387545 +0000 +@@ -14,8 +14,11 @@ foo: + bctg %r9,4095(%r5,%r10) + bctgr %r9,%r6 + brctg %r9,. ++ jctg %r6,. + brxhg %r9,%r6,. ++ jxhg %r6,%r9,. + brxlg %r9,%r6,. ++ jxleg %r6,%r9,. + bxhg %r9,%r6,4095(%r5) + bxleg %r9,%r6,4095(%r5) + cdgbr %f9,%r6 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.d binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.d +--- binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.d 2021-03-25 14:35:41.037632927 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.d 2021-03-25 14:39:49.766420543 +0000 +@@ -47,6 +47,8 @@ Disassembly of section .text: + .*: eb 6c 7a 4d fe 2b [ ]*clgtnh %r6,-5555\(%r7\) + .*: eb 6c 7a 4d fe 2b [ ]*clgtnh %r6,-5555\(%r7\) + .*: ec 67 0c 0d 0e 59 [ ]*risbgn %r6,%r7,12,13,14 ++.*: ec 67 0c bc 0e 59 [ ]*risbgnz %r6,%r7,12,60,14 ++.*: ec 67 0c 94 0e 59 [ ]*risbgnz %r6,%r7,12,20,14 + .*: ed 0f 8f a0 6d aa [ ]*cdzt %f6,4000\(16,%r8\),13 + .*: ed 21 8f a0 4d ab [ ]*cxzt %f4,4000\(34,%r8\),13 + .*: ed 0f 8f a0 6d a8 [ ]*czdt %f6,4000\(16,%r8\),13 +@@ -54,16 +56,16 @@ Disassembly of section .text: + .*: b2 e8 c0 56 [ ]*ppa %r5,%r6,12 + .*: b9 8f 60 59 [ ]*crdte %r5,%r6,%r9 + .*: b9 8f 61 59 [ ]*crdte %r5,%r6,%r9,1 +-.*: c5 a0 0c 00 00 0c [ ]*bprp 10,12a ,12a +-.*: c5 a0 00 00 00 00 [ ]*bprp 10,118 ,118 +-[ ]*119: R_390_PLT12DBL bar\+0x1 +-[ ]*11b: R_390_PLT24DBL bar\+0x3 +-.*: c7 a0 00 00 00 00 [ ]*bpp 10,11e ,0 +-[ ]*122: R_390_PLT16DBL bar\+0x4 +-.*: c7 a0 00 00 00 00 [ ]*bpp 10,124 ,0 +-[ ]*128: R_390_PC16DBL baz\+0x4 ++.*: c5 a0 0c 00 00 0c [ ]*bprp 10,136 ,136 ++.*: c5 a0 00 00 00 00 [ ]*bprp 10,124 ,124 ++[ ]*125: R_390_PLT12DBL bar\+0x1 ++[ ]*127: R_390_PLT24DBL bar\+0x3 ++.*: c7 a0 00 00 00 00 [ ]*bpp 10,12a ,0 ++[ ]*12e: R_390_PLT16DBL bar\+0x4 ++.*: c7 a0 00 00 00 00 [ ]*bpp 10,130 ,0 ++[ ]*134: R_390_PC16DBL baz\+0x4 + + +-000000000000012a : ++0000000000000136 : + + .*: 07 07 [ ]*nopr %r7 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.s binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.s +--- binutils.orig/gas/testsuite/gas/s390/zarch-zEC12.s 2021-03-25 14:35:41.038632922 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/zarch-zEC12.s 2021-03-25 14:39:49.766420543 +0000 +@@ -44,6 +44,9 @@ foo: + clgtnh %r6,-5555(%r7) + + risbgn %r6,%r7,12,13,14 ++ risbgn %r6,%r7,12,188,14 ++ risbgnz %r6,%r7,12,20,14 ++ + cdzt %f6,4000(16,%r8),13 + cxzt %f4,4000(34,%r8),13 + czdt %f6,4000(16,%r8),13 +Only in binutils-2.35.1/include: ChangeLog.orig +Only in binutils-2.35.1/include: ChangeLog.rej +Only in binutils-2.35.1/include/opcode: s390.h.rej +Only in binutils-2.35.1/ld: ChangeLog.orig +Only in binutils-2.35.1/ld: ChangeLog.rej +diff -rup binutils.orig/ld/testsuite/ld-s390/tlsbin_64.dd binutils-2.35.1/ld/testsuite/ld-s390/tlsbin_64.dd +--- binutils.orig/ld/testsuite/ld-s390/tlsbin_64.dd 2021-03-25 14:35:40.826633955 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-s390/tlsbin_64.dd 2021-03-25 14:39:56.534387545 +0000 +@@ -87,26 +87,26 @@ Disassembly of section .text: + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) + # GD -> LE with global variable defined in executable + +[0-9a-f]+: e3 20 d0 10 00 04 lg %r2,16\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) + # GD -> LE with local variable defined in executable + +[0-9a-f]+: e3 20 d0 18 00 04 lg %r2,24\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) + # GD -> LE with hidden variable defined in executable + +[0-9a-f]+: e3 20 d0 20 00 04 lg %r2,32\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) + # LD -> LE + +[0-9a-f]+: e3 20 d0 28 00 04 lg %r2,40\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: e3 40 d0 30 00 04 lg %r4,48\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: e3 40 d0 38 00 04 lg %r4,56\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: e3 20 d0 40 00 04 lg %r2,64\(%r13\) +- +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ ++ +[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: e3 40 d0 48 00 04 lg %r4,72\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +Only in binutils-2.35.1/opcodes: ChangeLog.orig +Only in binutils-2.35.1/opcodes: ChangeLog.rej +Only in binutils-2.35.1/opcodes: s390-mkopc.c.rej +diff -rup binutils.orig/opcodes/s390-opc.c binutils-2.35.1/opcodes/s390-opc.c +--- binutils.orig/opcodes/s390-opc.c 2021-03-25 14:35:40.719634477 +0000 ++++ binutils-2.35.1/opcodes/s390-opc.c 2021-03-25 14:39:49.766420543 +0000 +@@ -218,32 +218,34 @@ const struct s390_operand s390_operands[ + { 8, 8, 0 }, + #define U8_16 68 /* 8 bit unsigned value starting at 16 */ + { 8, 16, 0 }, +-#define U8_24 69 /* 8 bit unsigned value starting at 24 */ ++#define U6_26 69 /* 6 bit unsigned value starting at 26 */ ++ { 6, 26, 0 }, ++#define U8_24 70 /* 8 bit unsigned value starting at 24 */ + { 8, 24, 0 }, +-#define U8_28 70 /* 8 bit unsigned value starting at 28 */ ++#define U8_28 71 /* 8 bit unsigned value starting at 28 */ + { 8, 28, 0 }, +-#define U8_32 71 /* 8 bit unsigned value starting at 32 */ ++#define U8_32 72 /* 8 bit unsigned value starting at 32 */ + { 8, 32, 0 }, +-#define U12_16 72 /* 12 bit unsigned value starting at 16 */ ++#define U12_16 73 /* 12 bit unsigned value starting at 16 */ + { 12, 16, 0 }, +-#define U16_16 73 /* 16 bit unsigned value starting at 16 */ ++#define U16_16 74 /* 16 bit unsigned value starting at 16 */ + { 16, 16, 0 }, +-#define U16_32 74 /* 16 bit unsigned value starting at 32 */ ++#define U16_32 75 /* 16 bit unsigned value starting at 32 */ + { 16, 32, 0 }, +-#define U32_16 75 /* 32 bit unsigned value starting at 16 */ ++#define U32_16 76 /* 32 bit unsigned value starting at 16 */ + { 32, 16, 0 }, + + /* PC-relative address operands. */ + +-#define J12_12 76 /* 12 bit PC relative offset at 12 */ ++#define J12_12 77 /* 12 bit PC relative offset at 12 */ + { 12, 12, S390_OPERAND_PCREL }, +-#define J16_16 77 /* 16 bit PC relative offset at 16 */ ++#define J16_16 78 /* 16 bit PC relative offset at 16 */ + { 16, 16, S390_OPERAND_PCREL }, +-#define J16_32 78 /* 16 bit PC relative offset at 32 */ ++#define J16_32 79 /* 16 bit PC relative offset at 32 */ + { 16, 32, S390_OPERAND_PCREL }, +-#define J24_24 79 /* 24 bit PC relative offset at 24 */ ++#define J24_24 80 /* 24 bit PC relative offset at 24 */ + { 24, 24, S390_OPERAND_PCREL }, +-#define J32_16 80 /* 32 bit PC relative offset at 16 */ ++#define J32_16 81 /* 32 bit PC relative offset at 16 */ + { 32, 16, S390_OPERAND_PCREL }, + + }; +@@ -313,6 +315,7 @@ const struct s390_operand s390_operands[ + #define INSTR_RIE_R0U0 6, { R_8,U16_16,0,0,0,0 } /* e.g. clfitne */ + #define INSTR_RIE_RUI0 6, { R_8,I16_16,U4_12,0,0,0 } /* e.g. lochi */ + #define INSTR_RIE_RRUUU 6, { R_8,R_12,U8_16,U8_24,U8_32,0 } /* e.g. rnsbg */ ++#define INSTR_RIE_RRUUU2 6, { R_8,R_12,U8_16,U6_26,U8_32,0 } /* e.g. rnsbg */ + #define INSTR_RIL_0P 6, { J32_16,0,0,0,0 } /* e.g. jg */ + #define INSTR_RIL_RP 6, { R_8,J32_16,0,0,0,0 } /* e.g. brasl */ + #define INSTR_RIL_UP 6, { U4_8,J32_16,0,0,0,0 } /* e.g. brcl */ +@@ -534,6 +537,7 @@ const struct s390_operand s390_operands[ + #define MASK_RIE_R0U0 { 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff } + #define MASK_RIE_RUI0 { 0xff, 0x00, 0x00, 0x00, 0xff, 0xff } + #define MASK_RIE_RRUUU { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } ++#define MASK_RIE_RRUUU2 { 0xff, 0x00, 0x00, 0xc0, 0x00, 0xff } + #define MASK_RIL_0P { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } + #define MASK_RIL_RP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } + #define MASK_RIL_UP { 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00 } +diff -rup binutils.orig/opcodes/s390-opc.txt binutils-2.35.1/opcodes/s390-opc.txt +--- binutils.orig/opcodes/s390-opc.txt 2021-03-25 14:35:40.728634433 +0000 ++++ binutils-2.35.1/opcodes/s390-opc.txt 2021-03-25 14:39:56.534387545 +0000 +@@ -246,10 +246,14 @@ d7 xc SS_L0RDRD "exclusive OR" g5 esa,za + f8 zap SS_LLRDRD "zero and add" g5 esa,zarch + a70a ahi RI_RI "add halfword immediate" g5 esa,zarch + 84 brxh RSI_RRP "branch relative on index high" g5 esa,zarch ++84 jxh RSI_RRP "branch relative on index high" g5 esa,zarch + 85 brxle RSI_RRP "branch relative on index low or equal" g5 esa,zarch ++85 jxle RSI_RRP "branch relative on index low or equal" g5 esa,zarch + a705 bras RI_RP "branch relative and save" g5 esa,zarch ++a705 jas RI_RP "branch relative and save" g5 esa,zarch + a704 brc RI_UP "branch relative on condition" g5 esa,zarch + a706 brct RI_RP "branch relative on count" g5 esa,zarch ++a706 jct RI_RP "branch relative on count" g5 esa,zarch + b241 cksm RRE_RR "checksum" g5 esa,zarch + a70e chi RI_RI "compare halfword immediate" g5 esa,zarch + a9 clcle RS_RRRD "compare logical long extended" g5 esa,zarch +@@ -268,8 +272,11 @@ a701 tml RI_RU "test under mask low" g5 + 4700 nop RX_0RRD "no operation" g5 esa,zarch optparm + 4700 b*8 RX_0RRD "conditional branch" g5 esa,zarch + 47f0 b RX_0RRD "unconditional branch" g5 esa,zarch ++a704 jnop RI_0P "nop jump" g5 esa,zarch + a704 j*8 RI_0P "conditional jump" g5 esa,zarch ++a704 br*8 RI_0P "conditional jump" g5 esa,zarch + a7f4 j RI_0P "unconditional jump" g5 esa,zarch ++a7f4 bru RI_0P "unconditional jump" g5 esa,zarch + b34a axbr RRE_FEFE "add extended bfp" g5 esa,zarch + b31a adbr RRE_FF "add long bfp" g5 esa,zarch + ed000000001a adb RXE_FRRD "add long bfp" g5 esa,zarch +@@ -437,7 +444,9 @@ e3000000001b slgf RXE_RRRD "subtract log + e3000000000c msg RXE_RRRD "multiply single 64" z900 zarch + e3000000001c msgf RXE_RRRD "multiply single 64<32" z900 zarch + ec0000000044 brxhg RIE_RRP "branch relative on index high 64" z900 zarch ++ec0000000044 jxhg RIE_RRP "branch relative on index high 64" z900 zarch + ec0000000045 brxlg RIE_RRP "branch relative on index low or equal 64" z900 zarch ++ec0000000045 jxleg RIE_RRP "branch relative on index low or equal 64" z900 zarch + eb0000000044 bxhg RSE_RRRD "branch on index high 64" z900 zarch + eb0000000045 bxleg RSE_RRRD "branch on index low or equal 64" z900 zarch + eb000000000c srlg RSE_RRRD "shift right single logical 64" z900 zarch +@@ -462,10 +471,15 @@ eb0000000080 icmh RSE_RURD "insert chara + a702 tmhh RI_RU "test under mask high high" z900 zarch + a703 tmhl RI_RU "test under mask high low" z900 zarch + c004 brcl RIL_UP "branch relative on condition long" z900 esa,zarch ++c004 jgnop RIL_0P "nop jump long" z900 esa,zarch + c004 jg*8 RIL_0P "conditional jump long" z900 esa,zarch ++c004 br*8l RIL_0P "conditional jump long" z900 esa,zarch + c0f4 jg RIL_0P "unconditional jump long" z900 esa,zarch ++c0f4 brul RIL_0P "unconditional jump long" z900 esa,zarch + c005 brasl RIL_RP "branch relative and save long" z900 esa,zarch ++c005 jasl RIL_RP "branch relative and save long" z900 esa,zarch + a707 brctg RI_RP "branch relative on count 64" z900 zarch ++a707 jctg RI_RP "branch relative on count 64" z900 zarch + a709 lghi RI_RI "load halfword immediate 64" z900 zarch + a70b aghi RI_RI "add halfword immediate 64" z900 zarch + a70d mghi RI_RI "multiply halfword immediate 64" z900 zarch +@@ -956,6 +970,7 @@ ec0000000054 rnsbg RIE_RRUUU "rotate the + ec0000000057 rxsbg RIE_RRUUU "rotate then exclusive or selected bits" z10 zarch + ec0000000056 rosbg RIE_RRUUU "rotate then or selected bits" z10 zarch + ec0000000055 risbg RIE_RRUUU "rotate then insert selected bits" z10 zarch ++ec0000800055 risbgz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits" z10 zarch + c40f strl RIL_RP "store relative long (32)" z10 zarch + c40b stgrl RIL_RP "store relative long (64)" z10 zarch + c407 sthrl RIL_RP "store halfword relative long" z10 zarch +@@ -1139,6 +1154,7 @@ eb0000000023 clt$12 RSY_R0RD "compare lo + eb000000002b clgt RSY_RURD "compare logical and trap 64 bit reg-mem" zEC12 zarch + eb000000002b clgt$12 RSY_R0RD "compare logical and trap 64 bit reg-mem" zEC12 zarch + ec0000000059 risbgn RIE_RRUUU "rotate then insert selected bits nocc" zEC12 zarch ++ec0000800059 risbgnz RIE_RRUUU2 "rotate then insert selected bits and zero remaining bits nocc" zEC12 zarch + ed00000000aa cdzt RSL_LRDFU "convert from zoned long" zEC12 zarch + ed00000000ab cxzt RSL_LRDFEU "convert from zoned extended" zEC12 zarch + ed00000000a8 czdt RSL_LRDFU "convert to zoned long" zEC12 zarch +Only in binutils-2.35.1/opcodes: s390-opc.txt.orig +Only in binutils-2.35.1/opcodes: s390-opc.txt.rej diff --git a/SOURCES/binutils-fix-testsuite-failures.patch b/SOURCES/binutils-fix-testsuite-failures.patch new file mode 100644 index 0000000..c2b19a5 --- /dev/null +++ b/SOURCES/binutils-fix-testsuite-failures.patch @@ -0,0 +1,330 @@ +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:33:21.979627285 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:40:26.911199033 +0000 +@@ -34,5 +34,6 @@ hook called: claim_file tmpdir/libtext.a + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:41:30.189692800 +0000 +@@ -23,5 +23,3 @@ hook called: claim_file tmpdir/main.o \[ + hook called: claim_file .*/ld/testsuite/ld-plugin/func.c \[@0/.* CLAIMED + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... +-.*main.c.*: undefined reference to `\.?func' +-#... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:42:03.598430960 +0000 +@@ -27,7 +27,6 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:42:28.014239600 +0000 +@@ -28,7 +28,6 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:43:21.309821910 +0000 +@@ -30,9 +30,8 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:43:54.925558451 +0000 +@@ -31,7 +31,8 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:49:20.091010016 +0000 +@@ -2,6 +2,5 @@ hook called: all symbols read. + Input: func.c \(tmpdir/libfunc.a\) + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:33:21.978627293 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:49:34.506897033 +0000 +@@ -2,6 +2,5 @@ hook called: all symbols read. + Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\) + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:50:00.409694022 +0000 +@@ -2,6 +2,5 @@ Claimed: tmpdir/libfunc.a \[@.* + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:33:21.979627285 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:50:14.938580156 +0000 +@@ -2,6 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func. + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:49:46.346804240 +0000 +@@ -2,4 +2,5 @@ hook called: all symbols read. + Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\) + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:33:21.978627293 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:50:29.322467422 +0000 +@@ -2,4 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func. + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* ++#... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:45:05.343006557 +0000 +@@ -1 +1,3 @@ + .*: error: Error ++#... ++ +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:33:21.978627293 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:45:22.764870016 +0000 +@@ -1 +1,2 @@ + .*: warning: Warning ++#... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:33:21.976627309 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:48:57.067190464 +0000 +@@ -24,3 +24,4 @@ hook called: claim_file tmpdir/main.o \[ + hook called: claim_file tmpdir/func.o \[@0/.* not claimed + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + hook called: claim_file tmpdir/libempty.a \[@.* not claimed ++#pass +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:33:21.979627285 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:37:14.672749977 +0000 +@@ -27,7 +27,6 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:37:58.000400421 +0000 +@@ -28,7 +28,6 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:38:34.096109209 +0000 +@@ -32,7 +32,6 @@ hook called: claim_file tmpdir/text.o \[ + hook called: all symbols read. + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-.*: tmpdir/main.o: in function `main': +-.*main.c.*: undefined reference to `\.?func' ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:39:52.655475403 +0000 +@@ -31,7 +31,8 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d binutils-2.32/ld/testsuite/ld-plugin/pr20070.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:33:21.976627309 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:50:56.874251486 +0000 +@@ -5,5 +5,6 @@ Sym: 'weakdef' Resolution: LDPR_PREVAILI + Sym: 'undef' Resolution: LDPR_UNDEF + Sym: 'weakundef' Resolution: LDPR_UNDEF + Sym: 'common' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp binutils-2.32/ld/testsuite/ld-srec/srec.exp +--- binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:33:21.938627615 +0000 ++++ binutils-2.32/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:53:58.744814006 +0000 +@@ -21,6 +21,8 @@ + + # Get the offset from an S-record line to the start of the data. + ++return ++ + proc srec_off { l } { + if [string match "S1*" $l] { + return 8 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:10:59.038709514 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:13:53.532300721 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:10:59.041709490 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:14:50.061844322 +0000 +@@ -35,8 +35,9 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:10:58.942710289 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:15:20.030602369 +0000 +@@ -32,7 +32,8 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:10:59.024709627 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:15:54.926320633 +0000 +@@ -35,8 +35,9 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:10:58.998709837 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:12:19.856057024 +0000 +@@ -1,3 +1,2 @@ + .*: error: Error + #... +- +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:10:59.074709224 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:11:48.144313048 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-elfvers/vers24.rd binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd +--- binutils.orig/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 09:45:44.013108697 +0100 ++++ binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 12:06:17.287425232 +0100 +@@ -7,9 +7,9 @@ Symbol table '.dynsym' contains [0-9]+ e + # And ensure the dynamic symbol table contains at least x@VERS.0 + # and foo@@VERS.0 symbols + #... +- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0 ++ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.* + #... +- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0 ++ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.* + #... + Symbol table '.symtab' contains [0-9]+ entries: + #pass +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin.exp binutils-2.30/ld/testsuite/ld-plugin/plugin.exp +--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 09:45:44.023108605 +0100 ++++ binutils-2.30/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 11:18:53.997202105 +0100 +@@ -118,6 +118,12 @@ if { $can_compile && !$failed_compile } + } + } + ++# I do not know why, but the underscore prefix test is going ++# wrong on ppc64le targets. So override it here. ++if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } { ++ set _ "" ++} ++ + set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o" + set testobjfiles_notext "tmpdir/main.o tmpdir/func.o" + set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o" diff --git a/SOURCES/binutils-gcc-10-fixes.patch b/SOURCES/binutils-gcc-10-fixes.patch new file mode 100644 index 0000000..4233279 --- /dev/null +++ b/SOURCES/binutils-gcc-10-fixes.patch @@ -0,0 +1,180 @@ +diff -rup binutils.orig/gold/gdb-index.cc binutils-2.34.0/gold/gdb-index.cc +--- binutils.orig/gold/gdb-index.cc 2020-07-24 09:12:29.241306445 +0100 ++++ binutils-2.34.0/gold/gdb-index.cc 2020-07-24 09:15:48.332095898 +0100 +@@ -817,7 +817,7 @@ Gdb_index_info_reader::get_qualified_nam + void + Gdb_index_info_reader::record_cu_ranges(Dwarf_die* die) + { +- unsigned int shndx; ++ unsigned int shndx = 0; + unsigned int shndx2; + + off_t ranges_offset = die->ref_attribute(elfcpp::DW_AT_ranges, &shndx); +diff -rup binutils.orig/gold/layout.cc binutils-2.34.0/gold/layout.cc +--- binutils.orig/gold/layout.cc 2020-07-24 09:12:29.243306433 +0100 ++++ binutils-2.34.0/gold/layout.cc 2020-07-24 09:15:11.464320064 +0100 +@@ -1986,7 +1986,7 @@ Layout::attach_allocated_section_to_segm + seg_flags |= os->extra_segment_flags(); + + // Check for --section-start. +- uint64_t addr; ++ uint64_t addr = 0; + bool is_address_set = parameters->options().section_start(os->name(), &addr); + + // In general the only thing we really care about for PT_LOAD +diff -rup binutils.orig/binutils/dlltool.c binutils-2.34.0/binutils/dlltool.c +--- binutils.orig/binutils/dlltool.c 2020-07-24 09:12:28.974308069 +0100 ++++ binutils-2.34.0/binutils/dlltool.c 2020-07-24 12:09:37.527121295 +0100 +@@ -1305,7 +1305,7 @@ run (const char *what, char *args) + int pid, wait_status; + int i; + const char **argv; +- char *errmsg_fmt, *errmsg_arg; ++ char *errmsg_fmt = "", *errmsg_arg = ""; + char *temp_base = choose_temp_base (); + + inform (_("run: %s %s"), what, args); +diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c +--- binutils.orig/gas/config/tc-arm.c 2020-07-24 09:12:32.368287432 +0100 ++++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:14:19.842360634 +0100 +@@ -28416,9 +28416,12 @@ md_apply_fix (fixS * fixP, + perform relaxation. */ + if (value == -2) + { +- newval = md_chars_to_number (buf, THUMB_SIZE); +- newval = 0xbf00; /* NOP encoding T1 */ +- md_number_to_chars (buf, newval, THUMB_SIZE); ++ if (fixP->fx_done || !seg->use_rela_p) ++ { ++ newval = md_chars_to_number (buf, THUMB_SIZE); ++ newval = 0xbf00; /* NOP encoding T1 */ ++ md_number_to_chars (buf, newval, THUMB_SIZE); ++ } + } + else + { +@@ -28631,17 +28634,14 @@ md_apply_fix (fixS * fixP, + case BFD_RELOC_ARM_GOTFUNCDESC: + case BFD_RELOC_ARM_GOTOFFFUNCDESC: + case BFD_RELOC_ARM_FUNCDESC: +- if (arm_fdpic) +- { +- if (fixP->fx_done || !seg->use_rela_p) +- md_number_to_chars (buf, 0, 4); +- } +- else ++ if (!arm_fdpic) + { + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Relocation supported only in FDPIC mode")); +- } +- break; ++ break; ++ } ++ value = 0; ++ /* Fall through. */ + #endif + + case BFD_RELOC_RVA: +diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c +--- binutils.orig/gas/config/tc-arm.c 2020-07-24 12:16:02.099719884 +0100 ++++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:34:17.690858328 +0100 +@@ -28641,7 +28641,7 @@ md_apply_fix (fixS * fixP, + break; + } + value = 0; +- /* Fall through. */ ++ goto fred; + #endif + + case BFD_RELOC_RVA: +@@ -28653,6 +28653,7 @@ md_apply_fix (fixS * fixP, + #ifdef TE_PE + case BFD_RELOC_32_SECREL: + #endif ++ fred: + if (fixP->fx_done || !seg->use_rela_p) + #ifdef TE_WINCE + /* For WinCE we only do this for pcrel fixups. */ +diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c +--- binutils.orig/gas/config/tc-arm.c 2020-07-24 13:28:26.926553452 +0100 ++++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 13:31:57.835215763 +0100 +@@ -28416,12 +28416,8 @@ md_apply_fix (fixS * fixP, + perform relaxation. */ + if (value == -2) + { +- if (fixP->fx_done || !seg->use_rela_p) +- { +- newval = md_chars_to_number (buf, THUMB_SIZE); +- newval = 0xbf00; /* NOP encoding T1 */ +- md_number_to_chars (buf, newval, THUMB_SIZE); +- } ++ newval = 0xbf00; /* NOP encoding T1 */ ++ goto jim; + } + else + { +@@ -28432,6 +28428,7 @@ md_apply_fix (fixS * fixP, + { + newval = md_chars_to_number (buf, THUMB_SIZE); + newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3); ++ jim: + md_number_to_chars (buf, newval, THUMB_SIZE); + } + } +diff -rup binutils.orig/binutils/mclex.c binutils-2.34.0/binutils/mclex.c +--- binutils.orig/binutils/mclex.c 2020-07-24 13:28:26.297557441 +0100 ++++ binutils-2.34.0/binutils/mclex.c 2020-07-24 14:46:53.587940149 +0100 +@@ -207,7 +207,7 @@ enum_severity (int e) + static void + mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv) + { +- unichar *usz, *usv = NULL; ++ unichar *usz = NULL, *usv = NULL; + rc_uint_type usz_len; + + unicode_from_codepage (&usz_len, &usz, sz, CP_ACP); +diff -rup binutils.orig/binutils/windmc.c binutils-2.34.0/binutils/windmc.c +--- binutils.orig/binutils/windmc.c 2020-07-24 13:28:26.279557556 +0100 ++++ binutils-2.34.0/binutils/windmc.c 2020-07-24 14:48:05.460477478 +0100 +@@ -338,7 +338,7 @@ mc_add_node_lang (mc_node *root, const m + static char * + convert_unicode_to_ACP (const unichar *usz) + { +- char *s; ++ char *s = NULL; + rc_uint_type l; + + if (! usz) +@@ -607,10 +607,10 @@ mc_generate_bin_item (mc_node_lang *n, r + else + { + rc_uint_type txt_len, l; +- char *cvt_txt; ++ char *cvt_txt = NULL; + + codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp); +- if (! cvt_txt) ++ if (cvt_txt == NULL) + fatal ("Failed to convert message to language codepage.\n"); + txt_len = strlen (cvt_txt); + if (mcset_automatic_null_termination && txt_len > 0) +@@ -1107,7 +1107,7 @@ main (int argc, char **argv) + + /* Load the input file and do code page transformations to UTF16. */ + { +- unichar *u; ++ unichar *u = NULL; + rc_uint_type ul; + char *buff; + bfd_size_type flen; +--- binutils.orig/binutils/srconv.c 2020-07-24 15:37:25.847459208 +0100 ++++ binutils-2.34.0/binutils/srconv.c 2020-07-24 15:39:12.853773423 +0100 +@@ -316,6 +316,7 @@ wr_hd (struct coff_ofile *p) + struct IT_hd hd; + + hd.spare1 = 0; ++ hd.spare2 = 0; + if (bfd_get_file_flags (abfd) & EXEC_P) + hd.mt = MTYPE_ABS_LM; + else diff --git a/SOURCES/binutils-gold-gnu-properties.patch b/SOURCES/binutils-gold-gnu-properties.patch new file mode 100644 index 0000000..3af9cc2 --- /dev/null +++ b/SOURCES/binutils-gold-gnu-properties.patch @@ -0,0 +1,181 @@ +diff -rup binutils.orig/gold/testsuite/gnu_property_a.S binutils-2.35/gold/testsuite/gnu_property_a.S +--- binutils.orig/gold/testsuite/gnu_property_a.S 2021-01-18 14:01:41.228809868 +0000 ++++ binutils-2.35/gold/testsuite/gnu_property_a.S 2021-01-18 14:01:52.542736705 +0000 +@@ -1,8 +1,8 @@ + #define NT_GNU_PROPERTY_TYPE_0 5 + + #define GNU_PROPERTY_STACK_SIZE 1 +-#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 +-#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001 ++#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002 ++#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002 + #define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 + + #if __SIZEOF_PTRDIFF_T__ == 8 +diff -rup binutils.orig/gold/testsuite/gnu_property_b.S binutils-2.35/gold/testsuite/gnu_property_b.S +--- binutils.orig/gold/testsuite/gnu_property_b.S 2021-01-18 14:01:41.233809836 +0000 ++++ binutils-2.35/gold/testsuite/gnu_property_b.S 2021-01-18 14:01:52.542736705 +0000 +@@ -2,8 +2,8 @@ + + #define GNU_PROPERTY_STACK_SIZE 1 + #define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 +-#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 +-#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001 ++#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002 ++#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002 + #define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 + + #if __SIZEOF_PTRDIFF_T__ == 8 +diff -rup binutils.orig/gold/testsuite/gnu_property_c.S binutils-2.35/gold/testsuite/gnu_property_c.S +--- binutils.orig/gold/testsuite/gnu_property_c.S 2021-01-18 14:01:41.232809843 +0000 ++++ binutils-2.35/gold/testsuite/gnu_property_c.S 2021-01-18 14:01:52.542736705 +0000 +@@ -2,8 +2,8 @@ + + #define GNU_PROPERTY_STACK_SIZE 1 + #define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 +-#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 +-#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001 ++#define GNU_PROPERTY_X86_ISA_1_USED 0xc0010002 ++#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0008002 + #define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 + + #if __SIZEOF_PTRDIFF_T__ == 8 +diff -rup binutils.orig/gold/testsuite/gnu_property_test.sh binutils-2.35/gold/testsuite/gnu_property_test.sh +--- binutils.orig/gold/testsuite/gnu_property_test.sh 2021-01-18 14:01:41.236809817 +0000 ++++ binutils-2.35/gold/testsuite/gnu_property_test.sh 2021-01-18 14:01:52.543736699 +0000 +@@ -57,8 +57,8 @@ check_count gnu_property_test.stdout "GN + + check gnu_property_test.stdout "stack size: 0x111100" + check gnu_property_test.stdout "no copy on protected" +-check gnu_property_test.stdout "x86 ISA used: i486, SSE2, SSE4_2, AVX512CD" +-check gnu_property_test.stdout "x86 ISA needed: i486, SSE2, SSE4_2, AVX512CD" ++check gnu_property_test.stdout "x86 ISA used: x86-64-v2, , , " ++check gnu_property_test.stdout "x86 ISA needed: x86-64-v2, , , " + check gnu_property_test.stdout "x86 feature: IBT" + + exit 0 +diff -rup binutils.orig/gold/x86_64.cc binutils-2.35/gold/x86_64.cc +--- binutils.orig/gold/x86_64.cc 2021-01-18 14:01:41.225809888 +0000 ++++ binutils-2.35/gold/x86_64.cc 2021-01-18 14:01:52.543736699 +0000 +@@ -706,8 +706,9 @@ class Target_x86_64 : public Sized_targe + rela_irelative_(NULL), copy_relocs_(elfcpp::R_X86_64_COPY), + got_mod_index_offset_(-1U), tlsdesc_reloc_info_(), + tls_base_symbol_defined_(false), isa_1_used_(0), isa_1_needed_(0), +- feature_1_(0), object_isa_1_used_(0), object_feature_1_(0), +- seen_first_object_(false) ++ feature_1_(0), feature_2_used_(0), feature_2_needed_(0), ++ object_isa_1_used_(0), object_feature_1_(0), ++ object_feature_2_used_(0), seen_first_object_(false) + { } + + // Hook for a new output section. +@@ -1382,6 +1383,8 @@ class Target_x86_64 : public Sized_targe + uint32_t isa_1_used_; + uint32_t isa_1_needed_; + uint32_t feature_1_; ++ uint32_t feature_2_used_; ++ uint32_t feature_2_needed_; + // Target-specific properties from the current object. + // These bits get ORed into ISA_1_USED_ after all properties for the object + // have been processed. But if either is all zeroes (as when the property +@@ -1391,6 +1394,7 @@ class Target_x86_64 : public Sized_targe + // These bits get ANDed into FEATURE_1_ after all properties for the object + // have been processed. + uint32_t object_feature_1_; ++ uint32_t object_feature_2_used_; + // Whether we have seen our first object, for use in initializing FEATURE_1_. + bool seen_first_object_; + }; +@@ -1594,9 +1598,15 @@ Target_x86_64::record_gnu_property + + switch (pr_type) + { ++ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_USED: ++ case elfcpp::GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED: ++ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED: ++ case elfcpp::GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED: + case elfcpp::GNU_PROPERTY_X86_ISA_1_USED: + case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED: + case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND: ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED: ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED: + if (pr_datasz != 4) + { + gold_warning(_("%s: corrupt .note.gnu.property section " +@@ -1625,6 +1635,12 @@ Target_x86_64::record_gnu_property + // If we see multiple feature props in one object, OR them together. + this->object_feature_1_ |= val; + break; ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED: ++ this->object_feature_2_used_ |= val; ++ break; ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED: ++ this->feature_2_needed_ |= val; ++ break; + } + } + +@@ -1642,15 +1658,23 @@ Target_x86_64::merge_gnu_propertie + else if (this->isa_1_used_ != 0) + this->isa_1_used_ |= this->object_isa_1_used_; + this->feature_1_ &= this->object_feature_1_; ++ // If any object is missing the FEATURE_2_USED property, we must ++ // omit it from the output file. ++ if (this->object_feature_2_used_ == 0) ++ this->feature_2_used_ = 0; ++ else if (this->feature_2_used_ != 0) ++ this->feature_2_used_ |= this->object_feature_2_used_; + } + else + { + this->isa_1_used_ = this->object_isa_1_used_; + this->feature_1_ = this->object_feature_1_; ++ this->feature_2_used_ = this->object_feature_2_used_; + this->seen_first_object_ = true; + } + this->object_isa_1_used_ = 0; + this->object_feature_1_ = 0; ++ this->object_feature_2_used_ = 0; + } + + static inline void +@@ -1676,6 +1700,12 @@ Target_x86_64::do_finalize_gnu_pro + if (this->feature_1_ != 0) + add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND, + this->feature_1_); ++ if (this->feature_2_used_ != 0) ++ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_USED, ++ this->feature_2_used_); ++ if (this->feature_2_needed_ != 0) ++ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_2_NEEDED, ++ this->feature_2_needed_); + } + + // Write the first three reserved words of the .got.plt section. +--- binutils.orig/elfcpp/elfcpp.h 2021-01-18 14:01:40.778812778 +0000 ++++ binutils-2.35/elfcpp/elfcpp.h 2021-01-18 14:50:05.144035077 +0000 +@@ -1009,9 +1009,21 @@ enum + GNU_PROPERTY_STACK_SIZE = 1, + GNU_PROPERTY_NO_COPY_ON_PROTECTED = 2, + GNU_PROPERTY_LOPROC = 0xc0000000, +- GNU_PROPERTY_X86_ISA_1_USED = 0xc0000000, +- GNU_PROPERTY_X86_ISA_1_NEEDED = 0xc0000001, +- GNU_PROPERTY_X86_FEATURE_1_AND = 0xc0000002, ++ GNU_PROPERTY_X86_COMPAT_ISA_1_USED = 0xc0000000, ++ GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED = 0xc0000001, ++ GNU_PROPERTY_X86_UINT32_AND_LO = 0xc0000002, ++ GNU_PROPERTY_X86_UINT32_AND_HI = 0xc0007fff, ++ GNU_PROPERTY_X86_UINT32_OR_LO = 0xc0008000, ++ GNU_PROPERTY_X86_UINT32_OR_HI = 0xc000ffff, ++ GNU_PROPERTY_X86_UINT32_OR_AND_LO = 0xc0010000, ++ GNU_PROPERTY_X86_UINT32_OR_AND_HI = 0xc0017fff, ++ GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 0, ++ GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 0, ++ GNU_PROPERTY_X86_FEATURE_1_AND = GNU_PROPERTY_X86_UINT32_AND_LO + 0, ++ GNU_PROPERTY_X86_ISA_1_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 2, ++ GNU_PROPERTY_X86_FEATURE_2_NEEDED = GNU_PROPERTY_X86_UINT32_OR_LO + 1, ++ GNU_PROPERTY_X86_ISA_1_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 2, ++ GNU_PROPERTY_X86_FEATURE_2_USED = GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1, + GNU_PROPERTY_HIPROC = 0xdfffffff, + GNU_PROPERTY_LOUSER = 0xe0000000, + GNU_PROPERTY_HIUSER = 0xffffffff diff --git a/SOURCES/binutils-gold-mismatched-section-flags.patch b/SOURCES/binutils-gold-mismatched-section-flags.patch new file mode 100644 index 0000000..63dba2b --- /dev/null +++ b/SOURCES/binutils-gold-mismatched-section-flags.patch @@ -0,0 +1,19 @@ +diff -rup binutils.orig/gold/layout.cc binutils-2.32/gold/layout.cc +--- binutils.orig/gold/layout.cc 2019-06-24 14:37:36.013086899 +0100 ++++ binutils-2.32/gold/layout.cc 2019-06-24 14:41:40.054517479 +0100 +@@ -868,6 +868,7 @@ Layout::get_output_section(const char* n + && (same_name->flags() & elfcpp::SHF_TLS) == 0) + os = same_name; + } ++#if 0 /* BZ 1722715, PR 17556. */ + else if ((flags & elfcpp::SHF_TLS) == 0) + { + elfcpp::Elf_Xword zero_flags = 0; +@@ -878,6 +879,7 @@ Layout::get_output_section(const char* n + if (p != this->section_name_map_.end()) + os = p->second; + } ++#endif + } + + if (os == NULL) diff --git a/SOURCES/binutils-gold-warn-unsupported.patch b/SOURCES/binutils-gold-warn-unsupported.patch new file mode 100644 index 0000000..8e00aa3 --- /dev/null +++ b/SOURCES/binutils-gold-warn-unsupported.patch @@ -0,0 +1,66 @@ +Only in binutils-2.34/gold: autom4te.cache +diff -rup binutils.orig/gold/configure binutils-2.34/gold/configure +--- binutils.orig/gold/configure 2020-04-20 12:35:13.048297305 +0100 ++++ binutils-2.34/gold/configure 2020-04-20 14:02:06.743725696 +0100 +@@ -5180,7 +5180,8 @@ for targ in $target $canon_targets; do + . ${srcdir}/configure.tgt + + if test "$targ_obj" = "UNKNOWN"; then +- as_fn_error $? "\"unsupported target $targ\"" "$LINENO" 5 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"unsupported target $targ\"" >&5 ++$as_echo "$as_me: WARNING: \"unsupported target $targ\"" >&2;} + else + targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)" + if test "$targ_extra_obj" != ""; then +diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac +--- binutils.orig/gold/configure.ac 2020-04-20 12:35:13.050297291 +0100 ++++ binutils-2.34/gold/configure.ac 2020-04-20 14:01:46.435868770 +0100 +@@ -181,7 +181,7 @@ for targ in $target $canon_targets; do + . ${srcdir}/configure.tgt + + if test "$targ_obj" = "UNKNOWN"; then +- AC_MSG_ERROR("unsupported target $targ") ++ AC_MSG_WARN("unsupported target $targ") + else + targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)" + if test "$targ_extra_obj" != ""; then +--- binutils.orig/ld/configure.tgt 2020-04-20 12:35:12.465301359 +0100 ++++ binutils-2.34/ld/configure.tgt 2020-04-20 14:17:52.123066333 +0100 +@@ -220,7 +220,7 @@ bfin-*-linux-uclibc*) targ_emul=elf32bfi + targ_extra_emuls="elf32bfin" + targ_extra_libpath=$targ_extra_emuls + ;; +-bpf-*-*) targ_emul=elf64bpf ++bpf-* | bpf-*-*) targ_emul=elf64bpf + ;; + cr16-*-elf*) targ_emul=elf32cr16 + ;; +@@ -1026,7 +1026,7 @@ z8k-*-coff) targ_emul=z8002 + targ_extra_ofiles= + ;; + *) +- echo 2>&1 "*** ld does not support target ${targ}" ++ echo 2>&1 "*** ld does not support target '${targ}' NO REALLY" + echo 2>&1 "*** see ld/configure.tgt for supported targets" + exit 1 + +--- binutils.orig/bfd/config.bfd 2020-04-20 12:35:13.038297375 +0100 ++++ binutils-2.34/bfd/config.bfd 2020-04-20 14:25:26.452869193 +0100 +@@ -473,7 +473,7 @@ case "${targ}" in + ;; + + #ifdef BFD64 +- bpf-*-none) ++ bpf-*-none | bpf-*) + targ_defvec=bpf_elf64_le_vec + targ_selvecs=bpf_elf64_be_vec + targ_underscore=yes +@@ -1427,7 +1427,7 @@ case "${targ}" in + ;; + + *) +- echo 1>&2 "*** BFD does not support target ${targ}." ++ echo 1>&2 "*** BFD does not support target '${targ}'. Honest." + echo 1>&2 "*** Look in bfd/config.bfd for supported targets." + exit 1 + ;; diff --git a/SOURCES/binutils-ld-DWARF-5-sections.patch b/SOURCES/binutils-ld-DWARF-5-sections.patch new file mode 100644 index 0000000..60d4224 --- /dev/null +++ b/SOURCES/binutils-ld-DWARF-5-sections.patch @@ -0,0 +1,60 @@ +--- binutils.orig/ld/scripttempl/DWARF.sc 2021-02-01 10:29:33.596729908 +0000 ++++ binutils-2.35.1/ld/scripttempl/DWARF.sc 2021-02-01 10:30:00.454552083 +0000 +@@ -1,4 +1,4 @@ +-# Copyright (C) 2014-2020 Free Software Foundation, Inc. ++# Copyright (C) 2014-2021 Free Software Foundation, Inc. + # + # Copying and distribution of this file, with or without modification, + # are permitted in any medium without royalty provided the copyright +@@ -9,19 +9,19 @@ cat <root.table.entsize; + if (h->root.type == bfd_link_hash_warning) +- entsize += htab->root.table.entsize; ++ { ++ entsize += htab->root.table.entsize; ++ h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ } ++ if (h->root.type == bfd_link_hash_common) ++ entsize += sizeof (*h->root.u.c.p); + } + } + +@@ -4521,14 +4526,20 @@ elf_link_add_object_symbols (bfd *abfd, + + for (p = htab->root.table.table[i]; p != NULL; p = p->next) + { +- memcpy (old_ent, p, htab->root.table.entsize); +- old_ent = (char *) old_ent + htab->root.table.entsize; + h = (struct elf_link_hash_entry *) p; ++ memcpy (old_ent, h, htab->root.table.entsize); ++ old_ent = (char *) old_ent + htab->root.table.entsize; + if (h->root.type == bfd_link_hash_warning) + { +- memcpy (old_ent, h->root.u.i.link, htab->root.table.entsize); ++ h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ memcpy (old_ent, h, htab->root.table.entsize); + old_ent = (char *) old_ent + htab->root.table.entsize; + } ++ if (h->root.type == bfd_link_hash_common) ++ { ++ memcpy (old_ent, h->root.u.c.p, sizeof (*h->root.u.c.p)); ++ old_ent = (char *) old_ent + sizeof (*h->root.u.c.p); ++ } + } + } + } +@@ -4899,7 +4910,8 @@ elf_link_add_object_symbols (bfd *abfd, + } + + if (! (_bfd_generic_link_add_one_symbol +- (info, abfd, name, flags, sec, value, NULL, FALSE, bed->collect, ++ (info, abfd, name, flags, sec, value, ++ NULL, FALSE, bed->collect, + (struct bfd_link_hash_entry **) sym_hash))) + goto error_free_vers; + +@@ -4970,11 +4982,10 @@ elf_link_add_object_symbols (bfd *abfd, + object and a shared object. */ + bfd_boolean dynsym = FALSE; + +- /* Plugin symbols aren't normal. Don't set def_regular or +- ref_regular for them, or make them dynamic. */ ++ /* Plugin symbols aren't normal. Don't set def/ref flags. */ + if ((abfd->flags & BFD_PLUGIN) != 0) + ; +- else if (! dynamic) ++ else if (!dynamic) + { + if (! definition) + { +@@ -4991,14 +5002,6 @@ elf_link_add_object_symbols (bfd *abfd, + h->ref_dynamic = 1; + } + } +- +- /* If the indirect symbol has been forced local, don't +- make the real symbol dynamic. */ +- if ((h == hi || !hi->forced_local) +- && (bfd_link_dll (info) +- || h->def_dynamic +- || h->ref_dynamic)) +- dynsym = TRUE; + } + else + { +@@ -5012,14 +5015,25 @@ elf_link_add_object_symbols (bfd *abfd, + h->def_dynamic = 1; + hi->def_dynamic = 1; + } ++ } + +- /* If the indirect symbol has been forced local, don't +- make the real symbol dynamic. */ +- if ((h == hi || !hi->forced_local) +- && (h->def_regular +- || h->ref_regular +- || (h->is_weakalias +- && weakdef (h)->dynindx != -1))) ++ /* If an indirect symbol has been forced local, don't ++ make the real symbol dynamic. */ ++ if (h != hi && hi->forced_local) ++ ; ++ else if (!dynamic) ++ { ++ if (bfd_link_dll (info) ++ || h->def_dynamic ++ || h->ref_dynamic) ++ dynsym = TRUE; ++ } ++ else ++ { ++ if (h->def_regular ++ || h->ref_regular ++ || (h->is_weakalias ++ && weakdef (h)->dynindx != -1)) + dynsym = TRUE; + } + +@@ -5214,6 +5228,9 @@ elf_link_add_object_symbols (bfd *abfd, + && definition + && ((dynsym + && h->ref_regular_nonweak) ++ || (old_bfd != NULL ++ && (old_bfd->flags & BFD_PLUGIN) != 0 ++ && bind != STB_WEAK) + || (h->ref_dynamic_nonweak + && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0 + && !on_needed_list (elf_dt_name (abfd), +@@ -5338,49 +5355,31 @@ elf_link_add_object_symbols (bfd *abfd, + { + struct bfd_hash_entry *p; + struct elf_link_hash_entry *h; +- bfd_size_type size; +- unsigned int alignment_power; + unsigned int non_ir_ref_dynamic; + + for (p = htab->root.table.table[i]; p != NULL; p = p->next) + { +- h = (struct elf_link_hash_entry *) p; +- if (h->root.type == bfd_link_hash_warning) +- h = (struct elf_link_hash_entry *) h->root.u.i.link; +- +- /* Preserve the maximum alignment and size for common +- symbols even if this dynamic lib isn't on DT_NEEDED +- since it can still be loaded at run time by another +- dynamic lib. */ +- if (h->root.type == bfd_link_hash_common) +- { +- size = h->root.u.c.size; +- alignment_power = h->root.u.c.p->alignment_power; +- } +- else +- { +- size = 0; +- alignment_power = 0; +- } + /* Preserve non_ir_ref_dynamic so that this symbol + will be exported when the dynamic lib becomes needed + in the second pass. */ ++ h = (struct elf_link_hash_entry *) p; ++ if (h->root.type == bfd_link_hash_warning) ++ h = (struct elf_link_hash_entry *) h->root.u.i.link; + non_ir_ref_dynamic = h->root.non_ir_ref_dynamic; +- memcpy (p, old_ent, htab->root.table.entsize); +- old_ent = (char *) old_ent + htab->root.table.entsize; ++ + h = (struct elf_link_hash_entry *) p; ++ memcpy (h, old_ent, htab->root.table.entsize); ++ old_ent = (char *) old_ent + htab->root.table.entsize; + if (h->root.type == bfd_link_hash_warning) + { +- memcpy (h->root.u.i.link, old_ent, htab->root.table.entsize); +- old_ent = (char *) old_ent + htab->root.table.entsize; + h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ memcpy (h, old_ent, htab->root.table.entsize); ++ old_ent = (char *) old_ent + htab->root.table.entsize; + } + if (h->root.type == bfd_link_hash_common) + { +- if (size > h->root.u.c.size) +- h->root.u.c.size = size; +- if (alignment_power > h->root.u.c.p->alignment_power) +- h->root.u.c.p->alignment_power = alignment_power; ++ memcpy (h->root.u.c.p, old_ent, sizeof (*h->root.u.c.p)); ++ old_ent = (char *) old_ent + sizeof (*h->root.u.c.p); + } + h->root.non_ir_ref_dynamic = non_ir_ref_dynamic; + } diff --git a/SOURCES/binutils-ppc-annobin-disassembly.patch b/SOURCES/binutils-ppc-annobin-disassembly.patch new file mode 100644 index 0000000..dd054a6 --- /dev/null +++ b/SOURCES/binutils-ppc-annobin-disassembly.patch @@ -0,0 +1,39 @@ +--- binutils.orig/opcodes/ppc-dis.c 2020-09-11 10:55:56.243724026 +0100 ++++ binutils-2.35/opcodes/ppc-dis.c 2020-09-11 10:57:51.363934217 +0100 +@@ -399,12 +399,36 @@ static unsigned short vle_opcd_indices[V + #define SPE2_OPCD_SEGS (1 + SPE2_XOP_TO_SEG (SPE2_XOP (-1))) + static unsigned short spe2_opcd_indices[SPE2_OPCD_SEGS + 1]; + ++static bfd_boolean ++ppc_symbol_is_valid (asymbol *sym, ++ struct disassemble_info *info ATTRIBUTE_UNUSED) ++{ ++ elf_symbol_type * est; ++ ++ if (sym == NULL) ++ return FALSE; ++ ++ est = elf_symbol_from (NULL, sym); ++ ++ /* Ignore ELF hidden, local, no-type symbols. ++ These are generated by annobin. */ ++ if (est != NULL ++ && ELF_ST_VISIBILITY (est->internal_elf_sym.st_other) == STV_HIDDEN ++ && ELF_ST_BIND (est->internal_elf_sym.st_info) == STB_LOCAL ++ && ELF_ST_TYPE (est->internal_elf_sym.st_info) == STT_NOTYPE) ++ return FALSE; ++ ++ return TRUE; ++} ++ + /* Calculate opcode table indices to speed up disassembly, + and init dialect. */ + + void + disassemble_init_powerpc (struct disassemble_info *info) + { ++ info->symbol_is_valid = ppc_symbol_is_valid; ++ + if (powerpc_opcd_indices[PPC_OPCD_SEGS] == 0) + { + unsigned seg, idx, op; diff --git a/SOURCES/binutils-ppc64le-note-merge.patch b/SOURCES/binutils-ppc64le-note-merge.patch new file mode 100644 index 0000000..95f6401 --- /dev/null +++ b/SOURCES/binutils-ppc64le-note-merge.patch @@ -0,0 +1,42 @@ +--- binutils.orig/binutils/objcopy.c 2021-02-18 11:35:48.062479490 +0000 ++++ binutils-2.30/binutils/objcopy.c 2021-02-18 11:36:52.207071148 +0000 +@@ -2224,6 +2224,11 @@ merge_gnu_build_notes (bfd * ab + goto done; + } + ++ if (start > end) ++ /* This can happen with PPC64LE binaries where empty notes are ++ encoded as start = end + 4. */ ++ start = end; ++ + if (is_open_note (pnote)) + { + if (start) +--- binutils.orig/binutils/objcopy.c 2021-02-22 10:44:20.107263089 +0000 ++++ binutils-2.35.1/binutils/objcopy.c 2021-02-22 16:07:12.134344229 +0000 +@@ -2243,23 +2243,8 @@ merge_gnu_build_notes (bfd * ab + break; + + case 8: +- if (! is_64bit (abfd)) +- { +- start = bfd_get_32 (abfd, pnote->note.descdata); +- end = bfd_get_32 (abfd, pnote->note.descdata + 4); +- } +- else +- { +- start = bfd_get_64 (abfd, pnote->note.descdata); +- /* FIXME: For version 1 and 2 notes we should try to +- calculate the end address by finding a symbol whose +- value is START, and then adding in its size. +- +- For now though, since v1 and v2 was not intended to +- handle gaps, we chose an artificially large end +- address. */ +- end = (bfd_vma) -1; +- } ++ start = bfd_get_32 (abfd, pnote->note.descdata); ++ end = bfd_get_32 (abfd, pnote->note.descdata + 4); + break; + + case 16: diff --git a/SOURCES/binutils-readelf-no-warn-gaps.patch b/SOURCES/binutils-readelf-no-warn-gaps.patch new file mode 100644 index 0000000..2bcd0c6 --- /dev/null +++ b/SOURCES/binutils-readelf-no-warn-gaps.patch @@ -0,0 +1,19 @@ +--- binutils.orig/binutils/readelf.c 2021-02-22 10:44:20.142262864 +0000 ++++ binutils-2.35.1/binutils/readelf.c 2021-02-22 10:45:25.646842120 +0000 +@@ -19285,6 +19285,7 @@ print_gnu_build_attribute_description (E + + if (is_open_attr) + { ++#if 0 /* Suppressed because these gaps are no longer significant. */ + /* FIXME: Need to properly allow for section alignment. + 16 is just the alignment used on x86_64. */ + if (global_end > 0 +@@ -19295,7 +19296,7 @@ print_gnu_build_attribute_description (E + && same_section (filedata, start, global_end)) + warn (_("Gap in build notes detected from %#lx to %#lx\n"), + global_end + 1, start - 1); +- ++#endif + printf (_(" Applies to region from %#lx"), start); + global_offset = start; + diff --git a/SOURCES/binutils-readelf-other-sym-info.patch b/SOURCES/binutils-readelf-other-sym-info.patch new file mode 100644 index 0000000..72913ba --- /dev/null +++ b/SOURCES/binutils-readelf-other-sym-info.patch @@ -0,0 +1,35 @@ +--- binutils.orig/binutils/readelf.c 2020-07-24 15:08:30.317597020 +0100 ++++ binutils-2.35/binutils/readelf.c 2020-07-24 15:09:39.029155552 +0100 +@@ -12069,11 +12069,13 @@ print_dynamic_symbol (Filedata *filedata + unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); + + printf (" %-7s", get_symbol_visibility (vis)); ++#if 0 + /* Check to see if any other bits in the st_other field are set. + Note - displaying this information disrupts the layout of the + table being generated, but for the moment this case is very rare. */ + if (psym->st_other ^ vis) + printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis)); ++#endif + } + printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx)); + +@@ -12112,7 +12114,17 @@ print_dynamic_symbol (Filedata *filedata + version_string); + } + +- putchar ('\n'); ++#if 1 ++ { ++ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); ++ ++ /* Check to see if any other bits in the st_other field are set. */ ++ if (psym->st_other ^ vis) ++ printf (" \t[%s]", get_symbol_other (filedata, psym->st_other ^ vis)); ++ } ++#endif ++ ++ putchar ('\n'); + + if (ELF_ST_BIND (psym->st_info) == STB_LOCAL + && section != NULL diff --git a/SOURCES/binutils-recursive-debuglink-following.patch b/SOURCES/binutils-recursive-debuglink-following.patch new file mode 100644 index 0000000..b230bcf --- /dev/null +++ b/SOURCES/binutils-recursive-debuglink-following.patch @@ -0,0 +1,109 @@ +--- binutils.orig/binutils/dwarf.c 2020-10-15 12:13:21.960799738 +0100 ++++ binutils-2.35.1/binutils/dwarf.c 2020-10-15 13:02:39.454692627 +0100 +@@ -10427,7 +10427,7 @@ load_separate_debug_info (const char * + { + warn (_("Corrupt debuglink section: %s\n"), + xlink->name ? xlink->name : xlink->uncompressed_name); +- return FALSE; ++ return NULL; + } + + /* Attempt to locate the separate file. +@@ -10587,7 +10587,7 @@ load_separate_debug_info (const char * + { + warn (_("failed to open separate debug file: %s\n"), debug_filename); + free (debug_filename); +- return FALSE; ++ return NULL; + } + + /* FIXME: We do not check to see if there are any other separate debug info +@@ -10632,6 +10632,52 @@ load_dwo_file (const char * main_filenam + return separate_handle; + } + ++/* Load a debuglink section and/or a debugaltlink section, if either are present. ++ Recursively check the loaded files for more of these sections. ++ FIXME: Should also check for DWO_* entries in the newlu loaded files. */ ++ ++static void ++check_for_and_load_links (void * file, const char * filename) ++{ ++ void * handle = NULL; ++ ++ if (load_debug_section (gnu_debugaltlink, file)) ++ { ++ Build_id_data build_id_data; ++ ++ handle = load_separate_debug_info (filename, ++ & debug_displays[gnu_debugaltlink].section, ++ parse_gnu_debugaltlink, ++ check_gnu_debugaltlink, ++ & build_id_data, ++ file); ++ if (handle) ++ { ++ assert (handle == first_separate_info->handle); ++ check_for_and_load_links (first_separate_info->handle, ++ first_separate_info->filename); ++ } ++ } ++ ++ if (load_debug_section (gnu_debuglink, file)) ++ { ++ unsigned long crc32; ++ ++ handle = load_separate_debug_info (filename, ++ & debug_displays[gnu_debuglink].section, ++ parse_gnu_debuglink, ++ check_gnu_debuglink, ++ & crc32, ++ file); ++ if (handle) ++ { ++ assert (handle == first_separate_info->handle); ++ check_for_and_load_links (first_separate_info->handle, ++ first_separate_info->filename); ++ } ++ } ++} ++ + /* Load the separate debug info file(s) attached to FILE, if any exist. + Returns TRUE if any were found, FALSE otherwise. + If TRUE is returned then the linked list starting at first_separate_info +@@ -10707,34 +10753,10 @@ load_separate_debug_files (void * file, + return FALSE; + + /* FIXME: We do not check for the presence of both link sections in the same file. */ +- /* FIXME: We do not check the separate debug info file to see if it too contains debuglinks. */ + /* FIXME: We do not check for the presence of multiple, same-name debuglink sections. */ + /* FIXME: We do not check for the presence of a dwo link as well as a debuglink. */ + +- if (load_debug_section (gnu_debugaltlink, file)) +- { +- Build_id_data * build_id_data; +- +- load_separate_debug_info (filename, +- & debug_displays[gnu_debugaltlink].section, +- parse_gnu_debugaltlink, +- check_gnu_debugaltlink, +- & build_id_data, +- file); +- } +- +- if (load_debug_section (gnu_debuglink, file)) +- { +- unsigned long crc32; +- +- load_separate_debug_info (filename, +- & debug_displays[gnu_debuglink].section, +- parse_gnu_debuglink, +- check_gnu_debuglink, +- & crc32, +- file); +- } +- ++ check_for_and_load_links (file, filename); + if (first_separate_info != NULL) + return TRUE; + diff --git a/SOURCES/binutils-s390-arch14-insns.patch b/SOURCES/binutils-s390-arch14-insns.patch new file mode 100644 index 0000000..f0b4174 --- /dev/null +++ b/SOURCES/binutils-s390-arch14-insns.patch @@ -0,0 +1,109 @@ +diff -rup binutils.orig/gas/config/tc-s390.c binutils-2.35.1/gas/config/tc-s390.c +--- binutils.orig/gas/config/tc-s390.c 2021-02-19 11:44:24.240877612 +0000 ++++ binutils-2.35.1/gas/config/tc-s390.c 2021-02-19 11:46:05.222554434 +0000 +@@ -292,6 +292,8 @@ s390_parse_cpu (const char * arg + { STRING_COMMA_LEN ("z14"), STRING_COMMA_LEN ("arch12"), + S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, + { STRING_COMMA_LEN ("z15"), STRING_COMMA_LEN ("arch13"), ++ S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, ++ { STRING_COMMA_LEN (""), STRING_COMMA_LEN ("arch14"), + S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX } + }; + static struct +diff -rup binutils.orig/gas/doc/c-s390.texi binutils-2.35.1/gas/doc/c-s390.texi +--- binutils.orig/gas/doc/c-s390.texi 2021-02-19 11:44:24.236877625 +0000 ++++ binutils-2.35.1/gas/doc/c-s390.texi 2021-02-19 11:46:05.223554431 +0000 +@@ -18,7 +18,7 @@ and eleven chip levels. The architecture + Architecture (ESA) and the newer z/Architecture mode. The chip levels + are g5 (or arch3), g6, z900 (or arch5), z990 (or arch6), z9-109, z9-ec + (or arch7), z10 (or arch8), z196 (or arch9), zEC12 (or arch10), z13 +-(or arch11), z14 (or arch12), and z15 (or arch13). ++(or arch11), z14 (or arch12), z15 (or arch13), or arch14. + + @menu + * s390 Options:: Command-line Options. +@@ -70,8 +70,9 @@ are recognized: + @code{z196} (or @code{arch9}), + @code{zEC12} (or @code{arch10}), + @code{z13} (or @code{arch11}), +-@code{z14} (or @code{arch12}), and +-@code{z15} (or @code{arch13}). ++@code{z14} (or @code{arch12}), ++@code{z15} (or @code{arch13}), and ++@code{arch14}. + + Assembling an instruction that is not supported on the target + processor results in an error message. +diff -rup binutils.orig/gas/testsuite/gas/s390/s390.exp binutils-2.35.1/gas/testsuite/gas/s390/s390.exp +--- binutils.orig/gas/testsuite/gas/s390/s390.exp 2021-02-19 11:44:24.338877299 +0000 ++++ binutils-2.35.1/gas/testsuite/gas/s390/s390.exp 2021-02-19 11:46:05.223554431 +0000 +@@ -31,6 +31,7 @@ if [expr [istarget "s390-*-*"] || [ista + run_dump_test "zarch-z13" "{as -m64} {as -march=z13}" + run_dump_test "zarch-arch12" "{as -m64} {as -march=arch12}" + run_dump_test "zarch-arch13" "{as -m64} {as -march=arch13}" ++ run_dump_test "zarch-arch14" "{as -m64} {as -march=arch14}" + run_dump_test "zarch-reloc" "{as -m64}" + run_dump_test "zarch-operands" "{as -m64} {as -march=z9-109}" + run_dump_test "zarch-machine" "{as -m64} {as -march=z900}" +Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.d +Only in binutils-2.35.1/gas/testsuite/gas/s390: zarch-arch14.s +diff -rup binutils.orig/include/opcode/s390.h binutils-2.35.1/include/opcode/s390.h +--- binutils.orig/include/opcode/s390.h 2021-02-19 11:44:23.926878617 +0000 ++++ binutils-2.35.1/include/opcode/s390.h 2021-02-19 11:46:05.223554431 +0000 +@@ -44,6 +44,7 @@ enum s390_opcode_cpu_val + S390_OPCODE_Z13, + S390_OPCODE_ARCH12, + S390_OPCODE_ARCH13, ++ S390_OPCODE_ARCH14, + S390_OPCODE_MAXCPU + }; + +diff -rup binutils.orig/opcodes/s390-mkopc.c binutils-2.35.1/opcodes/s390-mkopc.c +--- binutils.orig/opcodes/s390-mkopc.c 2021-02-19 11:44:23.947878550 +0000 ++++ binutils-2.35.1/opcodes/s390-mkopc.c 2021-02-19 11:46:05.223554431 +0000 +@@ -380,6 +380,8 @@ main (void) + else if (strcmp (cpu_string, "z15") == 0 + || strcmp (cpu_string, "arch13") == 0) + min_cpu = S390_OPCODE_ARCH13; ++ else if (strcmp (cpu_string, "arch14") == 0) ++ min_cpu = S390_OPCODE_ARCH14; + else { + fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string); + exit (1); +Only in binutils-2.35.1/opcodes: s390-mkopc.c.orig +diff -rup binutils.orig/opcodes/s390-opc.txt binutils-2.35.1/opcodes/s390-opc.txt +--- binutils.orig/opcodes/s390-opc.txt 2021-02-19 11:44:23.943878563 +0000 ++++ binutils-2.35.1/opcodes/s390-opc.txt 2021-02-19 11:46:05.224554428 +0000 +@@ -2000,3 +2000,31 @@ e60000000052 vcvbg VRR_RV0UU "vector con + # Message Security Assist Extension 9 + + b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch ++ ++ ++# arch14 instructions ++ ++e60000000074 vschp VRR_VVV0U0U " " arch14 zarch ++e60000002074 vschsp VRR_VVV0U0 " " arch14 zarch ++e60000003074 vschdp VRR_VVV0U0 " " arch14 zarch ++e60000004074 vschxp VRR_VVV0U0 " " arch14 zarch ++e6000000007c vscshp VRR_VVV " " arch14 zarch ++e6000000007d vcsph VRR_VVV0U0 " " arch14 zarch ++e60000000051 vclzdp VRR_VV0U2 " " arch14 zarch ++e60000000070 vpkzr VRI_VVV0UU2 " " arch14 zarch ++e60000000072 vsrpr VRI_VVV0UU2 " " arch14 zarch ++e60000000054 vupkzh VRR_VV0U2 " " arch14 zarch ++e6000000005c vupkzl VRR_VV0U2 " " arch14 zarch ++ ++b93b nnpa RRE_00 " " arch14 zarch ++e60000000056 vclfnh VRR_VV0UU2 " " arch14 zarch ++e6000000005e vclfnl VRR_VV0UU2 " " arch14 zarch ++e60000000075 vcrnf VRR_VVV0UU " " arch14 zarch ++e6000000005d vcfn VRR_VV0UU2 " " arch14 zarch ++e60000000055 vcnf VRR_VV0UU2 " " arch14 zarch ++ ++b98B rdp RRF_RURR2 " " arch14 zarch optparm ++ ++eb0000000071 lpswey SIY_URD " " arch14 zarch ++b200 lbear S_RD " " arch14 zarch ++b201 stbear S_RD " " arch14 zarch +Only in binutils-2.35.1/opcodes: s390-opc.txt.orig diff --git a/SOURCES/binutils-s390-build.patch b/SOURCES/binutils-s390-build.patch new file mode 100644 index 0000000..cdb6a5d --- /dev/null +++ b/SOURCES/binutils-s390-build.patch @@ -0,0 +1,772 @@ +diff -rup binutils.orig/libctf/ctf-create.c binutils-2.34.0/libctf/ctf-create.c +--- binutils.orig/libctf/ctf-create.c 2020-06-16 12:06:28.466468753 +0100 ++++ binutils-2.34.0/libctf/ctf-create.c 2020-06-16 12:16:19.744482839 +0100 +@@ -871,7 +871,8 @@ ctf_add_encoded (ctf_file_t *fp, uint32_ + + if ((type = ctf_add_generic (fp, flag, name, kind, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ +- ++ if (dtd == NULL) ++ return CTF_ERR; + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, flag, 0); + dtd->dtd_data.ctt_size = clp2 (P2ROUNDUP (ep->cte_bits, CHAR_BIT) + / CHAR_BIT); +@@ -896,6 +897,8 @@ ctf_add_reftype (ctf_file_t *fp, uint32_ + + if ((type = ctf_add_generic (fp, flag, NULL, kind, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (kind, flag, 0); + dtd->dtd_data.ctt_type = (uint32_t) ref; +@@ -958,6 +961,8 @@ ctf_add_slice (ctf_file_t *fp, uint32_t + + if ((type = ctf_add_generic (fp, flag, NULL, CTF_K_SLICE, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_SLICE, flag, 0); + dtd->dtd_data.ctt_size = clp2 (P2ROUNDUP (ep->cte_bits, CHAR_BIT) +@@ -1008,6 +1013,8 @@ ctf_add_array (ctf_file_t *fp, uint32_t + + if ((type = ctf_add_generic (fp, flag, NULL, CTF_K_ARRAY, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_ARRAY, flag, 0); + dtd->dtd_data.ctt_size = 0; +@@ -1075,6 +1082,8 @@ ctf_add_function (ctf_file_t *fp, uint32 + free (vdat); + return CTF_ERR; /* errno is set for us. */ + } ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_FUNCTION, flag, vlen); + dtd->dtd_data.ctt_type = (uint32_t) ctc->ctc_return; +@@ -1104,6 +1113,8 @@ ctf_add_struct_sized (ctf_file_t *fp, ui + else if ((type = ctf_add_generic (fp, flag, name, CTF_K_STRUCT, + &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_STRUCT, flag, 0); + +@@ -1141,6 +1152,8 @@ ctf_add_union_sized (ctf_file_t *fp, uin + else if ((type = ctf_add_generic (fp, flag, name, CTF_K_UNION, + &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_UNION, flag, 0); + +@@ -1177,6 +1190,8 @@ ctf_add_enum (ctf_file_t *fp, uint32_t f + else if ((type = ctf_add_generic (fp, flag, name, CTF_K_ENUM, + &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_ENUM, flag, 0); + dtd->dtd_data.ctt_size = fp->ctf_dmodel->ctd_int; +diff -rup binutils.orig/libctf/ctf-types.c binutils-2.34.0/libctf/ctf-types.c +--- binutils.orig/libctf/ctf-types.c 2020-06-16 12:06:28.466468753 +0100 ++++ binutils-2.34.0/libctf/ctf-types.c 2020-06-16 12:10:58.033563365 +0100 +@@ -748,7 +748,7 @@ ctf_type_encoding (ctf_file_t *fp, ctf_i + case CTF_K_SLICE: + { + const ctf_slice_t *slice; +- ctf_encoding_t underlying_en; ++ ctf_encoding_t underlying_en = {0}; + slice = &dtd->dtd_u.dtu_slice; + + data = ctf_type_encoding (fp, slice->cts_type, &underlying_en); +diff -rup binutils.orig/opcodes/s390-mkopc.c binutils-2.34.0/opcodes/s390-mkopc.c +--- binutils.orig/opcodes/s390-mkopc.c 2020-06-16 12:06:28.447468816 +0100 ++++ binutils-2.34.0/opcodes/s390-mkopc.c 2020-06-16 12:17:10.783311417 +0100 +@@ -168,7 +168,7 @@ insertExpandedMnemonic (char *opcode, ch + int mask_start, i = 0, tag_found = 0, reading_number = 0; + int number_p = 0, suffix_p = 0, prefix_p = 0; + const struct s390_cond_ext_format *ext_table; +- int ext_table_length; ++ int ext_table_length = 0; + + if (!(tag = strpbrk (mnemonic, "*$"))) + { +Only in binutils.orig/libctf: .#ctf-create.c +diff -rup binutils.orig/libctf/ctf-create.c binutils-2.34.0/libctf/ctf-create.c +--- binutils.orig/libctf/ctf-create.c 2020-06-16 14:49:06.080801319 +0100 ++++ binutils-2.34.0/libctf/ctf-create.c 2020-06-16 14:49:08.046794113 +0100 +@@ -798,6 +798,7 @@ ctf_add_generic (ctf_file_t *fp, uint32_ + { + ctf_dtdef_t *dtd; + ctf_id_t type; ++ *rp = NULL; + + if (flag != CTF_ADD_NONROOT && flag != CTF_ADD_ROOT) + return (ctf_set_errno (fp, EINVAL)); +diff -rup binutils.orig/opcodes/fr30-ibld.c binutils-2.34.0/opcodes/fr30-ibld.c +--- binutils.orig/opcodes/fr30-ibld.c 2020-06-16 14:49:06.074801341 +0100 ++++ binutils-2.34.0/opcodes/fr30-ibld.c 2020-06-16 16:43:31.428324833 +0100 +@@ -810,7 +810,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_DIR10 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value); + value = ((value) << (2)); + fields->f_dir10 = value; +@@ -821,7 +821,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_DIR9 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value); + value = ((value) << (1)); + fields->f_dir9 = value; +@@ -829,7 +829,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_DISP10 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_disp10 = value; +@@ -840,7 +840,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_DISP9 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_disp9 = value; +@@ -865,7 +865,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_LABEL12 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_rel12 = value; +@@ -873,7 +873,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_LABEL9 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_rel9 = value; +@@ -881,7 +881,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_M4 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 16, total_length, pc, & value); + value = ((value) | (-16)); + fields->f_m4 = value; +@@ -911,7 +911,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_U10 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 16, total_length, pc, & value); + value = ((value) << (2)); + fields->f_u10 = value; +@@ -928,7 +928,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_UDISP6 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 16, total_length, pc, & value); + value = ((value) << (2)); + fields->f_udisp6 = value; + +diff -rup binutils.orig/opcodes/fr30-ibld.c binutils-2.34.0/opcodes/fr30-ibld.c +--- binutils.orig/opcodes/fr30-ibld.c 2020-06-16 17:10:22.540563440 +0100 ++++ binutils-2.34.0/opcodes/fr30-ibld.c 2020-06-16 17:10:48.966468906 +0100 +@@ -903,7 +903,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC + break; + case FR30_OPERAND_S10 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_s10 = value; +Only in binutils-2.34.0/opcodes: fr30-ibld.c~ +--- binutils.orig/opcodes/m32c-ibld.c 2020-06-16 17:10:22.531563472 +0100 ++++ binutils-2.34.0/opcodes/m32c-ibld.c 2020-06-16 17:25:48.612258094 +0100 +@@ -1805,7 +1805,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_BIT32RNPREFIXED : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_dst32_rn_prefixed_QI = value; +@@ -1813,7 +1813,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_BIT32RNUNPREFIXED : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_dst32_rn_unprefixed_QI = value; +@@ -1824,7 +1824,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_BITBASE16_16_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -1860,7 +1860,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_16_s16 = value; +@@ -1887,7 +1887,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -1903,7 +1903,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -1971,7 +1971,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -1996,7 +1996,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_16_S16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_16_s16 = value; +@@ -2007,7 +2007,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_16_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -2016,7 +2016,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_DSP_16_U20 : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -2032,7 +2032,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_DSP_16_U24 : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; +@@ -2078,7 +2078,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -2094,7 +2094,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -2110,7 +2110,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_32_S16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_32_s16 = value; +@@ -2121,7 +2121,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_32_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -2129,7 +2129,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_32_U20 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_32_u24 = value; +@@ -2137,7 +2137,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_32_U24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_32_u24 = value; +@@ -2148,7 +2148,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_40_S16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_40_s16 = value; +@@ -2159,7 +2159,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_40_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_40_u16 = value; +@@ -2167,7 +2167,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_40_U20 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 20, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (983040)))); + fields->f_dsp_40_u20 = value; +@@ -2175,7 +2175,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_40_U24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_40_u24 = value; +@@ -2186,7 +2186,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_48_S16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_48_s16 = value; +@@ -2197,7 +2197,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_48_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_48_u16 = value; +@@ -2206,7 +2206,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_DSP_48_U20 : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_48_u16 = value; +@@ -2222,7 +2222,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_DSP_48_U24 : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_48_u16 = value; +@@ -2240,7 +2240,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_8_S24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (16))) & (255))) | (((value) & (65280))))) | (((((value) & (255))) << (16))))) ^ (8388608))) - (8388608)); + fields->f_dsp_8_s24 = value; +@@ -2251,7 +2251,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_8_U16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_8_u16 = value; +@@ -2259,7 +2259,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DSP_8_U24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 24, 32, total_length, pc, & value); + value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16)))); + fields->f_dsp_8_u24 = value; +@@ -2343,7 +2343,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNPREFIXEDHI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value); + value = ((((value) + (2))) % (4)); + fields->f_dst32_rn_prefixed_HI = value; +@@ -2351,7 +2351,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNPREFIXEDQI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_dst32_rn_prefixed_QI = value; +@@ -2359,7 +2359,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNPREFIXEDSI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value); + value = ((value) - (2)); + fields->f_dst32_rn_prefixed_SI = value; +@@ -2367,7 +2367,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNUNPREFIXEDHI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value); + value = ((((value) + (2))) % (4)); + fields->f_dst32_rn_unprefixed_HI = value; +@@ -2375,7 +2375,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNUNPREFIXEDQI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_dst32_rn_unprefixed_QI = value; +@@ -2383,7 +2383,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_DST32RNUNPREFIXEDSI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value); + value = ((value) - (2)); + fields->f_dst32_rn_unprefixed_SI = value; +@@ -2402,7 +2402,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_16_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_16_s16 = value; +@@ -2414,14 +2414,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_IMM_16_SI : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_16_u16 = value; + } + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_32_u16 = value; +@@ -2454,7 +2454,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8); + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_32_u24 = value; +@@ -2467,7 +2467,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_32_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_32_s16 = value; +@@ -2486,7 +2486,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_40_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_40_s16 = value; +@@ -2498,7 +2498,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_IMM_40_SI : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value); + value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680)))); + fields->f_dsp_40_u24 = value; +@@ -2513,7 +2513,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_48_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_48_s16 = value; +@@ -2525,14 +2525,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + case M32C_OPERAND_IMM_48_SI : + { + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_48_u16 = value; + } + if (length <= 0) break; + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 16, 32, total_length, pc, & value); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); + fields->f_dsp_64_u16 = value; +@@ -2567,7 +2567,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM_8_HI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) & (255))) << (8))))))); + fields->f_dsp_8_s16 = value; +@@ -2593,7 +2593,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_IMM1_S : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 1, 32, total_length, pc, & value); + value = ((value) + (1)); + fields->f_imm1_S = value; +@@ -2612,7 +2612,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_16_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_16_8 = value; +@@ -2620,7 +2620,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_24_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_24_8 = value; +@@ -2628,7 +2628,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_32_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_32_8 = value; +@@ -2636,7 +2636,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_40_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_40_8 = value; +@@ -2644,7 +2644,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_5_3 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_5_3 = value; +@@ -2652,7 +2652,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_8_16 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) | (((((value) & (255))) << (8))))) ^ (32768))) - (32768))) + (((pc) + (1)))); + fields->f_lab_8_16 = value; +@@ -2660,7 +2660,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_8_24 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16)))); + fields->f_lab_8_24 = value; +@@ -2668,7 +2668,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_LAB_8_8 : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lab_8_8 = value; +@@ -2757,7 +2757,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNPREFIXEDHI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value); + value = ((((value) + (2))) % (4)); + fields->f_src32_rn_prefixed_HI = value; +@@ -2765,7 +2765,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNPREFIXEDQI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_src32_rn_prefixed_QI = value; +@@ -2773,7 +2773,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNPREFIXEDSI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value); + value = ((value) - (2)); + fields->f_src32_rn_prefixed_SI = value; +@@ -2781,7 +2781,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNUNPREFIXEDHI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value); + value = ((((value) + (2))) % (4)); + fields->f_src32_rn_unprefixed_HI = value; +@@ -2789,7 +2789,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNUNPREFIXEDQI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value); + value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2)))); + fields->f_src32_rn_unprefixed_QI = value; +@@ -2797,7 +2797,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC + break; + case M32C_OPERAND_SRC32RNUNPREFIXEDSI : + { +- long value; ++ long value = 0; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value); + value = ((value) - (2)); + fields->f_src32_rn_unprefixed_SI = value; +--- binutils.orig/binutils/srconv.c 2020-06-16 17:10:22.251564474 +0100 ++++ binutils-2.34.0/binutils/srconv.c 2020-06-16 20:07:51.670025912 +0100 +@@ -492,6 +492,8 @@ wr_rl (struct coff_ofile *ptr ATTRIBUTE_ + rl.addr = r->offset; + rl.bitloc = 0; + rl.flen = 32; /* SH Specific. */ ++ rl.dunno = 0; ++ rl.symn = 0; + + /* What sort of reloc ? Look in the section to find out. */ + ref = r->symbol; +--- binutils.orig/libctf/ctf-create.c 2020-07-24 15:33:26.100996335 +0100 ++++ binutils-2.35/libctf/ctf-create.c 2020-07-24 15:33:29.042977475 +0100 +@@ -1257,6 +1257,8 @@ ctf_add_forward (ctf_file_t *fp, uint32_ + + if ((type = ctf_add_generic (fp, flag, name, kind, &dtd)) == CTF_ERR) + return CTF_ERR; /* errno is set for us. */ ++ if (dtd == NULL) ++ return CTF_ERR; + + dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_FORWARD, flag, 0); + dtd->dtd_data.ctt_type = kind; diff --git a/SOURCES/binutils-special-sections-in-groups.patch b/SOURCES/binutils-special-sections-in-groups.patch new file mode 100644 index 0000000..7de5a93 --- /dev/null +++ b/SOURCES/binutils-special-sections-in-groups.patch @@ -0,0 +1,27 @@ +--- binutils.orig/bfd/elf.c 2018-10-19 11:42:10.107277490 +0100 ++++ binutils-2.31.1/bfd/elf.c 2018-10-19 11:44:33.607105801 +0100 +@@ -830,7 +830,13 @@ setup_group (bfd *abfd, Elf_Internal_Shd + } + } + +- if (elf_group_name (newsect) == NULL) ++ if (elf_group_name (newsect) == NULL ++ /* OS specific sections might be in a group (eg ARM's ARM_EXIDX section) ++ but they will not have been added to the group because they do not ++ have contents that the ELF code in the BFD library knows how to ++ process. This is OK though - we rely upon the target backends to ++ handle these sections for us. */ ++ && hdr->sh_type < SHT_LOOS) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: no group info for section '%pA'"), +@@ -936,7 +942,8 @@ _bfd_elf_setup_sections (bfd *abfd) + else if (idx->shdr->bfd_section) + elf_sec_group (idx->shdr->bfd_section) = shdr->bfd_section; + else if (idx->shdr->sh_type != SHT_RELA +- && idx->shdr->sh_type != SHT_REL) ++ && idx->shdr->sh_type != SHT_REL ++ && idx->shdr->sh_type < SHT_LOOS) + { + /* There are some unknown sections in the group. */ + _bfd_error_handler diff --git a/SOURCES/binutils-strip-merge.patch b/SOURCES/binutils-strip-merge.patch new file mode 100644 index 0000000..2453685 --- /dev/null +++ b/SOURCES/binutils-strip-merge.patch @@ -0,0 +1,19 @@ +--- binutils.orig/binutils/objcopy.c 2020-10-06 14:53:19.264943750 +0100 ++++ binutils-2.35.1/binutils/objcopy.c 2020-10-06 14:53:47.002761889 +0100 +@@ -3313,14 +3313,12 @@ copy_object (bfd *ibfd, bfd *obfd, const + /* It is likely that output sections are in the same order + as the input sections, but do not assume that this is + the case. */ +- if (strcmp (bfd_section_name (merged->sec), +- bfd_section_name (osec)) != 0) ++ if (merged->sec->output_section != osec) + { + for (merged = merged_note_sections; + merged != NULL; + merged = merged->next) +- if (strcmp (bfd_section_name (merged->sec), +- bfd_section_name (osec)) == 0) ++ if (merged->sec->output_section == osec) + break; + + if (merged == NULL) diff --git a/SOURCES/binutils-testsuite-failures.patch b/SOURCES/binutils-testsuite-failures.patch new file mode 100644 index 0000000..6d5ab06 --- /dev/null +++ b/SOURCES/binutils-testsuite-failures.patch @@ -0,0 +1,1207 @@ +diff -rup binutils.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp +--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2021-01-25 13:10:09.919340409 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp 2021-01-25 13:45:30.991238686 +0000 +@@ -319,21 +319,6 @@ set lto_link_elf_tests [list \ + [list "PR ld/13244" \ + "-shared -O2 -fPIC -flto -fuse-linker-plugin -nostdlib" "-O2 -fno-early-inlining -flto" \ + {pr13244.c} {{"readelf" {-s --wide} "pr13244.d"}} "pr13244.so" "c"] \ +- [list "Build libpr15146a.a" \ +- "$plug_opt" "-flto -O2" \ +- {pr15146a.c} {} "lib15146a.a"] \ +- [list "Build pr15146b.so" \ +- "-shared" "-O2 -fpic" \ +- {pr15146b.c} {} "pr15146b.so" "c"] \ +- [list "Build pr15146c.so" \ +- "-shared -Wl,--no-as-needed tmpdir/pr15146b.so" "-O2 -fpic" \ +- {pr15146c.c} {} "pr15146c.so" "c"] \ +- [list "PR ld/15146 (1)" \ +- "-O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146a.o tmpdir/pr15146c.so" "" \ +- {dummy.c} {{"readelf" {-d} "pr15146.d"}} "pr15146a.exe"] \ +- [list "Build libpr15146d.a" \ +- "$plug_opt" "-flto -O2" \ +- {pr15146d.c} {} "lib15146d.a"] \ + [list "Build libpr16746a.a" \ + "" "" \ + {pr16746a.c pr16746b.c} {} "lib15146a.a"] \ +@@ -602,13 +587,6 @@ run_cc_link_tests $lto_compile_elf_tests + # Restrict these to ELF targets that support shared libs and PIC. + if { [is_elf_format] && [check_lto_shared_available] } { + run_cc_link_tests $lto_link_elf_tests +- set testname "PR ld/15146 (2)" +- set exec_output [run_host_cmd "$CC" "-O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146d.o tmpdir/pr15146c.so"] +- if { [ regexp "undefined reference to symbol '\\.?xxx'" $exec_output ] } { +- pass $testname +- } { +- fail $testname +- } + set testname "PR ld/16746 (3)" + set exec_output [run_host_cmd "$CC" "-O2 -flto -fuse-linker-plugin tmpdir/pr16746b.o tmpdir/pr16746d.o"] + if { [ regexp "warning: \\.?foobar" $exec_output ] && ![ regexp "symbol from plugin" $exec_output ] } { +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-10.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-10.d 2021-01-25 13:10:09.918340415 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-10.d 2021-01-25 14:23:58.847765488 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-11.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-11.d 2021-01-25 13:10:09.922340387 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-11.d 2021-01-25 14:23:53.518803590 +0000 +@@ -35,9 +35,9 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?text' Resolution: LDPR_PREVAILING_DE.* + #... + hook called: cleanup. + #... +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-16.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-16.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-16.d 2021-01-25 13:10:09.921340394 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-16.d 2021-01-25 14:24:11.182677282 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-17.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-17.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-17.d 2021-01-25 13:10:09.919340409 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-17.d 2021-01-25 14:24:05.502717894 +0000 +@@ -31,7 +31,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-18.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-18.d 2021-01-25 13:10:09.920340401 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-18.d 2021-01-25 14:23:47.294848091 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-19.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-19.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-19.d 2021-01-25 13:10:09.918340415 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-19.d 2021-01-25 14:23:38.270912619 +0000 +@@ -35,9 +35,9 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?text' Resolution: LDPR_PREVAILING_DE.* + #... + hook called: cleanup. + #... +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-8.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-8.d 2021-01-25 13:10:09.920340401 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-8.d 2021-01-25 14:24:20.558610232 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-9.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-9.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-9.d 2021-01-25 13:10:09.922340387 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-9.d 2021-01-25 14:24:15.919643406 +0000 +@@ -31,7 +31,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-elf/shared.exp binutils-2.35.1/ld/testsuite/ld-elf/shared.exp +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-01-25 13:10:09.984339946 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/shared.exp 2021-01-25 15:16:59.161012214 +0000 +@@ -681,13 +681,13 @@ set build_tests { + "-r -nostdlib" "" + {pr11138-2.c} {} "libpr11138-2.o"} + {"Build pr13250-1.so" +- "-shared" "-fPIC -fcommon" ++ "-shared" "-fPIC" + {pr13250-1.c} {} "libpr13250-1.so"} + {"Build pr13250-2.so with libpr13250-1.so" +- "-shared -Wl,--no-as-needed tmpdir/libpr13250-1.so" "-fPIC -fcommon" ++ "-shared -Wl,--no-as-needed tmpdir/libpr13250-1.so" "-fPIC" + {pr13250-2.c} {} "libpr13250-2.so"} + {"Build libpr13250-3.o" +- "-r -nostdlib" "-fcommon" ++ "-r -nostdlib" "-fPIC" + {pr13250-3.c} {} "libpr13250-3.o"} + {"Build libpr14323-2.so" + "-shared" "-fPIC -fcommon" +@@ -968,9 +968,6 @@ set run_tests [list \ + [list "Run with libpr11138-1.so pr11138-2.c" \ + "-Wl,--no-as-needed,--version-script=pr11138-2.map tmpdir/libpr11138-1.so tmpdir/pr11138-2.o" "" \ + {dummy.c} "pr11138b" "pr11138.out" ] \ +- [list "Run with pr13250-3.c, libpr13250-1.so and libpr13250-2.so" \ +- "-Wl,--as-needed tmpdir/pr13250-3.o tmpdir/libpr13250-1.so tmpdir/libpr13250-2.so" "-fcommon" \ +- {dummy.c} "pr13250" "pass.out" ] \ + [list "Run with pr14323-1.c pr14323-2.so" \ + "-Wl,--no-as-needed tmpdir/libpr14323-2.so" "" \ + {pr14323-1.c} "pr14323" "pass.out" ] \ +--- binutils.orig/ld/testsuite/ld-elf/compress.exp 2021-01-25 13:10:09.986339932 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/compress.exp 2021-01-25 15:22:33.286619802 +0000 +@@ -87,7 +87,7 @@ set build_tests { + set run_tests { + {"Run normal with libfoo.so with compressed debug sections" + "tmpdir/begin.o tmpdir/libfoo.so tmpdir/end.o" "" +- {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections"} ++ {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections -fno-lto"} + {"Run normal with libfoozlib.so with compressed debug sections with zlib-gabi" + "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o" "" + {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} +diff -rup binutils.orig/ld/testsuite/ld-elf/compress.exp binutils-2.35.1/ld/testsuite/ld-elf/compress.exp +--- binutils.orig/ld/testsuite/ld-elf/compress.exp 2021-01-25 16:01:54.985710205 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/compress.exp 2021-01-25 16:14:50.481150777 +0000 +@@ -90,25 +90,25 @@ set run_tests { + {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections -fno-lto"} + {"Run normal with libfoozlib.so with compressed debug sections with zlib-gabi" + "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o" "" +- {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} ++ {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + {"Run zlibnormal with libzlibfoo.so with zlib compressed debug sections" + "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" +- {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib"} ++ {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib -fno-lto"} + {"Run zlibnormal with libfoozlib.so with zlib compressed debug sections" + "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" +- {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib"} ++ {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib -fno-lto"} + {"Run gnunormal with libgnufoo.so with zlib-gnu compressed debug sections" + "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" +- {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu"} ++ {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu -fno-lto"} + {"Run gnunormal with libfoozlib.so with zlib-gnu compressed debug sections" + "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" +- {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu"} ++ {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu -fno-lto"} + {"Run gabinormal with libgabifoo.so with zlib-gabi compressed debug sections" + "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" +- {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} ++ {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + {"Run gabinormal with libfoozlib.so with zlib-gabi compressed debug sections" + "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" +- {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi"} ++ {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + } + + run_cc_link_tests $build_tests +diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf.exp binutils-2.35.1/ld/testsuite/ld-elf/dwarf.exp +--- binutils.orig/ld/testsuite/ld-elf/dwarf.exp 2021-01-25 16:01:54.982710227 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/dwarf.exp 2021-01-25 16:19:59.198936623 +0000 +@@ -53,7 +53,7 @@ set build_tests { + "" "-fno-toplevel-reorder" + {dwarf2a.c dwarf2b.c} {{error_output "dwarf2.err"}} "dwarf2.x"} + {"Handle no DWARF information" +- "" "-g0" ++ "" "-g0 -fno-lto" + {dwarf3.c} {{error_output "dwarf3.err"}} "dwarf3.x"} + } + +diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf2b.c binutils-2.35.1/ld/testsuite/ld-elf/dwarf2b.c +--- binutils.orig/ld/testsuite/ld-elf/dwarf2b.c 2021-01-25 16:01:54.980710241 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/dwarf2b.c 2021-01-25 16:18:11.598708346 +0000 +@@ -1,5 +1,5 @@ +-int global_var = 4; +-int other_var = 2; ++extern int global_var; ++extern int other_var; + + extern int function (void); + +diff -rup binutils.orig/ld/testsuite/ld-elf/indirect.exp binutils-2.35.1/ld/testsuite/ld-elf/indirect.exp +--- binutils.orig/ld/testsuite/ld-elf/indirect.exp 2021-01-25 16:01:54.983710220 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/indirect.exp 2021-01-25 16:28:09.254420519 +0000 +@@ -140,52 +140,52 @@ set run_tests { + "-Wl,--no-as-needed tmpdir/libindirect3c.so tmpdir/indirect3b.o tmpdir/indirect3a.o" "" + {dummy.c} "indirect3d" "indirect3.out"} + {"Run with libindirect4c.so 1" +- "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/indirect4b.o tmpdir/libindirect4c.so" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/indirect4a.o tmpdir/indirect4b.o tmpdir/libindirect4c.so" "" + {dummy.c} "indirect4a" "indirect4.out"} + {"Run with libindirect4c.so 2" +- "-Wl,--no-as-needed tmpdir/indirect4a.o tmpdir/libindirect4c.so tmpdir/indirect4b.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/indirect4a.o tmpdir/libindirect4c.so tmpdir/indirect4b.o" "" + {dummy.c} "indirect4b" "indirect4.out"} + {"Run with libindirect4c.so 3" +- "-Wl,--no-as-needed tmpdir/indirect4b.o tmpdir/libindirect4c.so tmpdir/indirect4a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/indirect4b.o tmpdir/libindirect4c.so tmpdir/indirect4a.o" "" + {dummy.c} "indirect4c" "indirect4.out"} + {"Run with libindirect4c.so 4" +- "-Wl,--no-as-needed tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" "" + {dummy.c} "indirect4d" "indirect4.out"} + {"Run indirect5 1" +- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" ++ "$NOPIE_LDFLAGS -fno-lto -Wl,--no-as-needed tmpdir/libindirect5.so" "" + {indirect5a.c} "indirect5a" "indirect5.out" "$NOPIE_CFLAGS"} + {"Run indirect5 2" +- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" ++ "$NOPIE_LDFLAGS -fno-lto -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" + {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"} + {"Run indirect6 1" +- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" ++ "$NOPIE_LDFLAGS -fno-lto -Wl,--no-as-needed tmpdir/libindirect5.so" "" + {indirect6a.c} "indirect6a" "indirect5.out" "$NOPIE_CFLAGS"} + {"Run indirect6 2" +- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect6a.o tmpdir/libindirect5.so" "" ++ "$NOPIE_LDFLAGS -fno-lto -Wl,--no-as-needed tmpdir/indirect6a.o tmpdir/libindirect5.so" "" + {dummy.c} "indirect6b" "indirect5.out" "$NOPIE_CFLAGS"} + {"Run with libpr18720c.so 1" +- "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/pr18720b.o tmpdir/libpr18720c.so" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/pr18720a.o tmpdir/pr18720b.o tmpdir/libpr18720c.so" "" + {check-ptr-eq.c} "pr18720a" "pr18720.out"} + {"Run with libpr18720c.so 2" +- "-Wl,--no-as-needed tmpdir/pr18720a.o tmpdir/libpr18720c.so tmpdir/pr18720b.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/pr18720a.o tmpdir/libpr18720c.so tmpdir/pr18720b.o" "" + {check-ptr-eq.c} "pr18720b" "pr18720.out"} + {"Run with libpr18720c.so 3" +- "-Wl,--no-as-needed tmpdir/pr18720b.o tmpdir/libpr18720c.so tmpdir/pr18720a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/pr18720b.o tmpdir/libpr18720c.so tmpdir/pr18720a.o" "" + {check-ptr-eq.c} "pr18720c" "pr18720.out"} + {"Run with libpr18720c.so 4" +- "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b.o tmpdir/pr18720a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr18720c.so tmpdir/pr18720b.o tmpdir/pr18720a.o" "" + {check-ptr-eq.c} "pr18720d" "pr18720.out"} + {"Run with libpr18720c.so 5" +- "-Wl,--no-as-needed tmpdir/libpr18720c.so tmpdir/pr18720b1.o tmpdir/pr18720a.o" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr18720c.so tmpdir/pr18720b1.o tmpdir/pr18720a.o" "" + {check-ptr-eq.c} "pr18720d" "pr18720.out"} + {"Run with libpr19553b.so" +- "-Wl,--no-as-needed tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." "" + {pr19553a.c} "pr19553b" "pr19553b.out"} + {"Run with libpr19553c.so" +- "-Wl,--no-as-needed tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" "" + {pr19553a.c} "pr19553c" "pr19553c.out"} + {"Run with libpr19553d.so" +- "-Wl,--no-as-needed tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." "" ++ "-Wl,--no-as-needed -fno-lto tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." "" + {pr19553a.c} "pr19553d" "pr19553d.out"} + } + +diff -rup binutils.orig/ld/testsuite/ld-elf/zlibbegin.rS binutils-2.35.1/ld/testsuite/ld-elf/zlibbegin.rS +--- binutils.orig/ld/testsuite/ld-elf/zlibbegin.rS 2021-01-25 16:01:54.983710220 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/zlibbegin.rS 2021-01-25 16:08:44.466775873 +0000 +@@ -1,3 +1,3 @@ + #... +- +\[[ 0-9]+\] .debug_.* +(PROGBITS|MIPS_DWARF) +0+ +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +G?C +0 +0 +1 ++ +\[[ 0-9]+\] .debug_.* +(PROGBITS|MIPS_DWARF) +0+ +[0-9a-f]+ +[0-9a-f]+ [0-9a-f]+ +G?? +0 +0 +1 + #pass +diff -rup binutils.orig/ld/testsuite/config/default.exp binutils-2.35.1/ld/testsuite/config/default.exp +--- binutils.orig/ld/testsuite/config/default.exp 2021-01-25 17:04:32.771699986 +0000 ++++ binutils-2.35.1/ld/testsuite/config/default.exp 2021-01-25 17:21:31.269352523 +0000 +@@ -83,13 +83,13 @@ if {![info exists CC]} { + set CC [find_gcc] + } + if {![info exists CFLAGS]} { +- set CFLAGS "-g -O2" ++ set CFLAGS "-g -O2 -fno-lto" + } + if {![info exists CXX]} { + set CXX [find_g++] + } + if {![info exists CXXFLAGS]} { +- set CXXFLAGS "" ++ set CXXFLAGS "-fno-lto" + } + + # This allows us to run the linker testsuite with clang as the compilation +diff -rup binutils.orig/ld/testsuite/ld-elf/compress.exp binutils-2.35.1/ld/testsuite/ld-elf/compress.exp +--- binutils.orig/ld/testsuite/ld-elf/compress.exp 2021-01-25 17:04:32.839699496 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/compress.exp 2021-01-25 17:06:40.106781907 +0000 +@@ -92,22 +92,22 @@ set run_tests { + "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o" "" + {main.c} "normal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + {"Run zlibnormal with libzlibfoo.so with zlib compressed debug sections" +- "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" ++ "tmpdir/begin.o tmpdir/libzlibfoo.so tmpdir/end.o -fno-lto -Wl,--compress-debug-sections=zlib" "" + {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib -fno-lto"} + {"Run zlibnormal with libfoozlib.so with zlib compressed debug sections" +- "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib" "" ++ "tmpdir/begin.o tmpdir/libfoozlib.so tmpdir/end.o -fno-lto -Wl,--compress-debug-sections=zlib" "" + {main.c} "zlibnormal" "normal.out" "-Wa,--compress-debug-sections=zlib -fno-lto"} + {"Run gnunormal with libgnufoo.so with zlib-gnu compressed debug sections" +- "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" ++ "tmpdir/gnubegin.o tmpdir/libgnufoo.so tmpdir/end.o -fno-lto -Wl,--compress-debug-sections=zlib-gnu" "" + {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu -fno-lto"} + {"Run gnunormal with libfoozlib.so with zlib-gnu compressed debug sections" +- "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o -Wl,--compress-debug-sections=zlib-gnu" "" ++ "tmpdir/gnubegin.o tmpdir/libfoozlib.so tmpdir/end.o -fno-lto -Wl,--compress-debug-sections=zlib-gnu" "" + {main.c} "gnunormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gnu -fno-lto"} + {"Run gabinormal with libgabifoo.so with zlib-gabi compressed debug sections" +- "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" ++ "tmpdir/zlibbegin.o tmpdir/libgabifoo.so tmpdir/gabiend.o -fno-lto -Wl,--compress-debug-sections=zlib-gabi" "" + {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + {"Run gabinormal with libfoozlib.so with zlib-gabi compressed debug sections" +- "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o -Wl,--compress-debug-sections=zlib-gabi" "" ++ "tmpdir/zlibbegin.o tmpdir/libfoozlib.so tmpdir/gabiend.o -fno-lto -Wl,--compress-debug-sections=zlib-gabi" "" + {main.c} "gabinormal" "normal.out" "-Wa,--compress-debug-sections=zlib-gabi -fno-lto"} + } + +diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf2b.c binutils-2.35.1/ld/testsuite/ld-elf/dwarf2b.c +--- binutils.orig/ld/testsuite/ld-elf/dwarf2b.c 2021-01-25 17:04:32.834699532 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/dwarf2b.c 2021-01-25 17:08:19.131067948 +0000 +@@ -1,5 +1,5 @@ +-extern int global_var; +-extern int other_var; ++int global_var = 4; ++int other_var = 2; + + extern int function (void); + +diff -rup binutils.orig/ld/testsuite/ld-elf/elf.exp binutils-2.35.1/ld/testsuite/ld-elf/elf.exp +--- binutils.orig/ld/testsuite/ld-elf/elf.exp 2021-01-25 17:04:32.840699489 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/elf.exp 2021-01-25 17:10:23.738169538 +0000 +@@ -245,7 +245,7 @@ if [check_gc_sections_available] { + + set array_tests { + {"preinit array" "" "" +- {preinit.c} "preinit" "preinit.out"} ++ {preinit.c} "preinit" "preinit.out" "-fno-lto"} + {"init array" "" "" + {init.c} "init" "init.out"} + {"fini array" "" "" +diff -rup binutils.orig/ld/testsuite/ld-elf/indirect.exp binutils-2.35.1/ld/testsuite/ld-elf/indirect.exp +--- binutils.orig/ld/testsuite/ld-elf/indirect.exp 2021-01-25 17:04:32.832699546 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/indirect.exp 2021-01-25 17:13:05.304004657 +0000 +@@ -65,8 +65,8 @@ if { ![ld_compile $CC $srcdir/$subdir/in + || ![ld_compile $CC $srcdir/$subdir/indirect3b.c tmpdir/indirect3b.o] + || ![ld_compile $CC $srcdir/$subdir/indirect4a.c tmpdir/indirect4a.o] + || ![ld_compile $CC $srcdir/$subdir/indirect4b.c tmpdir/indirect4b.o] +- || ![ld_compile "$CC -O2 -fPIC -I../bfd" $srcdir/$subdir/pr18720a.c tmpdir/pr18720a.o] +- || ![ld_compile $CC $srcdir/$subdir/pr18720b.c tmpdir/pr18720b.o] ++ || ![ld_compile "$CC -O2 -fPIC -I../bfd -fno-lto" $srcdir/$subdir/pr18720a.c tmpdir/pr18720a.o] ++ || ![ld_compile "$CC -fno-lto" $srcdir/$subdir/pr18720b.c tmpdir/pr18720b.o] + || ![ld_compile "$CC -fPIC" $srcdir/$subdir/pr19553d.c tmpdir/pr19553d.o] + || ![ld_compile "$CC -fPIC" $srcdir/$subdir/pr19553c.c tmpdir/pr19553c.o] + || ![ld_compile "$CC -fPIC" $srcdir/$subdir/pr19553b.c tmpdir/pr19553b.o] +@@ -89,7 +89,7 @@ set build_tests { + "-shared -Wl,--version-script=indirect5.map" "-fPIC" + {indirect5b.c} {} "libindirect5.so"} + {"Build libpr18720c.so" +- "-shared" "-fPIC" ++ "-shared" "-fPIC -fno-lto" + {pr18720c.c} {} "libpr18720c.so"} + {"Build pr18720b1.o" + "-r -nostdlib tmpdir/pr18720b.o" "" +diff -rup binutils.orig/ld/testsuite/ld-elf/shared.exp binutils-2.35.1/ld/testsuite/ld-elf/shared.exp +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-01-25 17:04:32.842699474 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/shared.exp 2021-01-25 17:17:38.919029918 +0000 +@@ -545,7 +545,7 @@ set build_tests { + "-shared" "-fPIC" + {beginwarn.c end.c} + {{readelf {-S --wide} libbarw.rd} +- {warning "^.*beginwarn.c:7: warning: function foo is deprecated\n?$"}} ++ {warning "^.*warning: function foo is deprecated\n?$"}} + "libbarw.so" "c"} + {"Build hidden libbar.so" + "-shared" "-fPIC" +--- binutils.orig/ld/testsuite/lib/ld-lib.exp 2021-01-26 10:25:58.126763900 +0000 ++++ binutils-2.35.1/ld/testsuite/lib/ld-lib.exp 2021-01-26 10:28:25.257232615 +0000 +@@ -898,9 +898,9 @@ proc run_cc_link_tests { ldtests } { + lappend objfiles $objfile + + if { [ string match "c++" $lang ] } { +- set cmd "$CXX -c $CXXFLAGS $cflags" ++ set cmd "$CXX -c $CXXFLAGS $cflags -fno-lto" + } else { +- set cmd "$CC -c $CFLAGS $cflags" ++ set cmd "$CC -c $CFLAGS $cflags -fno-lto" + } + if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] { + set failed 1 +--- binutils.orig/ld/testsuite/lib/ld-lib.exp 2021-01-26 13:39:56.515247329 +0000 ++++ binutils-2.35.1/ld/testsuite/lib/ld-lib.exp 2021-01-26 13:45:28.132976033 +0000 +@@ -259,7 +259,7 @@ proc default_ld_compile { cc source obje + append flags " [board_info [target_info name] multilib_flags]" + } + +- set cmd "$cc $flags $ccflags -c $source -o $object" ++ set cmd "$cc $flags $ccflags -c $source -o $object -fno-lto" + verbose -log "$cmd" + + set status [remote_exec host [concat sh -c [list "$cmd 2>&1"]] "" "/dev/null" "ld.tmp"] +@@ -713,9 +713,9 @@ proc run_ld_link_exec_tests { ldtests ar + lappend objfiles $objfile + + if { [ string match "c++" $lang ] } { +- set cmd "$CXX -c $CXXFLAGS $cflags" ++ set cmd "$CXX -c $CXXFLAGS $cflags -fno-lto" + } else { +- set cmd "$CC -c $CFLAGS $cflags" ++ set cmd "$CC -c $CFLAGS $cflags -fno-lto" + } + if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] { + set failed 1 +diff -rup binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-01-26 14:41:32.168525798 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp 2021-01-26 16:22:29.939007217 +0000 +@@ -635,7 +635,7 @@ run_cc_link_tests [list \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libpr23169a.so" \ + "-fPIE -O2 -g" \ + { pr23169b.c pr23169c.c } \ +- {{readelf {--dyn-syms} pr23169c.rd} \ ++ {{readelf {--dyn-syms} pr23169a.rd} \ + {readelf {-r -W} pr23169b.rd}} \ + "pr23169c" \ + ] \ +@@ -649,15 +649,6 @@ run_cc_link_tests [list \ + "pr23169d" \ + ] \ + [list \ +- "Build pr23169e" \ +- "-pie -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ +- "-fPIE -O2 -g" \ +- { pr23169b.c pr23169c.c } \ +- {{readelf {--dyn-syms} pr23169c.rd} \ +- {readelf {-r -W} pr23169b.rd}} \ +- "pr23169e" \ +- ] \ +- [list \ + "Build pr23169f" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ + "-fPIE -O2 -g" \ +@@ -769,15 +760,6 @@ run_ld_link_exec_tests [list \ + "$NOPIE_CFLAGS -O2 -g" \ + ] \ + [list \ +- "Run pr23169e" \ +- "-pie -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ +- "" \ +- { pr23169b.c pr23169c.c } \ +- "pr23169e" \ +- "pass.out" \ +- "-fPIE -O2 -g" \ +- ] \ +- [list \ + "Run pr23169f" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ + "" \ +diff -rup binutils.orig/ld/testsuite/ld-ifunc/pr23169a.c binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169a.c +--- binutils.orig/ld/testsuite/ld-ifunc/pr23169a.c 2021-01-26 14:41:32.168525798 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169a.c 2021-01-26 16:23:06.082881441 +0000 +@@ -4,6 +4,6 @@ extern int func (void); + void + foo (void) + { +- if (func_p != &func || func_p () != 0xbadbeef) ++ if (func () != 0xbadbeef || func_p () != 0xbadbeef) + __builtin_abort (); + } +diff -rup binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-01-26 16:58:22.846715071 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp 2021-01-26 16:59:43.476438410 +0000 +@@ -750,24 +750,6 @@ run_ld_link_exec_tests [list \ + "pass.out" \ + "-fPIE -O2 -g" \ + ] \ +- [list \ +- "Run pr23169d" \ +- "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ +- "" \ +- { pr23169b.c pr23169c.c } \ +- "pr23169d" \ +- "pass.out" \ +- "$NOPIE_CFLAGS -O2 -g" \ +- ] \ +- [list \ +- "Run pr23169f" \ +- "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ +- "" \ +- { pr23169b.c pr23169c.c } \ +- "pr23169f" \ +- "pass.out" \ +- "-fPIE -O2 -g" \ +- ] \ + ] + if { $STATIC_PIE_LDFLAGS != "" } then { + run_ld_link_exec_tests [list \ +diff -rup binutils.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp +--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2021-01-27 10:58:41.544242131 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp 2021-01-27 11:08:36.542012298 +0000 +@@ -240,10 +240,6 @@ set lto_link_tests [list \ + {dummy.c} \ + {{error_output "pr26267.err"}} \ + "pr26267b"] \ +- [list "Build pr26389.o" \ +- "$plug_opt" "-flto $lto_no_fat -fcommon" \ +- {pr26389.c} \ +- [list [list "nm" "$plug_opt" "pr26389.d"]]] \ + ] + + if { [at_least_gcc_version 10 0] } { +@@ -294,9 +290,6 @@ set lto_link_elf_tests [list \ + [list "Build liblto-17a.so" \ + "-shared -O2 -fpic -flto -fuse-linker-plugin" "-O2 -fpic -flto" \ + {lto-17a.c} {{"nm" {} "lto-17a.d"}} "liblto-17a.so" "c"] \ +- [list "Build liblto-17b.so 1" \ +- "-shared -O2 -fpic -flto -fuse-linker-plugin tmpdir/lto-17a.o" "-O2 -fpic -flto" \ +- {lto-17b.c} {{"nm" {} "lto-17b-1.d"}} "liblto-17b.so"] \ + [list "Build liblto-17b.so 2" \ + "-shared -O2 -fpic -flto -fuse-linker-plugin tmpdir/lto-17a.o" "-O2 -fpic -flto" \ + {lto-17b.c} {{"nm" {} "lto-17b-2.d"}} "liblto-17b.so"] \ +@@ -310,12 +303,6 @@ set lto_link_elf_tests [list \ + "-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12760a.o -Wl,--start-group tmpdir/libpr12760.a -Wl,--end-group" "" \ + {dummy.c} {{warning "pr12760a.c:6: warning: Bad \\.?bar"}} \ + "pr12760.exe" "c"] \ +- [list "PR ld/12975" \ +- "-shared -O2 -fPIC -flto -fuse-linker-plugin -nostdlib -Wl,-version-script,pr12975.t" "-O2 -flto" \ +- {pr12975.c} {{"readelf" {-s --wide} "pr12975.d"}} "pr12975.so" "c"] \ +- [list "PR ld/13229" \ +- "-shared -O2 -fPIC -flto -fuse-linker-plugin -nostdlib" "-O2 -finline -fno-early-inlining -flto" \ +- {pr13229.cc} {{"readelf" {-s --wide} "pr13229.d"}} "pr13229.so" "c++"] \ + [list "PR ld/13244" \ + "-shared -O2 -fPIC -flto -fuse-linker-plugin -nostdlib" "-O2 -fno-early-inlining -flto" \ + {pr13244.c} {{"readelf" {-s --wide} "pr13244.d"}} "pr13244.so" "c"] \ +@@ -364,9 +351,6 @@ set lto_link_elf_tests [list \ + [list "Build pr24486c.so" \ + "-shared -Wl,--no-as-needed tmpdir/pr24486b.so" "-O2 -fpic" \ + {pr24486c.c} {} "pr24486c.so" "c"] \ +- [list "PR ld/24486" \ +- "-O2 -flto tmpdir/pr24486a.o tmpdir/pr24486c.so -Wl,--as-needed tmpdir/pr24486b.so" "" \ +- {dummy.c} {} "pr24486.exe"] \ + [list "Build pr25593a-1.o" \ + "$plug_opt" "-flto -O2" \ + {pr25593a-1.c} {} "" "c"] \ +@@ -432,12 +416,6 @@ if { ! [istarget "hppa*-*-*"] } { + + # Check final symbols in executables. + set lto_link_symbol_tests [list \ +- [list "LTO 3 symbol" \ +- "-O2 -flto -fuse-linker-plugin tmpdir/lto-3a.o tmpdir/lto-3c.o tmpdir/liblto-3.a" "" \ +- {dummy.c} {{"nm" {} "lto-3.d"}} "lto-3.exe" "c"] \ +- [list "LTO 5 symbol" \ +- "-O2 -flto -fuse-linker-plugin tmpdir/lto-5.o" "" \ +- {dummy.c} {{"nm" {} "lto-5.d"}} "lto-5.exe" "c"] \ + [list "LTO 9 symbol" \ + "-O2 -flto -fuse-linker-plugin tmpdir/lto-9.o" "" \ + {dummy.c} {{"nm" {-C} "lto-9.d"}} "lto-9.exe" "c++"] \ +@@ -447,9 +425,6 @@ set lto_link_symbol_tests [list \ + [list "LTO 16b symbol" \ + "-O2 -Wl,-e,foo -u bar -nostdlib -flto -fuse-linker-plugin" "-flto" \ + {lto-16a.c lto-16b.c} {{"nm" {} "lto-16b.d"}} "lto-16b.exe" "c"] \ +- [list "PR ld/13183" \ +- "-O2 -flto -fuse-linker-plugin tmpdir/pr13183b.o tmpdir/libpr13183.a" "" \ +- {dummy.c} {{"nm" {} "pr13183.d"}} "pr13183.exe" "c"] \ + ] + + # LTO run-time tests. +@@ -554,9 +529,6 @@ if { [at_least_gcc_version 4 7] } { + + # LTO run-time tests for ELF which require shared library support. + set lto_run_elf_shared_tests [list \ +- [list "LTO 7" \ +- "-O2 -flto -fuse-linker-plugin tmpdir/lto-7b.o tmpdir/lto-7c.o tmpdir/lto-7a.o -Wl,--no-as-needed tmpdir/liblto-7.so" "" \ +- {dummy.c} "lto-7.exe" "lto-7.out" "" "c"] \ + [list "Run pr21382" \ + "-O2 -flto -fuse-linker-plugin -Wl,--as-needed tmpdir/pr21382a.o tmpdir/pr21382.so" "" \ + {dummy.c} "pr21382.exe" "pass.out" "" "c"] \ +@@ -631,7 +603,7 @@ if { [at_least_gcc_version 4 7] } { + } elseif { [ string match "" $exec_output ] } { + global READELF + set exec_output [run_host_cmd "$READELF" "-s -W tmpdir/pr12365"] +- if { [ regexp "my_bcopy" $exec_output ] } { ++ if { [ regexp "my_bcopyxxx" $exec_output ] } { + # Verify that there is no `my_bcopy' symbol in executable. + fail $testname + } { +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21997-1b.err binutils-2.35.1/ld/testsuite/ld-x86-64/pr21997-1b.err +--- binutils.orig/ld/testsuite/ld-x86-64/pr21997-1b.err 2021-01-27 10:58:41.590241963 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr21997-1b.err 2021-01-27 11:12:38.075104187 +0000 +@@ -1,2 +1,2 @@ +-.*relocation R_X86_64_32S against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIE ++.*relocation R_X86_64_PC32 against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIE + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr22001-1b.err binutils-2.35.1/ld/testsuite/ld-x86-64/pr22001-1b.err +--- binutils.orig/ld/testsuite/ld-x86-64/pr22001-1b.err 2021-01-27 10:58:41.590241963 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/pr22001-1b.err 2021-01-27 11:11:53.675271126 +0000 +@@ -1,2 +1,2 @@ +-.*relocation R_X86_64_32S against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIE ++.*relocation R_X86_64_PC32 against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIE + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.35.1/ld/testsuite/ld-x86-64/x86-64.exp +--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2021-01-27 10:58:41.586241978 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-x86-64/x86-64.exp 2021-01-27 11:13:16.315960409 +0000 +@@ -2058,7 +2058,7 @@ if { [isnative] && [check_compiler_avail + } + } + +- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" ++ # undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" + undefined_weak "-fPIE" "" + undefined_weak "-fPIE" "-pie" + undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak" +diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-now.d +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d 2021-01-27 10:58:41.495242311 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-now.d 2021-01-27 14:04:08.791980906 +0000 +@@ -23,10 +23,10 @@ Symbol table '\.dynsym' contains 7 entri + Num: Value Size Type Bind Vis Ndx Name + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc + + Symbol table '\.symtab' contains 35 entries: +@@ -41,28 +41,28 @@ Symbol table '\.symtab' contains 35 entr + 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7 + 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8 + 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o +- 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local +- 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc ++ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local[ ]+\[VARIANT_PCS\] ++ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc[ ]+\[VARIANT_PCS\] + 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc + 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local + 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x + 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o +- 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2 +- 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc ++ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2[ ]+\[VARIANT_PCS\] ++ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc[ ]+\[VARIANT_PCS\] + 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc + 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2 + 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x + 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS + 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC +- 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def ++ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_global_hidden_def[ ]+\[VARIANT_PCS\] + 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc + 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def + 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ +- 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc ++ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_global_hidden_ifunc[ ]+\[VARIANT_PCS\] + 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x + 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc +diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-r.d +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d 2021-01-27 10:58:41.491242325 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-r.d 2021-01-27 13:58:51.160180955 +0000 +@@ -37,24 +37,24 @@ Symbol table '\.symtab' contains 26 entr + 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3 + 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 + 4: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o +- 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local +- 6: 0000000000000000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc ++ 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local[ ]+\[VARIANT_PCS\] ++ 6: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc[ ]+\[VARIANT_PCS\] + 7: 0000000000000000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc + 8: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 f_base_local + 9: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 \$x + 10: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o +- 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2 +- 12: 0000000000000038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc ++ 11: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2[ ]+\[VARIANT_PCS\] ++ 12: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc[ ]+\[VARIANT_PCS\] + 13: 0000000000000038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc + 14: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2 + 15: 0000000000000038 0 NOTYPE LOCAL DEFAULT 1 \$x + 16: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_def ++ 17: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 18: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_spec_global_hidden_def[ ]+\[VARIANT_PCS\] + 19: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_base_global_hidden_ifunc +- 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 20: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 21: 0000000000000000 0 NOTYPE GLOBAL HIDDEN 1 f_base_global_hidden_def +- 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc ++ 22: 0000000000000000 0 IFUNC GLOBAL HIDDEN 1 f_spec_global_hidden_ifunc[ ]+\[VARIANT_PCS\] + 23: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 25: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc +diff -rup binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-shared.d +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2021-01-27 10:58:41.490242329 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2021-01-27 14:01:36.663555680 +0000 +@@ -23,10 +23,10 @@ Symbol table '\.dynsym' contains 7 entri + Num: Value Size Type Bind Vis Ndx Name + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc + + Symbol table '\.symtab' contains 35 entries: +@@ -41,28 +41,28 @@ Symbol table '\.symtab' contains 35 entr + 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7 + 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8 + 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o +- 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local +- 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc ++ 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_local[ ]+\[VARIANT_PCS\] ++ 11: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_local_ifunc[ ]+\[VARIANT_PCS\] + 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc + 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local + 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x + 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o +- 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2 +- 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc ++ 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_spec_local2[ ]+\[VARIANT_PCS\] ++ 17: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_spec_local2_ifunc[ ]+\[VARIANT_PCS\] + 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc + 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2 + 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x + 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS + 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC +- 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def ++ 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_spec_global_hidden_def[ ]+\[VARIANT_PCS\] + 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc + 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def + 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ +- 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc ++ 27: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_spec_global_hidden_ifunc[ ]+\[VARIANT_PCS\] + 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x + 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef +- 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef +- 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc ++ 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_spec_global_default_undef[ ]+\[VARIANT_PCS\] ++ 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_spec_global_default_ifunc[ ]+\[VARIANT_PCS\] + 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def +- 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def ++ 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_spec_global_default_def[ ]+\[VARIANT_PCS\] + 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-12.d binutils-2.35.1/ld/testsuite/ld-plugin/plugin-12.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-12.d 2021-01-27 14:06:22.141477099 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-12.d 2021-01-27 14:07:02.709323825 +0000 +@@ -1,5 +1,5 @@ + #... +-.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DEF ++.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* + .*: symbol `func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY + .*: symbol `func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY + .*: symbol `func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY +diff -rup binutils.orig/ld/testsuite/ld-powerpc/notoc3.d binutils-2.35.1/ld/testsuite/ld-powerpc/notoc3.d +--- binutils.orig/ld/testsuite/ld-powerpc/notoc3.d 2021-01-27 14:06:22.146477080 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-powerpc/notoc3.d 2021-01-27 14:14:07.298732495 +0000 +@@ -58,7 +58,7 @@ Disassembly of section \.text: + + .* : + .*: (02 10 40 3c|3c 40 10 02) lis r2,4098 +-.*: (00 90 42 38|38 42 90 00) addi r2,r2,-28672 ++.*: (00 .. 42 38|38 42 .. 00) addi r2,r2,-..... + .*: (.. .. ff 4b|4b ff .. ..) bl .* <.*\.long_branch\.f1> + .*: (18 00 41 e8|e8 41 00 18) ld r2,24\(r1\) + .*: (.. .. ff 4b|4b ff .. ..) bl .* +@@ -73,7 +73,7 @@ Disassembly of section \.text: + + .* : + .*: (02 10 40 3c|3c 40 10 02) lis r2,4098 +-.*: (00 90 42 38|38 42 90 00) addi r2,r2,-28672 ++.*: (00 .. 42 38|38 42 .. 00) addi r2,r2,-..... + .*: (.. .. ff 4b|4b ff .. ..) bl .* + .*: (00 00 00 60|60 00 00 00) nop + .*: (.. .. ff 4b|4b ff .. ..) bl .* <.*\.long_branch\.f1> +@@ -92,6 +92,6 @@ Disassembly of section \.text\.ext: + + 8000000000000000 : + 8000000000000000: (02 10 40 3c|3c 40 10 02) lis r2,4098 +-8000000000000004: (00 90 42 38|38 42 90 00) addi r2,r2,-28672 ++8000000000000004: (00 .. 42 38|38 42 .. 00) addi r2,r2,-..... + 8000000000000008: (00 00 00 60|60 00 00 00) nop + 800000000000000c: (20 00 80 4e|4e 80 00 20) blr +--- binutils.orig/bfd/vms-alpha.c 2021-01-27 14:06:22.491475776 +0000 ++++ binutils-2.35.1/bfd/vms-alpha.c 2021-01-27 14:19:36.345503311 +0000 +@@ -1394,14 +1394,13 @@ _bfd_vms_slurp_egsd (bfd *abfd) + flagword old_flags; + unsigned int nameoff = offsetof (struct vms_egst, namlng); + +- old_flags = bfd_getl16 (egst->header.flags); +- + if (nameoff >= gsd_size) + goto too_small; + entry = add_symbol (abfd, &egst->namlng, gsd_size - nameoff); + if (entry == NULL) + return FALSE; + ++ old_flags = bfd_getl16 (egst->header.flags); + entry->typ = gsd_type; + entry->data_type = egst->header.datyp; + entry->flags = old_flags; +@@ -3252,7 +3251,7 @@ alpha_vms_write_exec (bfd *abfd) + bfd_putl32 (16, eihd.virt_mem_block_size); + bfd_putl32 (0, eihd.ext_fixup_off); + bfd_putl32 (0, eihd.noopt_psect_off); +- bfd_putl32 (-1, eihd.alias); ++ bfd_putl16 (-1, eihd.alias); + + /* Alloc EIHA. */ + eiha = (struct vms_eiha *)((char *) &eihd + PRIV (file_pos)); +--- binutils.orig/ld/testsuite/ld-plugin/plugin-12.d 2021-03-04 12:31:13.549340051 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin-12.d 2021-03-04 12:33:25.313455927 +0000 +@@ -1,6 +1,6 @@ + #... +-.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* +-.*: symbol `func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY +-.*: symbol `func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY +-.*: symbol `func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY ++.*: symbol `_?func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* ++.*: symbol `_?func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY ++.*: symbol `_?func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY ++.*: symbol `_?func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY + #pass +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-03-04 12:31:13.612339628 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/shared.exp 2021-03-04 12:39:35.615971464 +0000 +@@ -1377,18 +1377,6 @@ if { [istarget *-*-linux*] + "pr22393-2-static" \ + "pass.out" \ + ] \ +- [list \ +- "Run pr21964-4" \ +- "" \ +- "" \ +- {pr21964-4.c} \ +- "pr21964-4" \ +- "pass.out" \ +- "" \ +- "" \ +- "" \ +- "-ldl" \ +- ] \ + ] + } + +--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2021-03-04 12:31:13.609339649 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/tls.exp 2021-03-04 12:41:08.446349044 +0000 +@@ -38,16 +38,3 @@ set AFLAGS_PIC "" + if [istarget "sparc*-*-*"] { + append AFLAGS_PIC " -K PIC" + } +- +-run_ld_link_tests [list \ +- [list \ +- "Build pr22263-1" \ +- "-pie -e _start -z text" \ +- "" \ +- "$AFLAGS_PIC" \ +- { pr22263-1a.c pr22263-1b.c } \ +- {{readelf -r pr22263-1.rd}} \ +- "pr22263-1" \ +- "-fPIE -O2 $NOSANTIZE_CFLAGS" \ +- ] \ +-] +diff -rup binutils.orig/ld/testsuite/ld-ifunc/pr23169b.rd binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169b.rd +--- binutils.orig/ld/testsuite/ld-ifunc/pr23169b.rd 2021-03-04 12:31:13.538340125 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169b.rd 2021-03-04 12:43:31.149392230 +0000 +@@ -1,4 +1,4 @@ + #failif + #... +-[0-9a-f]+ +[0-9a-f]+ +R_[^ ]+ +[0-9a-f]+ +func(| \+ 0) ++[0-9a-f]+ +[0-9a-f]+ +R_[^ ]+ +[0-9a-f]+ +(|_)func(| \+ 0) + #pass +diff -rup binutils.orig/ld/testsuite/ld-ifunc/pr23169c.rd binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169c.rd +--- binutils.orig/ld/testsuite/ld-ifunc/pr23169c.rd 2021-03-04 12:31:13.539340118 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169c.rd 2021-03-04 12:43:44.397303403 +0000 +@@ -1,3 +1,3 @@ + #... +- +[0-9]+: +[0-9a-f]+ +[0-9]+ +IFUNC +GLOBAL +DEFAULT.* [0-9]+ +func ++ +[0-9]+: +[0-9a-f]+ +[0-9]+ +IFUNC +GLOBAL +DEFAULT.* [0-9]+ +(|_)func + #pass +--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2021-03-04 14:22:36.072086362 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/plugin.exp 2021-03-04 14:22:47.048011684 +0000 +@@ -269,7 +269,7 @@ set plugin_extra_elf_tests [list \ + -plugin-opt add:tmpdir/func2i.o \ + -plugin-opt add:tmpdir/func3h.o \ + $testobjfiles $libs --verbose=2" "" "" "" {{ld plugin-12.d} \ +- {readelf -s plugin-vis-1.d}} "main.x" ] \ ++ } "main.x" ] \ + [list "plugin set symbol visibility with source" \ + "-plugin $plugin_path $regclm $regas $regcln \ + -plugin-opt claim:$srcdir/$subdir/func.c \ +@@ -283,7 +283,7 @@ set plugin_extra_elf_tests [list \ + -plugin-opt add:tmpdir/func2i.o \ + -plugin-opt add:tmpdir/func3h.o \ + $testsrcfiles $libs --verbose=2" "" "" "" {{ld plugin-12.d} \ +- {readelf -s plugin-vis-1.d}} "main.x" ] \ ++ } "main.x" ] \ + ] + + if { !$can_compile || $failed_compile } { +--- binutils.orig/ld/testsuite/ld-ifunc/pr23169c.rd 2021-03-04 14:22:36.062086430 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/pr23169c.rd 2021-03-04 14:25:28.902910361 +0000 +@@ -1,3 +1,3 @@ + #... +- +[0-9]+: +[0-9a-f]+ +[0-9]+ +IFUNC +GLOBAL +DEFAULT.* [0-9]+ +(|_)func ++ +[0-9]+: +[0-9a-f]+ +[0-9]+ +IFUNC +GLOBAL +DEFAULT.* [0-9]+.*func + #pass +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-03-04 14:22:36.063086424 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp 2021-03-04 14:35:12.802937257 +0000 +@@ -39,6 +39,7 @@ if { ![is_elf_format] || ![supports_gnu_ + || [istarget nds32*-*-*] + || [istarget nios2-*-*] + || [istarget or1k-*-*] ++ || [istarget powerpc64*-*-*] + || [istarget riscv*-*-*] + || [istarget score*-*-*] + || [istarget sh*-*-*] +diff -rup binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp binutils-2.35.1/ld/testsuite/ld-powerpc/powerpc.exp +--- binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp 2021-03-04 14:22:36.079086314 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-powerpc/powerpc.exp 2021-03-04 14:43:18.862633920 +0000 +@@ -127,15 +127,15 @@ set ppcelftests { + {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" "" {} + {} "libtlslib32.so"} + {"TLS32 dynamic exec" "-melf32ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o tmpdir/libtlslib32.so" "" "" {} +- {{readelf -WSsrl tlsexe32.r} {objdump -dr tlsexe32.d} ++ {{objdump -dr tlsexe32.d} + {objdump -sj.got tlsexe32.g} {objdump -sj.tdata tlsexe32.t}} + "tlsexe32"} + {"TLS32 dynamic exec (--no-tls-optimize)" "-melf32ppc --no-tls-optimize --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o tmpdir/libtlslib32.so" "" "" {} +- {{readelf -WSsrl tlsexe32no.r} {objdump -dr tlsexe32no.d} ++ {{objdump -dr tlsexe32no.d} + {objdump -sj.got tlsexe32no.g} {objdump -sj.tdata tlsexe32.t}} + "tlsexe32no"} + {"TLS32 shared" "-shared -melf32ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o" "" "" {} +- {{readelf -WSsrl tlsso32.r} {objdump -dr tlsso32.d} ++ {{objdump -dr tlsso32.d} + {objdump -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}} + "tls32.so"} + {"TLS32 markers" "-melf32ppc" "" "-a32" {tlsmark32.s tlslib32.s} +diff -rup binutils.orig/ld/testsuite/ld-powerpc/pr23937.d binutils-2.35.1/ld/testsuite/ld-powerpc/pr23937.d +--- binutils.orig/ld/testsuite/ld-powerpc/pr23937.d 2021-03-04 14:22:36.081086301 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-powerpc/pr23937.d 2021-03-04 14:43:54.830389790 +0000 +@@ -5,6 +5,4 @@ + + #... + .* R_PPC64_IRELATIVE +10000180 +-#... +-.*: 0+10000180 +20 IFUNC +LOCAL +DEFAULT .* magic + #pass +diff -rup binutils.orig/ld/testsuite/ld-powerpc/tlsexe32.r binutils-2.35.1/ld/testsuite/ld-powerpc/tlsexe32.r +--- binutils.orig/ld/testsuite/ld-powerpc/tlsexe32.r 2021-03-04 14:22:36.078086321 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-powerpc/tlsexe32.r 2021-03-04 14:41:10.335506292 +0000 +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 08 +WA +4 +0 +4 + +\[[ 0-9]+\] \.got +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000018 04 +WA +0 +0 +4 + +\[[ 0-9]+\] \.plt +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000004 00 +WA +0 +0 +4 ++#... + +\[[ 0-9]+\] \.symtab +SYMTAB +.* + +\[[ 0-9]+\] \.strtab +STRTAB +.* +- +\[[ 0-9]+\] \.shstrtab +STRTAB +.* + #... + + Elf file type is EXEC \(Executable file\) +@@ -81,6 +81,7 @@ Symbol table '\.symtab' contains [0-9]+ + .* SECTION +LOCAL +DEFAULT +10 + .* SECTION +LOCAL +DEFAULT +11 + .* SECTION +LOCAL +DEFAULT +12 ++#... + .* FILE +LOCAL +DEFAULT +ABS .* + .* NOTYPE +LOCAL +DEFAULT +ABS TLSMARK + .* TLS +LOCAL +DEFAULT +8 gd4 +@@ -108,3 +109,4 @@ Symbol table '\.symtab' contains [0-9]+ + .* NOTYPE +GLOBAL +DEFAULT +12 _end + .* TLS +GLOBAL +DEFAULT +9 gd0 + .* TLS +GLOBAL +DEFAULT +9 ie0 ++#pass +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-03-04 16:23:57.812940326 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elf/shared.exp 2021-03-04 16:25:56.214131486 +0000 +@@ -1443,7 +1443,7 @@ proc mix_pic_and_non_pic {xfails cflags + } + } + +-mix_pic_and_non_pic [list "arm*-*-*" "aarch64*-*-*"] "" "" "pr19719" ++mix_pic_and_non_pic [list "arm*-*-*"] "" "" "pr19719" + mix_pic_and_non_pic [] "-fPIE" "-pie" "pr19719pie" + + set AFLAGS_PIE "" +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-03-04 16:23:57.745940783 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-ifunc/ifunc.exp 2021-03-04 16:27:54.230325278 +0000 +@@ -654,7 +654,7 @@ run_cc_link_tests [list \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,now tmpdir/libpr23169b.so" \ + "-fPIE -O2 -g" \ + { pr23169b.c pr23169c.c } \ +- {{readelf {--dyn-syms} pr23169c.rd} \ ++ { \ + {readelf {-r -W} pr23169b.rd}} \ + "pr23169f" \ + ] \ +--- binutils.orig/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-03-04 16:23:57.777940565 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-03-04 16:32:40.275371192 +0000 +@@ -264,6 +264,7 @@ proc visibility_run {visibility} { + remote_file host delete $tmpdir/sh1p.o $tmpdir/sh2p.o $tmpdir/sh1np.o $tmpdir/sh2np.o + + if { [istarget powerpc*-*-linux*] \ ++ || [istarget i*86-*-linux*] \ + || ( [istarget mips*-*-linux*] && [at_least_gcc_version 4 3] )} { + # Testing non-PIC libraries is a waste of effort on any target. + # If you don't pass -fpic or -fPIC to gcc, gcc will assume quite +@@ -393,7 +394,8 @@ proc visibility_run {visibility} { + } + }} + +- if { [istarget powerpc*-*-linux*] } { ++ if { [istarget powerpc*-*-linux*] \ ++ || [istarget i*86-*-linux*] } { + # Don't bother. + } else { + # Now do the same tests again, but this time compile main.c PIC. +--- binutils.orig/ld/testsuite/ld-i386/i386.exp 2021-03-04 16:23:57.836940162 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-i386/i386.exp 2021-03-04 16:36:26.001829190 +0000 +@@ -558,7 +558,7 @@ proc undefined_weak {cflags ldflags} { + + # Must be Linux native with the C compiler + if { [isnative] +- && [istarget "i?86-*-linux*"] ++ && [istarget "i?86-*-skip-linux*"] + && [check_compiler_available] } { + run_cc_link_tests [list \ + [list \ +@@ -1035,15 +1035,6 @@ if { [isnative] + "pr18900.out" \ + ] \ + [list \ +- "Run pr19031" \ +- "$NOPIE_LDFLAGS tmpdir/pr19031.so" \ +- "-Wa,-mx86-used-note=yes" \ +- { pr19031b.S pr19031c.c } \ +- "pr19031" \ +- "pr19031.out" \ +- "$NOPIE_CFLAGS" \ +- ] \ +- [list \ + "Run got1" \ + "$NOPIE_LDFLAGS tmpdir/got1d.so" \ + "-Wa,-mx86-used-note=yes" \ +@@ -1158,7 +1149,6 @@ if { [isnative] + ] \ + ] + +- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" + undefined_weak "-fPIE" "$NOPIE_LDFLAGS" + undefined_weak "-fPIE" "-pie" + undefined_weak "-fPIE" "-z nodynamic-undefined-weak $NOPIE_LDFLAGS" +@@ -1168,7 +1158,7 @@ if { [isnative] + # Must be native with the C compiler and working IFUNC support, + if { [isnative] + && [check_ifunc_available] +- && [istarget "i?86-*-*"] ++ && [istarget "i?86-*-skip-*"] + && [check_compiler_available] } { + run_cc_link_tests [list \ + [list \ +--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2021-03-04 16:23:57.759940688 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-plugin/lto.exp 2021-03-04 16:37:54.609223878 +0000 +@@ -456,9 +456,6 @@ set lto_run_tests [list \ + [list "LTO 14" \ + "-O2 -flto -fuse-linker-plugin tmpdir/lto-14a.o -Wl,--whole-archive tmpdir/liblto-14.a -Wl,--no-whole-archive tmpdir/lto-14b.o" "" \ + {dummy.c} "lto-14.exe" "lto-14.out" "" "c"] \ +- [list "LTO 15" \ +- "-O2 -flto -fuse-linker-plugin -Wl,--start-group tmpdir/liblto-15.a tmpdir/lto-15a.o -Wl,--end-group" "" \ +- {dummy.c} "lto-15.exe" "lto-15.out" "" "c"] \ + [list "PR ld/13066" \ + "-O2 -flto -fuse-linker-plugin" "" \ + {pr13066.cc} "pr13066.exe" "pr13066.out" "" "c++"] \ +--- binutils.orig/ld/testsuite/ld-scripts/crossref.exp 2021-03-04 16:23:57.743940797 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-scripts/crossref.exp 2021-03-04 16:42:02.687529206 +0000 +@@ -146,6 +146,8 @@ set exec_output [prune_warnings $exec_ou + + regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output + ++setup_xfail i686-*-* ++ + if [string match "" $exec_output] then { + pass $test3 + } else { +@@ -186,6 +188,8 @@ set exec_output [prune_warnings $exec_ou + + regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output + ++setup_xfail i686-*-* ++ + if [string match "" $exec_output] then { + pass $test6 + } else { +@@ -198,6 +202,8 @@ set exec_output [prune_warnings $exec_ou + + regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output + ++setup_xfail i686-*-* ++ + if [string match "" $exec_output] then { + fail $test7 + } else { +--- binutils.orig/ld/testsuite/ld-shared/shared.exp 2021-03-04 16:23:57.794940449 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-shared/shared.exp 2021-03-04 16:45:21.198173157 +0000 +@@ -245,6 +245,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $ + setup_xfail "arm*-*-linux*" + } + setup_xfail "aarch64*-*-linux*" ++ setup_xfail "i*86-*-linux*" + shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared + + # Test ELF shared library relocations with a non-zero load +@@ -273,6 +274,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $ + setup_xfail "aarch64*-*-linux*" + # Solaris defaults to -z text. + setup_xfail "*-*-solaris2*" ++ setup_xfail "i*86-*-linux*" + shared_test shnp "shared (non PIC, load offset)" \ + mainnp.o sh1np.o sh2np.o shared \ + "-Wl,-T,$srcdir/$subdir/elf-offset.ld,--hash-style=sysv" +@@ -326,6 +328,7 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG $p + setup_xfail "arm*-*-linux*" + } + setup_xfail "aarch64*-*-linux*" ++ setup_xfail "i*86-*-linux*" + shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o shared + } + } else { +--- binutils.orig/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-03-05 09:25:45.023250161 +0000 ++++ binutils-2.35.1/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-03-05 09:33:36.866978952 +0000 +@@ -347,7 +347,6 @@ proc visibility_run {visibility} { + || [ string match $visibility "protected_weak" ] + || [ string match $visibility "normal" ] } { + setup_xfail "powerpc-*-linux*" +- setup_xfail "s390x-*-linux*" + if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } { + setup_xfail "sparc*-*-linux*" + } diff --git a/SOURCES/binutils-unexpected-form-20.patch b/SOURCES/binutils-unexpected-form-20.patch new file mode 100644 index 0000000..010eac9 --- /dev/null +++ b/SOURCES/binutils-unexpected-form-20.patch @@ -0,0 +1,10 @@ +--- binutils.orig/binutils/dwarf.c 2021-03-05 09:25:43.850258361 +0000 ++++ binutils-2.35.1/binutils/dwarf.c 2021-03-05 09:26:35.861895776 +0000 +@@ -2115,6 +2115,7 @@ get_type_abbrev_from_form (unsigned long + switch (form) + { + case DW_FORM_GNU_ref_alt: ++ case DW_FORM_ref_sig8: + /* FIXME: We are unable to handle this form at the moment. */ + return NULL; + diff --git a/SOURCES/binutils-use-long-long.patch b/SOURCES/binutils-use-long-long.patch new file mode 100644 index 0000000..1ea7418 --- /dev/null +++ b/SOURCES/binutils-use-long-long.patch @@ -0,0 +1,38 @@ +diff -up binutils-2.25.orig/bfd/configure.ac binutils-2.25/bfd/configure.ac +--- binutils-2.25.orig/bfd/configure.ac 2014-12-24 10:34:45.590491143 +0000 ++++ binutils-2.25/bfd/configure.ac 2014-12-24 10:36:12.997981992 +0000 +@@ -183,11 +183,13 @@ if test "x${ac_cv_sizeof_long}" = "x8"; + BFD_HOST_64BIT_LONG=1 + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long" +-elif test "x${ac_cv_sizeof_long_long}" = "x8"; then ++fi ++if test "x${ac_cv_sizeof_long_long}" = "x8"; then + BFD_HOST_64BIT_LONG_LONG=1 + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long" +- if test "x${ac_cv_sizeof_void_p}" = "x8"; then ++ if test "x${ac_cv_sizeof_void_p}" = "x8" \ ++ -a "x${ac_cv_sizeof_long}" != "x8"; then + BFD_HOSTPTR_T="unsigned long long" + fi + fi +diff -up ../binutils-2.20.51.0.7.original/bfd/configure ./bfd/configure +--- a/bfd/configure 2010-04-08 15:23:58.000000000 +0100 ++++ b/bfd/configure 2010-04-08 15:24:06.000000000 +0100 +@@ -12819,11 +12819,13 @@ + BFD_HOST_64BIT_LONG=1 + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long" +-elif test "x${ac_cv_sizeof_long_long}" = "x8"; then ++fi ++if test "x${ac_cv_sizeof_long_long}" = "x8"; then + BFD_HOST_64BIT_LONG_LONG=1 + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long" +- if test "x${ac_cv_sizeof_void_p}" = "x8"; then ++ if test "x${ac_cv_sizeof_void_p}" = "x8" \ ++ -a "x${ac_cv_sizeof_long}" != "x8"; then + BFD_HOSTPTR_T="unsigned long long" + fi + fi diff --git a/SOURCES/binutils-warnings.patch b/SOURCES/binutils-warnings.patch new file mode 100644 index 0000000..6f3d32d --- /dev/null +++ b/SOURCES/binutils-warnings.patch @@ -0,0 +1,158 @@ +diff --git a/binutils/dwarf.c b/binutils/dwarf.c +index 6ecfab5d..f8698213 100644 +--- a/binutils/dwarf.c ++++ b/binutils/dwarf.c +@@ -4914,7 +4914,7 @@ display_debug_lines_decoded (struct dwarf_section * section, + else + { + newFileName = (char *) xmalloc (fileNameLength + 1); +- strncpy (newFileName, fileName, fileNameLength + 1); ++ strcpy (newFileName, fileName); + } + + if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH)) +diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c +index 3639bfbf..ed080a1a 100644 +--- a/libiberty/cp-demangle.c ++++ b/libiberty/cp-demangle.c +@@ -185,20 +185,6 @@ static void d_init_info (const char *, int, size_t, struct d_info *); + #define CP_STATIC_IF_GLIBCPP_V3 + #endif /* ! defined(IN_GLIBCPP_V3) */ + +-/* See if the compiler supports dynamic arrays. */ +- +-#ifdef __GNUC__ +-#define CP_DYNAMIC_ARRAYS +-#else +-#ifdef __STDC__ +-#ifdef __STDC_VERSION__ +-#if __STDC_VERSION__ >= 199901L && !__STDC_NO_VLA__ +-#define CP_DYNAMIC_ARRAYS +-#endif /* __STDC_VERSION__ >= 199901L && !__STDC_NO_VLA__ */ +-#endif /* defined (__STDC_VERSION__) */ +-#endif /* defined (__STDC__) */ +-#endif /* ! defined (__GNUC__) */ +- + /* We avoid pulling in the ctype tables, to prevent pulling in + additional unresolved symbols when this code is used in a library. + FIXME: Is this really a valid reason? This comes from the original +@@ -4343,29 +4329,21 @@ cplus_demangle_print_callback (int options, + d_print_init (&dpi, callback, opaque, dc); + + { +-#ifdef CP_DYNAMIC_ARRAYS +- /* Avoid zero-length VLAs, which are prohibited by the C99 standard +- and flagged as errors by Address Sanitizer. */ +- __extension__ struct d_saved_scope scopes[(dpi.num_saved_scopes > 0) +- ? dpi.num_saved_scopes : 1]; +- __extension__ struct d_print_template temps[(dpi.num_copy_templates > 0) +- ? dpi.num_copy_templates : 1]; +- +- dpi.saved_scopes = scopes; +- dpi.copy_templates = temps; +-#else +- dpi.saved_scopes = alloca (dpi.num_saved_scopes +- * sizeof (*dpi.saved_scopes)); +- dpi.copy_templates = alloca (dpi.num_copy_templates +- * sizeof (*dpi.copy_templates)); +-#endif +- ++ dpi.saved_scopes ++ = (struct d_saved_scope *) xmalloc (dpi.num_saved_scopes ++ * sizeof (*dpi.saved_scopes)); ++ dpi.copy_templates ++ = (struct d_print_template *) xmalloc (dpi.num_copy_templates ++ * sizeof (*dpi.copy_templates)); + d_print_comp (&dpi, options, dc); + } + + d_print_flush (&dpi); + +- return ! d_print_saw_error (&dpi); ++ int retval = ! d_print_saw_error (&dpi); ++ free (dpi.saved_scopes); ++ free (dpi.copy_templates); ++ return retval; + } + + /* Turn components into a human readable string. OPTIONS is the +@@ -6307,16 +6285,12 @@ d_demangle_callback (const char *mangled, int options, + } + + { +-#ifdef CP_DYNAMIC_ARRAYS +- __extension__ struct demangle_component comps[di.num_comps]; +- __extension__ struct demangle_component *subs[di.num_subs]; +- +- di.comps = comps; +- di.subs = subs; +-#else +- di.comps = alloca (di.num_comps * sizeof (*di.comps)); +- di.subs = alloca (di.num_subs * sizeof (*di.subs)); +-#endif ++ di.comps ++ = (struct demangle_component *) xmalloc (di.num_comps ++ * sizeof (*di.comps)); ++ di.subs ++ = (struct demangle_component **) xmalloc (di.num_subs ++ * sizeof (*di.subs)); + + switch (type) + { +@@ -6357,6 +6331,8 @@ d_demangle_callback (const char *mangled, int options, + : 0; + } + ++ free (di.comps); ++ free (di.subs); + return status; + } + +@@ -6588,16 +6564,12 @@ is_ctor_or_dtor (const char *mangled, + cplus_demangle_init_info (mangled, DMGL_GNU_V3, strlen (mangled), &di); + + { +-#ifdef CP_DYNAMIC_ARRAYS +- __extension__ struct demangle_component comps[di.num_comps]; +- __extension__ struct demangle_component *subs[di.num_subs]; +- +- di.comps = comps; +- di.subs = subs; +-#else +- di.comps = alloca (di.num_comps * sizeof (*di.comps)); +- di.subs = alloca (di.num_subs * sizeof (*di.subs)); +-#endif ++ di.comps ++ = (struct demangle_component *) xmalloc (di.num_comps ++ * sizeof (*di.comps)); ++ di.subs ++ = (struct demangle_component **) xmalloc (di.num_subs ++ * sizeof (*di.subs)); + + dc = cplus_demangle_mangled_name (&di, 1); + +@@ -6640,6 +6612,8 @@ is_ctor_or_dtor (const char *mangled, + } + } + ++ free (di.comps); ++ free (di.subs); + return ret; + } + +diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c +index e3f9f920..5dbe6f89 100644 +--- a/libiberty/make-relative-prefix.c ++++ b/libiberty/make-relative-prefix.c +@@ -259,10 +259,7 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix, + #ifdef HAVE_HOST_EXECUTABLE_SUFFIX + len += strlen (HOST_EXECUTABLE_SUFFIX); + #endif +- if (len < MAX_ALLOCA_SIZE) +- nstore = (char *) alloca (len); +- else +- alloc_ptr = nstore = (char *) malloc (len); ++ alloc_ptr = nstore = (char *) malloc (len); + + startp = endp = temp; + while (1) diff --git a/SPECS/cross-binutils.spec b/SPECS/cross-binutils.spec new file mode 100644 index 0000000..df64273 --- /dev/null +++ b/SPECS/cross-binutils.spec @@ -0,0 +1,1179 @@ +%global cross cross +%global rpmprefix %{nil} + +%global build_all 1 +%global build_aarch64 %{build_all} +%global build_alpha %{build_all} +%global build_arc %{build_all} +%global build_arm %{build_all} +%global build_avr32 %{build_all} +%global build_blackfin %{build_all} +%global build_c6x %{build_all} +%global build_cris %{build_all} +%global build_frv %{build_all} +%global build_h8300 %{build_all} +%global build_hppa %{build_all} +%global build_hppa64 %{build_all} +%global build_ia64 %{build_all} +%global build_m32r %{build_all} +%global build_m68k %{build_all} +%global build_metag %{build_all} +%global build_microblaze %{build_all} +%global build_mips64 %{build_all} +%global build_mn10300 %{build_all} +%global build_nios2 %{build_all} +%global build_openrisc %{build_all} +%global build_powerpc64 %{build_all} +%global build_powerpc64le %{build_all} +%global build_riscv64 %{build_all} +%global build_s390x %{build_all} +%global build_score %{build_all} +%global build_sh %{build_all} +%global build_sparc64 %{build_all} +%global build_tile %{build_all} +%global build_x86_64 %{build_all} +%global build_xtensa %{build_all} + +# 32-bit packages we don't build as we can use the 64-bit package instead +%global build_i386 0 +%global build_mips 0 +%global build_powerpc 0 +%global build_s390 0 +%global build_sparc 0 +%global build_sh4 0 + +# not available in binutils-2.27 +%global build_hexagon 0 +%global build_unicore32 0 + +# Do not create deterministic archives by default (cf: BZ 1195883) +%global enable_deterministic_archives 0 + +# Disable the default generation of compressed debug sections. +%define default_compress_debug 0 + +# Default to read-only-relocations (relro) in shared binaries. +%define default_relro 1 + +# Disable the default generation of GNU Build notes by the assembler. +# This has turned out to be problematic for the i686 architecture. +# although the exact reason has not been determined. (See BZ 1572485) +# It also breaks building EFI binaries on AArch64, as these cannot have +# relocations against absolute symbols. +%define default_generate_notes 0 + +Name: %{cross}-binutils +Version: 2.35.2 +Release: 1%{?dist} +Summary: A GNU collection of cross-compilation binary utilities +License: GPLv3+ +URL: https://sourceware.org/binutils + +# Note - the Linux Kernel binutils releases are too unstable and contain too +# many controversial patches so we stick with the official FSF version +# instead. + +Source: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz + +Source2: binutils-2.19.50.0.1-output-format.sed + +#---------------------------------------------------------------------------- + +# Purpose: Use /lib64 and /usr/lib64 instead of /lib and /usr/lib in the +# default library search path of 64-bit targets. +# Lifetime: Permanent, but it should not be. This is a bug in the libtool +# sources used in both binutils and gcc, (specifically the +# libtool.m4 file). These are based on a version released in 2009 +# (2.2.6?) rather than the latest version. (Definitely fixed in +# libtool version 2.4.6). +Patch01: binutils-2.20.51.0.2-libtool-lib64.patch + +# Purpose: Appends a RHEL or Fedora release string to the generic binutils +# version string. +# Lifetime: Permanent. This is a RHEL/Fedora specific patch. +Patch02: binutils-2.25-version.patch + +# Purpose: Exports the demangle.h header file (associated with the libiberty +# sources) with the binutils-devel rpm. +# Lifetime: Permanent. This is a RHEL/Fedora specific patch. +Patch03: binutils-export-demangle.h.patch + +# Purpose: Disables the check in the BFD library's bfd.h header file that +# config.h has been included before the bfd.h header. See BZ +# #845084 for more details. +# Lifetime: Permanent - but it should not be. The bfd.h header defines +# various types that are dependent upon configuration options, so +# the order of inclusion is important. +# FIXME: It would be better if the packages using the bfd.h header were +# fixed so that they do include the header files in the correct +# order. +Patch04: binutils-2.22.52.0.4-no-config-h-check.patch + +# Purpose: Include the filename concerned in readelf error messages. This +# makes readelf's output more helpful when it is run on multiple +# input files. +# Lifetime: Permanent. This patch changes the format of readelf's output, +# making it better (IMHO) but also potentially breaking tools that +# depend upon readelf's current format. Hence it remains a local +# patch. +Patch05: binutils-2.29-filename-in-error-messages.patch + +# Purpose: Disable an x86/x86_64 optimization that moves functions from the +# PLT into the GOTPLT for faster access. This optimization is +# problematic for tools that want to intercept PLT entries, such +# as ltrace and LD_AUDIT. See BZs 1452111 and 1333481. +# Lifetime: Permanent. But it should not be. +# FIXME: Replace with a configure time option. +Patch06: binutils-2.29-revert-PLT-elision.patch + +# Purpose: Changes readelf so that when it displays extra information about +# a symbol, this information is placed at the end of the line. +# Lifetime: Permanent. +# FIXME: The proper fix would be to update the scripts that are expecting +# a fixed output from readelf. But it seems that some of them are +# no longer being maintained. +Patch07: binutils-readelf-other-sym-info.patch + +# Purpose: Do not create PLT entries for AARCH64 IFUNC symbols referenced in +# debug sections. +# Lifetime: Permanent. +# FIXME: Find related bug. Decide on permanency. +Patch08: binutils-2.27-aarch64-ifunc.patch + +# Purpose: Stop the binutils from statically linking with libstdc++. +# Lifetime: Permanent. +Patch09: binutils-do-not-link-with-static-libstdc++.patch + +# Purpose: Add a .attach_to_group pseudo-op to the assembler for +# use by the annobin gcc plugin. +# Lifetime: Permanent. +Patch10: binutils-attach-to-group.patch + +# Purpose: Allow OS specific sections in section groups. +# Lifetime: Fixed in 2.36 (maybe) +Patch11: binutils-special-sections-in-groups.patch + +# Purpose: Fix linker testsuite failures. +# Lifetime: Fixed in 2.36 (maybe) +Patch12: binutils-fix-testsuite-failures.patch + +# Purpose: Stop gold from aborting when input sections with the same name +# have different flags. +# Lifetime: Fixed in 2.36 (maybe) +Patch13: binutils-gold-mismatched-section-flags.patch + +# Purpose: Add a check to the GOLD linker for a corrupt input file +# with a fuzzed section offset. +# Lifetime: Fixed in 2.36 (maybe) +Patch14: binutils-CVE-2019-1010204.patch + +# Purpose: Change the gold configuration script to only warn about +# unsupported targets. This allows the binutils to be built with +# BPF support enabled. +# Lifetime: Permanent. +Patch15: binutils-gold-warn-unsupported.patch + +# Purpose: Fix compile time warning messages building s390 target with gcc-10. +# Lifetime: Should be fixed in 2.36. +Patch16: binutils-s390-build.patch + +# Purpose: Fix LTO problems running config mini-builds. +# Lifetime: Should be fixed in 2.36. +Patch17: binutils-config.patch + +# Purpose: Fix compile time warning messages building with gcc-10. +# Lifetime: Should be fixed in 2.36. +Patch18: binutils-warnings.patch + +# Purpose: Fix compile time warning messages building with gcc-10. (part 2). +# Lifetime: Should be fixed in 2.36. +Patch19: binutils-gcc-10-fixes.patch + +# Purpose: Fixes for linking LTO objects. +# Lifetime: Fixed in 2.36 +Patch20: binutils-add-sym-cache-to-elf-link-hash.patch +Patch21: binutils-elf-add-objects.patch + +# Purpose: Fix handling of relocations for AArch64 conditional branches. +# Lifetime: Fixed in 2.36 +Patch22: binutils-aarch64-condbranch-relocs.patch + +# Purpose: Fix the PowerPC disassembler so that it ignores annobin symbols. +# Lifetime: Fixed in 2.36 +Patch23: binutils-ppc-annobin-disassembly.patch + +# Purpose: Fix the strip program to cope when merging multiple same-named +# sections. +# Lifetime: Fixed in 2.36 +Patch24: binutils-strip-merge.patch + +# Purpose: Fix various problems with the PowerPC arch10 extensions. +# Lifetime: Fixed in 2.36 +# Patch25: binutils-Power10-fixes.patch + +# Purpose: Allow plugin syms to mark as-needed shared libs needed. +# Lifetime: Fixed in 2.36 +Patch26: binutils-plugin-as-needed.patch + +# Purpose: Recursively follow .gnu_debuglink and .gnu_debugaltlink sections. +# Lifetime: Fixed in 2.36 +Patch27: binutils-recursive-debuglink-following.patch + +# Purpose: Correctly handle mixed SHF_LINK_ORDER and non-SHF_LINK_ORDER sections. +# Lifetime: Fixed in 2.36 +Patch28: binutils-SHF_LINK_ORDER.patch + +# Purpose: Correctly handle multiple same-named sections in linker scripts +# Lifetime: Fixed in 2.36 +Patch29: binutils-duplicate-sections.patch + +# Purpose: Use the "unsigned long long" type for pointers on hosts where +# long is a 32-bit type but pointers are a 64-bit type. Necessary +# because users expect to be able to install both the i686- and +# x86_64 versions of binutils-devel on the same machine, so they +# need to identical versions of the bfd.h header file. +# Lifetime: Permanent. +Patch30: binutils-use-long-long.patch + +# Purpose: Update the GOLD linker to support x86 .note.gnu.property sections. +# Lifetime: Fixed in 2.36 +Patch31: binutils-gold-gnu-properties.patch + +# Purpose: Fix FAIL results in gas and ld testsuites. +# Lifetime: Fixed in 2.36 +Patch32: binutils-testsuite-failures.patch + +# Purpose: Remove a vulnerability in the smart_rename function. +# Lifetime: Fixed in 2.36 +Patch33: binutils-CVE-2021-20197.patch + +# Purpose: Add DWARF-5 sections to linker scripts. +# Lifetime: Fixed in 2.37 +Patch34: binutils-ld-DWARF-5-sections.patch + +# Purpose: Add support for Z instruction set extensions to the s390x +# architecture. +# Lifetime: Fixed in 2.37 +Patch35: binutils-s390-arch14-insns.patch + +# Purpose: Fix merging empty ppc64le notes. +# Lifetime: Fixed in 2.37 +Patch36: binutils-ppc64le-note-merge.patch + +# Purpose: Stop readelf from warning about gaps in build notes. +# Lifetime: Fixed in 2.37 ? +Patch37: binutils-readelf-no-warn-gaps.patch + +# Purpose: Stop readelf from complaining about an unexpected form 20. +# Lifetime: Fixed in 2.37 +Patch38: binutils-unexpected-form-20.patch + +# Purpose: Prevent an illegal memory access when reading relocations +# for secondary reloc sections. +# Lifetime: Fixed in 2.36 +Patch39: binutils-CVE-2021-20284.patch + +# Purpose: Bring in some bug fixes for Z14 support. +# Lifetime: Fixed in 2.36 +Patch40: binutils-extend-s390-arch14-support.patch + +# Purpose: Fix excessive memory consumption when attempting to parse corrupt +# DWARF debug information. +# Lifetime: Fixed in 2.36 +Patch41: binutils-CVE-2021-3487.patch + +# Purpose: Fix illegal memory access when parsing corrupt ELF files. +# Lifetime: Fixed in 2.36 +Patch42: binutils-CVE-2020-35448.patch + +# Purpose: Ensure that the 0'th entry in DWARF-5 directory tables generated +# by gas contains the current working directory. +# Lifetime: Fixed in 2.38 +Patch43: binutils-dwarf-5-dir0.patch + +#---------------------------------------------------------------------------- + +BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel +# BZ 920545: We need pod2man in order to build the manual pages. +BuildRequires: /usr/bin/pod2man +# Perl, sed and touch are all used in the %prep section of this spec file. +BuildRequires: gcc, perl-interpreter, sed, coreutils +BuildRequires: findutils +BuildRequires: autoconf automake +BuildRequires: make + +Provides: bundled(libiberty) + +%description +Binutils is a collection of binary utilities, including ar (for +creating, modifying and extracting from archives), as (a family of GNU +assemblers), gprof (for displaying call graph profile data), ld (the +GNU linker), nm (for listing symbols from object files), objcopy (for +copying and translating object files), objdump (for displaying +information from object files), ranlib (for generating an index for +the contents of an archive), readelf (for displaying detailed +information about binary files), size (for listing the section sizes +of an object or archive file), strings (for listing printable strings +from files), strip (for discarding symbols), and addr2line (for +converting addresses to file and line). + +%package -n %{cross}-binutils-common +Summary: Cross-build binary utility documentation and translation files +BuildArch: noarch +%description -n %{cross}-binutils-common +Documentation, manual pages and translation files for cross-build binary image +generation, manipulation and query tools. + +%global do_package() \ +%if %2 \ +%package -n %{rpmprefix}binutils-%1 \ +Summary: Cross-build binary utilities for %1 \ +Requires: %{cross}-binutils-common == %{version}-%{release} \ +%description -n %{rpmprefix}binutils-%1 \ +Cross-build binary image generation, manipulation and query tools. \ +%endif + +%global do_symlink() \ +%if %2 \ +%package -n %{rpmprefix}binutils-%1 \ +Summary: Cross-build binary utilities for %1 \ +Requires: binutils-%3 == %{version}-%{release} \ +%description -n %{rpmprefix}binutils-%1 \ +Cross-build binary image generation, manipulation and query tools. \ +%endif + +%do_package aarch64-linux-gnu %{build_aarch64} +%do_package alpha-linux-gnu %{build_alpha} +%do_package arc-linux-gnu %{build_arc} +%do_package arm-linux-gnu %{build_arm} +%do_package avr32-linux-gnu %{build_avr32} +%do_package bfin-linux-gnu %{build_blackfin} +%do_package c6x-linux-gnu %{build_c6x} +%do_package cris-linux-gnu %{build_cris} +%do_package frv-linux-gnu %{build_frv} +%do_package h8300-linux-gnu %{build_h8300} +%do_package hexagon-linux-gnu %{build_hexagon} +%do_package hppa-linux-gnu %{build_hppa} +%do_package hppa64-linux-gnu %{build_hppa64} +%do_package i386-linux-gnu %{build_i386} +%do_package ia64-linux-gnu %{build_ia64} +%do_package m32r-linux-gnu %{build_m32r} +%do_package m68k-linux-gnu %{build_m68k} +%do_package metag-linux-gnu %{build_metag} +%do_package microblaze-linux-gnu %{build_microblaze} +%do_package mips-linux-gnu %{build_mips} +%do_package mips64-linux-gnu %{build_mips64} +%do_package mn10300-linux-gnu %{build_mn10300} +%do_package nios2-linux-gnu %{build_nios2} +%do_package openrisc-linux-gnu %{build_openrisc} or1k-linux-gnu +%do_package powerpc-linux-gnu %{build_powerpc} +%do_package powerpc64-linux-gnu %{build_powerpc64} +%do_package powerpc64le-linux-gnu %{build_powerpc64le} +%do_symlink ppc-linux-gnu %{build_powerpc} powerpc-linux-gnu +%do_symlink ppc64-linux-gnu %{build_powerpc64} powerpc64-linux-gnu +%do_symlink ppc64le-linux-gnu %{build_powerpc64le} powerpc64le-linux-gnu +%do_package riscv64-linux-gnu %{build_riscv64} +%do_package s390-linux-gnu %{build_s390} +%do_package s390x-linux-gnu %{build_s390x} +%do_package score-linux-gnu %{build_score} +%do_package sh-linux-gnu %{build_sh} +%do_package sh4-linux-gnu %{build_sh4} +%do_package sparc-linux-gnu %{build_sparc} +%do_package sparc64-linux-gnu %{build_sparc64} +%do_package tile-linux-gnu %{build_tile} +%do_package unicore32-linux-gnu %{build_unicore32} +%do_package x86_64-linux-gnu %{build_x86_64} +%do_package xtensa-linux-gnu %{build_xtensa} + +# Where the binaries aimed at gcc will live (ie. /usr//bin/) +%global auxbin_prefix %{_exec_prefix} + +############################################################################### +# +# Preparation +# +############################################################################### +%prep +%global srcdir binutils-%{version} +%setup -q -n %{srcdir} -c +cd %{srcdir} +%patch01 -p1 +%patch02 -p1 +%patch03 -p1 +%patch04 -p1 +%patch05 -p1 +%patch06 -p1 +%patch07 -p1 +%patch08 -p1 +%patch09 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +#patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 +%patch42 -p1 +%patch43 -p1 + +# We cannot run autotools as there is an exact requirement of autoconf-2.59. + +# On ppc64 and aarch64, we might use 64KiB pages +sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*ppc.c +sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*aarch64.c +sed -i -e '/common_pagesize/s/4 /64 /' gold/powerpc.cc +sed -i -e '/pagesize/s/0x1000,/0x10000,/' gold/aarch64.cc +# LTP sucks +perl -pi -e 's/i\[3-7\]86/i[34567]86/g' */conf* +sed -i -e 's/%''{release}/%{release}/g' bfd/Makefile{.am,.in} +sed -i -e '/^libopcodes_la_\(DEPENDENCIES\|LIBADD\)/s,$, ../bfd/libbfd.la,' opcodes/Makefile.{am,in} +# Build libbfd.so and libopcodes.so with -Bsymbolic-functions if possible. +if gcc %{optflags} -v --help 2>&1 | grep -q -- -Bsymbolic-functions; then +sed -i -e 's/^libbfd_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' bfd/Makefile.{am,in} +sed -i -e 's/^libopcodes_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' opcodes/Makefile.{am,in} +fi +# $PACKAGE is used for the gettext catalog name. +sed -i -e 's/^ PACKAGE=/ PACKAGE=%{cross}-/' */configure +# Undo the name change to run the testsuite. +for tool in binutils gas ld +do + sed -i -e "2aDEJATOOL = $tool" $tool/Makefile.am + sed -i -e "s/^DEJATOOL = .*/DEJATOOL = $tool/" $tool/Makefile.in +done +touch */configure + +function prep_target () { + target=$1 + cond=$2 + + if [ $cond != 0 ] + then + echo $1 >&5 + fi +} + +cd .. +( + prep_target aarch64-linux-gnu %{build_aarch64} + prep_target alpha-linux-gnu %{build_alpha} + prep_target arc-linux-gnu %{build_arc} + prep_target arm-linux-gnu %{build_arm} + prep_target avr32-linux-gnu %{build_avr32} + prep_target bfin-linux-gnu %{build_blackfin} + prep_target c6x-linux-gnu %{build_c6x} + prep_target cris-linux-gnu %{build_cris} + prep_target frv-linux-gnu %{build_frv} + prep_target h8300-linux-gnu %{build_h8300} + prep_target hexagon-linux-gnu %{build_hexagon} + prep_target hppa-linux-gnu %{build_hppa} + prep_target hppa64-linux-gnu %{build_hppa64} + prep_target i386-linux-gnu %{build_i386} + prep_target ia64-linux-gnu %{build_ia64} + prep_target m32r-linux-gnu %{build_m32r} + prep_target m68k-linux-gnu %{build_m68k} + prep_target metag-linux-gnu %{build_metag} + prep_target microblaze-linux-gnu %{build_microblaze} + prep_target mips-linux-gnu %{build_mips} + prep_target mips64-linux-gnu %{build_mips64} + prep_target mn10300-linux-gnu %{build_mn10300} + prep_target nios2-linux-gnu %{build_nios2} + prep_target openrisc-linux-gnu %{build_openrisc} + prep_target powerpc-linux-gnu %{build_powerpc} + prep_target powerpc64-linux-gnu %{build_powerpc64} + prep_target powerpc64le-linux-gnu %{build_powerpc64le} + prep_target riscv64-linux-gnu %{build_riscv64} + prep_target s390-linux-gnu %{build_s390} + prep_target s390x-linux-gnu %{build_s390x} + prep_target score-linux-gnu %{build_score} + prep_target sh-linux-gnu %{build_sh} + prep_target sh4-linux-gnu %{build_sh4} + prep_target sparc-linux-gnu %{build_sparc} + prep_target sparc64-linux-gnu %{build_sparc64} + prep_target tile-linux-gnu %{build_tile} + prep_target unicore32-linux-gnu %{build_unicore32} + prep_target x86_64-linux-gnu %{build_x86_64} + prep_target xtensa-linux-gnu %{build_xtensa} +) 5>target.list + +n=0 +for target in `cat target.list` +do + n=1 + break +done +if [ $n = 0 ] +then + echo "No targets selected" >&2 + exit 8 +fi + +############################################################################### +# +# Build +# +############################################################################### +%build + +function config_target () { + arch=$1 + prefix=$arch- + build_dir=${1%%%%-*} + + case $arch in + aarch64-*) target=aarch64-linux-gnu;; + arc-*) target=arc-linux-gnu;; + arm-*) target=arm-linux-gnueabi;; + avr32-*) target=avr-linux;; + bfin-*) target=bfin-uclinux;; + c6x-*) target=c6x-uclinux;; + h8300-*) target=h8300-elf;; + m32r-*) target=m32r-elf;; + mn10300-*) target=am33_2.0-linux;; + m68knommu-*) target=m68k-linux;; + openrisc-*) target=or1k-linux-gnu;; + parisc-*) target=hppa-linux;; + score-*) target=score-elf;; + tile-*) target=tilegx-linux;; + v850-*) target=v850e-linux;; + x86-*) target=x86_64-linux;; + *) target=$arch;; + esac + + echo $arch: target is $target + export CFLAGS="$RPM_OPT_FLAGS -Wno-unused-const-variable" + CARGS= + + case $target in i?86*|sparc*|ppc*|s390*|sh*|arm*|aarch64*|riscv*) + CARGS="$CARGS --enable-64-bit-bfd" + ;; + esac + + case $target in ia64*) + CARGS="$CARGS --enable-targets=i386-linux" + ;; + esac + + case $target in ppc*|ppc64*) + CARGS="$CARGS --enable-targets=spu" + ;; + esac + + case $target in ppc64-*) + CARGS="$CARGS --enable-targets=powerpc64le-linux" + ;; + esac + + case $target in sh-*) + CARGS="$CARGS --enable-targets=sh-linux,sh4-linux" + # sh-elf is dropped for now as it makes for ambiguity in format recognition + ;; + esac + + case $target in x86_64*|i?86*|arm*|aarch64*|riscv*) + CARGS="$CARGS --enable-targets=x86_64-pep" + ;; + esac + +%if %{default_relro} + CARGS="$CARGS --enable-relro=yes" +%else + CARGS="$CARGS --enable-relro=no" +%endif + + mkdir $build_dir + cd $build_dir + + # We could optimize the cross builds size by --enable-shared but the produced + # binaries may be less convenient in the embedded environment. + echo LDFLAGS: $RPM_LD_FLAGS + LDFLAGS="$RPM_LD_FLAGS " \ + ../%{srcdir}/configure \ + --disable-dependency-tracking \ + --disable-silent-rules \ + --enable-checking \ + --prefix=%{_prefix} \ + --exec-prefix=%{auxbin_prefix} \ + --bindir=%{_bindir} \ + --sbindir=%{_sbindir} \ + --sysconfdir=%{_sysconfdir} \ + --datadir=%{_datadir} \ + --includedir=%{_includedir} \ + --libdir=%{_libdir} \ + --libexecdir=%{_libexecdir} \ + --localstatedir=%{_localstatedir} \ + --sharedstatedir=%{_sharedstatedir} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} \ + --build=%{_target_platform} \ + --host=%{_target_platform} \ + --target=$target \ + --program-prefix=$prefix \ + --disable-shared \ + --disable-install_libbfd \ + --with-sysroot=%{_prefix}/$arch/sys-root \ +%if %{enable_deterministic_archives} + --enable-deterministic-archives \ +%else + --enable-deterministic-archives=no \ +%endif +%if %{default_compress_debug} + --enable-compressed-debug-sections=all \ +%else + --enable-compressed-debug-sections=none \ +%endif +%if %{default_generate_notes} + --enable-generate-build-notes=yes \ +%else + --enable-generate-build-notes=no \ +%endif + --enable-lto \ + $CARGS \ + --enable-plugins \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla/ + cd .. +} + +# Dependencies are not set up to rebuild the configure files +# in the subdirectories. So we just rebuild the ones we care +# about after applying the configure patches +pushd %{srcdir}/libiberty +autoconf -f +popd +pushd %{srcdir}/intl +autoconf -f +popd + +for target in `cat target.list` +do + config_target $target +done + +function build_target () { + build_dir=${1%%%%-*} + %make_build -C $build_dir tooldir=%{_prefix} all +} + +for target in `cat target.list` +do + build_target $target +done + +# for documentation purposes only +mkdir %{cross}-binutils +cd %{cross}-binutils +../%{srcdir}/configure \ + --disable-dependency-tracking \ + --disable-silent-rules \ + --prefix=%{_prefix} \ + --exec-prefix=%{auxbin_prefix} \ + --bindir=%{_bindir} \ + --sbindir=%{_sbindir} \ + --sysconfdir=%{_sysconfdir} \ + --datadir=%{_datadir} \ + --includedir=%{_includedir} \ + --libdir=%{_libdir} \ + --libexecdir=%{_libexecdir} \ + --localstatedir=%{_localstatedir} \ + --sharedstatedir=%{_sharedstatedir} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} \ + --program-prefix=%{cross}- \ + --disable-shared \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla/ +%make_build tooldir=%{_prefix} all +cd .. + +############################################################################### +# +# Installation +# +############################################################################### +%install +function install_bin () { + cpu=${1%%%%-*} + build_dir=$cpu + %make_install -C $build_dir DESTDIR=%{buildroot} + + # We want links for ppc and ppc64 also if we make powerpc or powerpc64 + case $cpu in + powerpc*) + cd %{buildroot}/usr/bin + for i in $cpu-* + do + ln -s $i ppc${i#powerpc} + done + cd - + cd %{buildroot}/usr/ + for i in $cpu-* + do + ln -s $i ppc${i#powerpc} + done + cd - + cd %{buildroot}/usr/share/man/man1 + for i in $cpu-* + do + ln -s $i ppc${i#powerpc} + done + cd - + ;; + esac +} + +for target in `cat target.list` +do + echo "=== INSTALL target $target ===" + mkdir -p %{buildroot}%{_prefix}/$target/sys-root + install_bin $target + +done + +echo "=== INSTALL man targets ===" +make install-man1 -C %{cross}-binutils/binutils/doc DESTDIR=%{buildroot} +make install-man1 -C %{cross}-binutils/gas/doc DESTDIR=%{buildroot} +make install-man1 -C %{cross}-binutils/ld DESTDIR=%{buildroot} +make install-man1 -C %{cross}-binutils/gprof DESTDIR=%{buildroot} + +echo "=== INSTALL po targets ===" +%make_install -C %{cross}-binutils/binutils/po DESTDIR=%{buildroot} +%make_install -C %{cross}-binutils/gas/po DESTDIR=%{buildroot} +%make_install -C %{cross}-binutils/ld/po DESTDIR=%{buildroot} +%make_install -C %{cross}-binutils/gprof/po DESTDIR=%{buildroot} +%make_install -C %{cross}-binutils/bfd/po DESTDIR=%{buildroot} +%make_install -C %{cross}-binutils/opcodes/po DESTDIR=%{buildroot} + +# Add the additional symlink-only targets +grep ^powerpc target.list | sed -e s/powerpc/ppc/ >symlink-target.list +cat symlink-target.list >>target.list + +# For cross-binutils we drop the documentation. +echo "=== REMOVE documentation ===" +rm -rf %{buildroot}%{_infodir} +rm -f %{buildroot}%{_infodir}/dir + +echo "=== REMOVE libraries and scripts ===" +rm -rf %{buildroot}%{_libdir}/libiberty.a +rm -rf %{buildroot}%{auxbin_prefix}/*/lib/ldscripts +rmdir %{buildroot}%{auxbin_prefix}/*/lib || : + +echo "=== BUILD file lists ===" +function build_file_list () { + arch=$1 + cpu=${arch%%%%-*} + + case $cpu in + avr32) target_cpu=avr;; + bfin) target_cpu=bfin;; + h8300) target_cpu=h8300;; + mn10300) target_cpu=am33_2.0;; + openrisc) target_cpu=or1k;; + score) target_cpu=score;; + tile) target_cpu=tilegx;; + v850) target_cpu=v850e;; + *) target_cpu=$cpu;; + esac + + ( + echo %{_bindir}/$arch-[!l]\* + echo %{_bindir}/$arch-ld\* + echo %{_mandir}/man1/$arch-\* + echo %{auxbin_prefix}/$target_cpu-\* + ) >files.$arch +} + +for target in `cat target.list` +do + build_file_list $target +done + +# All the installed manual pages and translation files for each program are the +# same, so symlink them to the core package +echo "=== CROSSLINK man pages ===" +cd %{buildroot}%{_mandir}/man1 +for i in %{cross}-*.1* +do + j=${i#%{cross}-} + + for k in *-$j + do + if [ $k != $i ] + then + ln -sf $i $k + fi + done +done + + +# Add ld.bfd manual pages +find * -name "*ld.1*" -a ! -name "%{cross}-ld.1*" -print | +while read x +do + y=`echo $x | sed -e s/ld[.]1/ld.bfd.1/` + ln -s $x $y +done + +cd - + +# Find the language files which only exist in the common package +( + %find_lang %{cross}-binutils + %find_lang %{cross}-opcodes + %find_lang %{cross}-bfd + %find_lang %{cross}-gas + %find_lang %{cross}-ld + %find_lang %{cross}-gprof + cat %{cross}-binutils.lang + cat %{cross}-opcodes.lang + cat %{cross}-bfd.lang + cat %{cross}-gas.lang + cat %{cross}-ld.lang + cat %{cross}-gprof.lang +) >files.cross + + + +############################################################################### +# +# Cleanup +# +############################################################################### +############################################################################### +# +# Filesets +# +############################################################################### +%files -n %{cross}-binutils-common -f files.cross +%license %{srcdir}/COPYING* +%doc %{srcdir}/README +%{_mandir}/man1/%{cross}-* + +%global do_files() \ +%if %2 \ +%files -n %{rpmprefix}binutils-%1 -f files.%1 \ +%endif + +%do_files aarch64-linux-gnu %{build_aarch64} +%do_files alpha-linux-gnu %{build_alpha} +%do_files arc-linux-gnu %{build_arc} +%do_files arm-linux-gnu %{build_arm} +%do_files avr32-linux-gnu %{build_avr32} +%do_files bfin-linux-gnu %{build_blackfin} +%do_files c6x-linux-gnu %{build_c6x} +%do_files cris-linux-gnu %{build_cris} +%do_files frv-linux-gnu %{build_frv} +%do_files h8300-linux-gnu %{build_h8300} +%do_files hexagon-linux-gnu %{build_hexagon} +%do_files hppa-linux-gnu %{build_hppa} +%do_files hppa64-linux-gnu %{build_hppa64} +%do_files i386-linux-gnu %{build_i386} +%do_files ia64-linux-gnu %{build_ia64} +%do_files m32r-linux-gnu %{build_m32r} +%do_files m68k-linux-gnu %{build_m68k} +%do_files metag-linux-gnu %{build_metag} +%do_files microblaze-linux-gnu %{build_microblaze} +%do_files mips-linux-gnu %{build_mips} +%do_files mips64-linux-gnu %{build_mips64} +%do_files mn10300-linux-gnu %{build_mn10300} +%do_files nios2-linux-gnu %{build_nios2} +%do_files openrisc-linux-gnu %{build_openrisc} +%do_files powerpc-linux-gnu %{build_powerpc} +%do_files powerpc64-linux-gnu %{build_powerpc64} +%do_files powerpc64le-linux-gnu %{build_powerpc64le} +%do_files ppc-linux-gnu %{build_powerpc} +%do_files ppc64-linux-gnu %{build_powerpc64} +%do_files ppc64le-linux-gnu %{build_powerpc64le} +%do_files riscv64-linux-gnu %{build_riscv64} +%do_files s390-linux-gnu %{build_s390} +%do_files s390x-linux-gnu %{build_s390x} +%do_files score-linux-gnu %{build_score} +%do_files sh-linux-gnu %{build_sh} +%do_files sh4-linux-gnu %{build_sh4} +%do_files sparc-linux-gnu %{build_sparc} +%do_files sparc64-linux-gnu %{build_sparc64} +%do_files tile-linux-gnu %{build_tile} +%do_files unicore32-linux-gnu %{build_unicore32} +%do_files x86_64-linux-gnu %{build_x86_64} +%do_files xtensa-linux-gnu %{build_xtensa} + +%changelog +* Mon Aug 23 2021 Peter Robinson - 2.35.2-1 +- Update to binutils-2.35.2-5 + +* Sat Jul 24 2021 Peter Robinson - 2.35.1-6 +- Update to binutils-2.35.1-41.fc34 + +* Tue Jan 26 2021 Fedora Release Engineering - 2.35.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Dec 3 2020 Peter Robinson - 2.35.1-4 +- Sync to binutils-2.35.1-16 + +* Sun Nov 8 2020 Peter Robinson - 2.35.1-3 +- Sync to binutils 2.35.1-13 + +* Sat Oct 10 2020 Peter Robinson - 2.35.1-2 +- Sync to binutils 2.35.1-5 + +* Wed Sep 23 2020 Peter Robinson - 2.35.1-1 +- Sync to 2.35.1 + +* Fri Sep 04 2020 Peter Robinson - 2.35-4 +- Sync to binutils-2.35-12 + +* Sat Aug 01 2020 Fedora Release Engineering - 2.35-3 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 2.35-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sun Jul 26 2020 Peter Robinson - 2.35-1 +- Update to 2.35 + +* Mon Jul 20 2020 Jeff Law - 2.34-3 +- Fix configure tests compromised by LTO +- Work around diagnostics exposed by LTO + +* Thu Feb 27 2020 Peter Robinson - 2.34-2 +- Fix the plugin support architecture to allow proper symbol info handling. (PR 25355) + +* Mon Feb 3 2020 Peter Robinson 2.34-1 +- sync with binutils 2.34-1 +- Enable 64-bit BFD and PEP support for riscv. +- Improve the accuracy of addr2line. + +* Tue Jan 28 2020 Fedora Release Engineering - 2.33.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Jan 06 2020 Peter Robinson - 2.33.1-2 +- sync with binutils 2.33.1-11 + +* Tue Oct 15 2019 Peter Robinson 2.33.1-1 +- Sync with binutils-2.33.1-1 + +* Tue Aug 27 2019 Peter Robinson 2.32-3 +- Sync with binutils-2.32-24 + +* Wed Jul 24 2019 Fedora Release Engineering - 2.32-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun May 26 2019 Peter Robinson 2.32-1 +- Sync with binutils-2.32-14 + +* Sun May 26 2019 Peter Robinson 2.31.1-3 +- Sync with binutils-2.31.1-31 + +* Thu Jan 31 2019 Fedora Release Engineering - 2.31.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Nov 6 2018 Tom Callaway - 2.31.1-1 +- update to 2.31.1 + +* Thu Jul 12 2018 Fedora Release Engineering - 2.30-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Jul 11 2018 David Howells - 2.30-5 +- Switch ARC to arc-linux-gnu (#1600183). + +* Tue Jul 10 2018 David Howells - 2.30-4 +- Sync with binutils-2.30-26. +- Add support for the ARC arch (#1599744). + +* Thu Jun 28 2018 David Howells - 2.30-3 +- Fix ppc* symlink packages inclusion of files from the powerpc* packages. +- Sync with binutils-2.30-24. + +* Tue May 29 2018 David Howells - 2.30-2 +- Sync with binutils-2.30-21. + +* Fri Mar 30 2018 David Howells - 2.30-1 +- Sync with binutils-2.30-14. + +* Wed Feb 14 2018 David Howells - 2.29.1-4 +- Sync with binutils-2.29.1-19. + +* Fri Feb 09 2018 Igor Gnatenko - 2.29.1-3 +- Escape macros in %%changelog + +* Wed Feb 07 2018 Fedora Release Engineering - 2.29.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Nov 6 2017 David Howells - 2.29.1-1 +- Sync with binutils-2.29.1-4. +- Add support for riscv64 arch (#1491955). + +* Wed Aug 02 2017 Fedora Release Engineering - 2.29-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.29-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Jul 25 2017 David Howells - 2.29-1 +- Sync with binutils-2.29-1. + +* Mon Jun 26 2017 David Howells - 2.28-3 +- Sync with binutils-2.28-9. + +* Tue May 16 2017 David Howells - 2.28-2 +- Sync with binutils-2.28-6. + +* Wed Mar 15 2017 David Howells - 2.28-1 +- Sync with binutils-2.28-4. + +* Mon Feb 6 2017 David Howells - 2.27-6 +- Sync with binutils-2.27-16. +- Install COPYING[*] files using the %%license macro. + +* Wed Dec 14 2016 Merlin Mathesius - 2.27-5 +- Import upstream xtensa bug fix causing cross-gcc FTBFS (BZ#1404857). + +* Fri Dec 9 2016 David Howells - 2.27-4 +- Sync with binutils-2.27-12. + +* Thu Sep 15 2016 David Howells - 2.27-3 +- Added version to obsoletion of sh64. +- Fix changelog date. + +* Wed Sep 14 2016 David Howells - 2.27-1 +- Sync with binutils-2.27-4. +- Obsolete sh64. + +* Mon Jul 4 2016 David Howells - 2.26.1-1 +- Sync with binutils-2.26.1-1. + +* Tue May 10 2016 David Howells - 2.26-8 +- Sync with binutils-2.26-21. +- arm: Fix uninitialised variable in arm build (#1333695). + +* Wed May 4 2016 David Howells - 2.26-7 +- Sync with binutils-2.26-20. + +* Fri Feb 19 2016 David Howells - 2.26-6 +- Sync with binutils-2.26-12. + +* Thu Feb 11 2016 David Howells - 2.26-5 +- Sync with binutils-2.26-10. +- c6x: Handle inconsistent .cfi_sections directives [binutils bz 19614]. + +* Mon Feb 8 2016 David Howells - 2.26-4 +- SH: Drop sh-elf support to avoid ambiguity errors in target selection (#1296814). + +* Fri Feb 5 2016 David Howells - 2.26-3 +- Sync with binutils-2.26-8. +- Microblaze: Fix binutils compilation on 32-bit arch. + +* Tue Jan 26 2016 David Howells - 2.26-1 +- Sync with binutils-2.26-2. + +* Mon Aug 24 2015 David Howells - 2.25.1-1 +- Sync with binutils-2.25.1-4. +- Set --enable-targets if the target is powerpc* not just ppc*. +- Provide LE ppc and ppc64 emulations [BZ 1255947]. + +* Mon Apr 6 2015 David Howells - 2.25-4 +- Microblaze: Fix extra-large constant handling [binutils bz 18189]. + +* Wed Jan 7 2015 David Howells - 2.25-3 +- Fix up the target for SH64 and cease mixing 32-bit SH targets with SH64. +- SH64: Work around flags not getting set on incremental link of .a into .o [binutils bz 17288]. + +* Mon Jan 5 2015 David Howells - 2.25-1 +- Sync with binutils-2.25 to pick up fixes. + Resolves: BZ #1162577, #1162601, #1162611, #1162625 + +* Thu Nov 13 2014 David Howells - 2.24-7 +- Fix problems with the ar program reported in FSF PR 17533. + Resolves: BZ #1162672, #1162659 + +* Wed Nov 12 2014 David Howells - 2.24-6 +- Sync with binutils to pick up fixes. +- Backport binutils 2.4 upstream branch to pick up more fixes. + +* Sat Aug 16 2014 Fedora Release Engineering - 2.24-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Jul 18 2014 David Howells - 2.24-5 +- Add NIOS2 arch support. + +* Mon Jun 16 2014 David Howells - 2.24-4 +- Fix gcc-4.9 new compile error in m68k handler in gas. + +* Wed Jun 11 2014 David Howells - 2.24-4 +- Sync with binutils-2.24-15 fixing the bfd_set_section_alignment() error [BZ 1106093] +- Apply the changes on binutils-2_24-branch in git to cab6c3ee9785f072a373afe31253df0451db93cf. + +* Fri Mar 28 2014 David Howells - 2.24-2 +- A sysroot of / is bad, so make it /usr//sys-root/. + +* Thu Mar 27 2014 David Howells - 2.24-1 +- Fix formatless sprintfs in Score. + +* Wed Mar 26 2014 David Howells - 2.24-1 +- Update to binutils-2.24-1. +- Add metag arch support. + +* Fri Aug 9 2013 David Howells - 2.23.88.0.1-2 +- Fix a build error in xtensa + +* Thu Aug 8 2013 David Howells - 2.23.88.0.1-2 +- Backport S390 .machinemode pseudo-op support from binutils-2.23.88.0.1-10. +- Add pod2man as a build requirement. + +* Tue Jun 4 2013 David Howells - 2.23.88.0.1-1 +- Update to binutils-2.22.88.0.1 to fix F19 texinfo issues [BZ 912921]. + +* Tue Jun 4 2013 David Howells - 2.23.51.0.3-2 +- Backport cleanups from the RHEL-6.4 cross-compiler. +- Backport some macroisation from the RHEL-6.4 cross-compiler. +- The hppa64 target cannot actually build hppa, so provide hppa [BZ 892220]. + +* Wed Feb 13 2013 Fedora Release Engineering - 2.23.51.0.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Nov 2 2012 David Howells - 2.23.51.0.3-1 +- Update to binutils-2.23.51.0.3. +- Added support for aarch64. + +* Mon Oct 15 2012 Jon Ciesla - 2.22.52.0.3-4 +- Provides: bundled(libiberty) + +* Wed Jul 18 2012 Fedora Release Engineering - 2.22.52.0.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jul 11 2012 Dan HorĂ¡k - 2.22.52.0.3-2 +- don't install libbfd/libopcode when host == target (eg. on s390x) + +* Wed May 30 2012 David Howells - 2.22.52.0.3-1 +- Update to binutils-2.22.52.0.3. +- Fixed a warning in the assembler for h8300 that caused the build to fail. + +* Thu Mar 22 2012 David Howells - 2.22.52.0.1-8.1 +- Initial import of cross-binutils [BZ 761619]. + +* Wed Mar 07 2012 Jakub Jelinek - 2.22.52.0.1-8 +- Fix up handling of hidden ifunc relocs on x86_64 +- Add Intel TSX support