commit 799dcf4a6c41bef019c809ca5a57d778dfef2a03 Author: CentOS Sources Date: Tue Feb 4 03:38:29 2020 -0500 import binutils-2.30-58.el8_1.1 diff --git a/.binutils.metadata b/.binutils.metadata new file mode 100644 index 0000000..074d28a --- /dev/null +++ b/.binutils.metadata @@ -0,0 +1,2 @@ +574d3b5650413d6ee65195a4f5ecbddc3a38f718 SOURCES/binutils-2.30.tar.xz +d3e5c9fc829ed40648110da6fe46c2fb1ed8aadb SOURCES/standards.info.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3ce3d88 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/binutils-2.30.tar.xz +SOURCES/standards.info.gz 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.1-export-demangle.h.patch b/SOURCES/binutils-2.22.52.0.1-export-demangle.h.patch new file mode 100644 index 0000000..84f82cd --- /dev/null +++ b/SOURCES/binutils-2.22.52.0.1-export-demangle.h.patch @@ -0,0 +1,21 @@ +--- a/bfd/Makefile.am 2012-03-06 14:00:33.229957572 +0000 ++++ b/bfd/Makefile.am 2012-04-27 16:46:05.410974817 +0100 +@@ -18,7 +18,7 @@ + bfdlibdir = @bfdlibdir@ + bfdincludedir = @bfdincludedir@ + bfdlib_LTLIBRARIES = libbfd.la +-bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h ++bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h + else !INSTALL_LIBBFD + # Empty these so that the respective installation directories will not be created. + bfdlibdir = +--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:23:35.054721634 +0000 ++++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:25:59.292607840 +0000 +@@ -350,6 +350,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@ $(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-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-set-long-long.patch b/SOURCES/binutils-2.25-set-long-long.patch new file mode 100644 index 0000000..1ea7418 --- /dev/null +++ b/SOURCES/binutils-2.25-set-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-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.26-lto.patch b/SOURCES/binutils-2.26-lto.patch new file mode 100644 index 0000000..c030f71 --- /dev/null +++ b/SOURCES/binutils-2.26-lto.patch @@ -0,0 +1,2439 @@ +diff -rup binutils-2.26.orig/bfd/bfd.c binutils-2.26/bfd/bfd.c +--- binutils-2.26.orig/bfd/bfd.c 2016-02-19 09:35:36.231000625 +0000 ++++ binutils-2.26/bfd/bfd.c 2016-02-19 09:35:54.901106498 +0000 +@@ -57,6 +57,14 @@ CODE_FRAGMENT + . bfd_byte data[1]; + . }; + . ++.enum bfd_lto_object_type ++. { ++. lto_non_object, ++. lto_non_ir_object, ++. lto_ir_object, ++. lto_mixed_object ++. }; ++. + .struct bfd + .{ + . {* The filename the application opened the BFD with. *} +@@ -227,6 +235,9 @@ CODE_FRAGMENT + . {* Set if this is a plugin output file. *} + . unsigned int lto_output : 1; + . ++. {* LTO object type. *} ++. ENUM_BITFIELD (bfd_lto_object_type) lto_type : 2; ++. + . {* Set to dummy BFD created when claimed by a compiler plug-in + . library. *} + . bfd *plugin_dummy_bfd; +@@ -252,6 +263,9 @@ CODE_FRAGMENT + . {* The last section on the section list. *} + . struct bfd_section *section_last; + . ++. {* The object-only section on the section list. *} ++. struct bfd_section *object_only_section; ++. + . {* The number of sections. *} + . unsigned int section_count; + . +@@ -2270,3 +2284,36 @@ bfd_convert_section_contents (bfd *ibfd, + *ptr_size = size; + return TRUE; + } ++ ++/* ++FUNCTION ++ bfd_group_signature ++ ++SYNOPSIS ++ asymbol *bfd_group_signature (asection *group, asymbol **isympp); ++ ++DESCRIPTION ++ Return a pointer to the symbol used as a signature for GROUP. ++*/ ++ ++asymbol * ++bfd_group_signature (asection *group, asymbol **isympp) ++{ ++ bfd *abfd = group->owner; ++ Elf_Internal_Shdr *ghdr; ++ ++ if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) ++ return NULL; ++ ++ ghdr = &elf_section_data (group)->this_hdr; ++ if (ghdr->sh_link < elf_numsections (abfd)) ++ { ++ const struct elf_backend_data *bed = get_elf_backend_data (abfd); ++ Elf_Internal_Shdr *symhdr = elf_elfsections (abfd) [ghdr->sh_link]; ++ ++ if (symhdr->sh_type == SHT_SYMTAB ++ && ghdr->sh_info < symhdr->sh_size / bed->s->sizeof_sym) ++ return isympp[ghdr->sh_info - 1]; ++ } ++ return NULL; ++} +diff -rup binutils-2.26.orig/bfd/bfd-in2.h binutils-2.26/bfd/bfd-in2.h +--- binutils-2.26.orig/bfd/bfd-in2.h 2016-02-19 09:35:36.280000903 +0000 ++++ binutils-2.26/bfd/bfd-in2.h 2016-02-19 09:35:54.900106492 +0000 +@@ -1654,6 +1657,9 @@ extern asection _bfd_std_section[4]; + #define BFD_COM_SECTION_NAME "*COM*" + #define BFD_IND_SECTION_NAME "*IND*" + ++/* GNU object-only section name. */ ++#define GNU_OBJECT_ONLY_SECTION_NAME ".gnu_object_only" ++ + /* Pointer to the common section. */ + #define bfd_com_section_ptr (&_bfd_std_section[0]) + /* Pointer to the undefined section. */ +@@ -6511,6 +6517,14 @@ struct bfd_build_id + bfd_byte data[1]; + }; + ++enum bfd_lto_object_type ++ { ++ lto_non_object, ++ lto_non_ir_object, ++ lto_ir_object, ++ lto_mixed_object ++ }; ++ + struct bfd + { + /* The filename the application opened the BFD with. */ +@@ -6681,6 +6695,9 @@ struct bfd + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + ++ /* LTO object type. */ ++ ENUM_BITFIELD (bfd_lto_object_type) lto_type : 2; ++ + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; +@@ -6706,6 +6723,9 @@ struct bfd + /* The last section on the section list. */ + struct bfd_section *section_last; + ++ /* The object-only section on the section list. */ ++ struct bfd_section *object_only_section; ++ + /* The number of sections. */ + unsigned int section_count; + +@@ -7026,6 +7046,8 @@ bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + ++asymbol *bfd_group_signature (asection *group, asymbol **isympp); ++ + /* Extracted from archive.c. */ + symindex bfd_get_next_mapent + (bfd *abfd, symindex previous, carsym **sym); +diff -rup binutils-2.26.orig/bfd/elf.c binutils-2.26/bfd/elf.c +--- binutils-2.26.orig/bfd/elf.c 2016-02-19 09:35:36.280000903 +0000 ++++ binutils-2.26/bfd/elf.c 2016-02-19 09:35:54.904106515 +0000 +@@ -2387,6 +2387,7 @@ static const struct bfd_elf_special_sect + { STRING_COMMA_LEN (".gnu.linkonce.b"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { STRING_COMMA_LEN (".gnu.lto_"), -1, SHT_PROGBITS, SHF_EXCLUDE }, + { STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, ++ { STRING_COMMA_LEN (".gnu_object_only"), 0, SHT_GNU_OBJECT_ONLY, SHF_EXCLUDE }, + { STRING_COMMA_LEN (".gnu.version"), 0, SHT_GNU_versym, 0 }, + { STRING_COMMA_LEN (".gnu.version_d"), 0, SHT_GNU_verdef, 0 }, + { STRING_COMMA_LEN (".gnu.version_r"), 0, SHT_GNU_verneed, 0 }, +diff -rup binutils-2.26.orig/bfd/format.c binutils-2.26/bfd/format.c +--- binutils-2.26.orig/bfd/format.c 2016-02-19 09:35:36.265000818 +0000 ++++ binutils-2.26/bfd/format.c 2016-02-19 09:36:21.420256880 +0000 +@@ -46,6 +46,9 @@ SUBSECTION + #include "sysdep.h" + #include "bfd.h" + #include "libbfd.h" ++#if BFD_SUPPORTS_PLUGINS ++#include "plugin.h" ++#endif + + /* IMPORT from targets.c. */ + extern const size_t _bfd_target_vector_entries; +@@ -179,6 +182,33 @@ bfd_preserve_finish (bfd *abfd ATTRIBUTE + preserve->marker = NULL; + } + ++/* Set lto_type in ABFD. */ ++ ++static void ++bfd_set_lto_type (bfd *abfd) ++{ ++ if (abfd->format == bfd_object ++ && abfd->lto_type == lto_non_object ++ && (abfd->flags & (DYNAMIC | EXEC_P)) == 0) ++ { ++ asection *sec; ++ enum bfd_lto_object_type type = lto_non_ir_object; ++ for (sec = abfd->sections; sec != NULL; sec = sec->next) ++ { ++ if (strcmp (sec->name, GNU_OBJECT_ONLY_SECTION_NAME) == 0) ++ { ++ type = lto_mixed_object; ++ abfd->object_only_section = sec; ++ break; ++ } ++ else if (type != lto_ir_object ++ && strncmp (sec->name, ".gnu.lto_", 9) == 0) ++ type = lto_ir_object; ++ } ++ abfd->lto_type = type; ++ } ++} ++ + /* + FUNCTION + bfd_check_format_matches +@@ -221,7 +251,10 @@ bfd_check_format_matches (bfd *abfd, bfd + } + + if (abfd->format != bfd_unknown) +- return abfd->format == format; ++ { ++ bfd_set_lto_type (abfd); ++ return abfd->format == format; ++ } + + if (matching != NULL || *bfd_associated_vector != NULL) + { +@@ -285,6 +318,13 @@ bfd_check_format_matches (bfd *abfd, bfd + || (*target)->match_priority > best_match) + continue; + ++#if BFD_SUPPORTS_PLUGINS ++ /* If the plugin target is explicitly specified when a BFD file ++ is opened, don't check it twice. */ ++ if (bfd_plugin_specified_p () && bfd_plugin_target_p (*target)) ++ continue; ++#endif ++ + /* If we already tried a match, the bfd is modified and may + have sections attached, which will confuse the next + _bfd_check_format call. */ +@@ -449,6 +489,8 @@ bfd_check_format_matches (bfd *abfd, bfd + if (matching_vector) + free (matching_vector); + ++ bfd_set_lto_type (abfd); ++ + /* File position has moved, BTW. */ + return TRUE; + } +diff -rup binutils-2.26.orig/bfd/plugin.c binutils-2.26/bfd/plugin.c +--- binutils-2.26.orig/bfd/plugin.c 2016-02-19 09:35:36.271000852 +0000 ++++ binutils-2.26/bfd/plugin.c 2016-02-19 09:35:54.905106520 +0000 +@@ -130,6 +130,146 @@ register_claim_file (ld_plugin_claim_fil + return LDPS_OK; + } + ++static asection bfd_plugin_fake_text_section ++ = BFD_FAKE_SECTION (bfd_plugin_fake_text_section, 0, 0, ".text", 0); ++static asection bfd_plugin_fake_common_section ++ = BFD_FAKE_SECTION (bfd_plugin_fake_common_section, SEC_IS_COMMON, 0, ++ NULL, 0); ++ ++/* Get symbols from object only section. */ ++ ++static void ++bfd_plugin_get_symbols_in_object_only (bfd *abfd) ++{ ++ struct plugin_data_struct *plugin_data = abfd->tdata.plugin_data; ++ const char *object_only_file; ++ bfd *nbfd; ++ long storage; ++ long object_only_nsyms, added_nsyms, i; ++ asymbol **object_only_syms, **added_syms; ++ ++ plugin_data->object_only_syms = NULL; ++ plugin_data->object_only_nsyms = 0; ++ ++ if (abfd->sections == NULL && abfd->my_archive == NULL) ++ { ++ nbfd = bfd_openr (abfd->filename, NULL); ++ if (nbfd == NULL) ++ { ++ (*_bfd_error_handler) ++ (_("%s: failed to open to extract object only section: %s"), ++ abfd->filename, bfd_errmsg (bfd_get_error ())); ++ goto error_return; ++ } ++ else if (!bfd_check_format (nbfd, bfd_object)) ++ { ++ /* There is no object only section if it isn't a bfd_object ++ file. */ ++error_return: ++ bfd_close (nbfd); ++ return; ++ } ++ } ++ else ++ { ++ if (!bfd_check_format (abfd, bfd_object)) ++ { ++ (*_bfd_error_handler) ++ (_("%B: invalid file to extract object only section: %s"), ++ abfd, bfd_errmsg (bfd_get_error ())); ++ return; ++ } ++ nbfd = abfd; ++ } ++ ++ if (nbfd->lto_type == lto_mixed_object ++ && (nbfd->flags & HAS_SYMS) != 0) ++ { ++ object_only_file = bfd_extract_object_only_section (nbfd); ++ if (object_only_file == NULL) ++ (*_bfd_error_handler) ++ (_("%B: failed to extract object only section: %s"), ++ abfd, bfd_errmsg (bfd_get_error ())); ++ } ++ else ++ object_only_file = NULL; ++ ++ /* Close the new bfd we just opened. */ ++ if (nbfd != abfd) ++ bfd_close (nbfd); ++ ++ /* Return if there is no object only section or there is no ++ symbol in object only section. */ ++ if (!object_only_file) ++ return; ++ ++ /* Open the file containing object only section. */ ++ nbfd = bfd_openr (object_only_file, NULL); ++ if (!bfd_check_format (nbfd, bfd_object)) ++ { ++ (*_bfd_error_handler) ++ (_("%B: failed to open object only section: %s"), ++ abfd, bfd_errmsg (bfd_get_error ())); ++ goto quit; ++ } ++ ++ storage = bfd_get_symtab_upper_bound (nbfd); ++ if (storage <= 0) ++ { ++ if (storage < 0) ++ (*_bfd_error_handler) ++ (_("%B: failed to get symbol table in object only section: %s"), ++ abfd, bfd_errmsg (bfd_get_error ())); ++ ++ goto quit; ++ } ++ ++ object_only_syms = (asymbol **) bfd_malloc (storage); ++ object_only_nsyms = bfd_canonicalize_symtab (nbfd, object_only_syms); ++ ++ /* FIXME: We waste some spaces if not all symbols are copied. */ ++ added_syms = (asymbol **) bfd_alloc (abfd, storage); ++ added_nsyms = 0; ++ ++ /* Copy only global symbols from object only section. */ ++ for (i = 0; i < object_only_nsyms; i++) ++ { ++ asection *sec = object_only_syms[i]->section; ++ flagword flags = object_only_syms[i]->flags; ++ asymbol *s; ++ ++ if (bfd_is_com_section (sec)) ++ sec = &bfd_plugin_fake_common_section; ++ else if (bfd_is_und_section (sec)) ++ ; ++ else if ((flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE)) != 0) ++ sec = &bfd_plugin_fake_text_section; ++ else ++ continue; ++ ++ s = bfd_alloc (abfd, sizeof (asymbol)); ++ BFD_ASSERT (s); ++ added_syms[added_nsyms++] = s; ++ ++ s->section = sec; ++ s->the_bfd = abfd; ++ s->name = xstrdup (object_only_syms[i]->name); ++ s->value = 0; ++ s->flags = flags; ++ s->udata.p = NULL; ++ } ++ ++ plugin_data->object_only_syms = added_syms; ++ plugin_data->object_only_nsyms = added_nsyms; ++ ++ free (object_only_syms); ++ ++quit: ++ /* Close and remove the object only section file. */ ++ bfd_close (nbfd); ++ unlink (object_only_file); ++} ++ + static enum ld_plugin_status + add_symbols (void * handle, + int nsyms, +@@ -142,10 +282,13 @@ add_symbols (void * handle, + plugin_data->nsyms = nsyms; + plugin_data->syms = syms; + +- if (nsyms != 0) ++ abfd->tdata.plugin_data = plugin_data; ++ ++ bfd_plugin_get_symbols_in_object_only (abfd); ++ ++ if ((nsyms + plugin_data->object_only_nsyms) != 0) + abfd->flags |= HAS_SYMS; + +- abfd->tdata.plugin_data = plugin_data; + return LDPS_OK; + } + +@@ -440,7 +583,8 @@ static long + bfd_plugin_get_symtab_upper_bound (bfd *abfd) + { + struct plugin_data_struct *plugin_data = abfd->tdata.plugin_data; +- long nsyms = plugin_data->nsyms; ++ /* Add symbols from object only section. */ ++ long nsyms = plugin_data->nsyms + plugin_data->object_only_nsyms; + + BFD_ASSERT (nsyms >= 0); + +@@ -474,12 +618,7 @@ bfd_plugin_canonicalize_symtab (bfd *abf + struct plugin_data_struct *plugin_data = abfd->tdata.plugin_data; + long nsyms = plugin_data->nsyms; + const struct ld_plugin_symbol *syms = plugin_data->syms; +- static asection fake_section; +- static asection fake_common_section; +- int i; +- +- fake_section.name = ".text"; +- fake_common_section.flags = SEC_IS_COMMON; ++ int i, j; + + for (i = 0; i < nsyms; i++) + { +@@ -492,10 +631,11 @@ bfd_plugin_canonicalize_symtab (bfd *abf + s->name = syms[i].name; + s->value = 0; + s->flags = convert_flags (&syms[i]); ++ s->udata.p = NULL; + switch (syms[i].def) + { + case LDPK_COMMON: +- s->section = &fake_common_section; ++ s->section = &bfd_plugin_fake_common_section; + break; + case LDPK_UNDEF: + case LDPK_WEAKUNDEF: +@@ -503,15 +643,18 @@ bfd_plugin_canonicalize_symtab (bfd *abf + break; + case LDPK_DEF: + case LDPK_WEAKDEF: +- s->section = &fake_section; ++ s->section = &bfd_plugin_fake_text_section; + break; + default: + BFD_ASSERT (0); + } +- +- s->udata.p = (void *) &syms[i]; + } + ++ /* Copy symbols from object only section. */ ++ nsyms += plugin_data->object_only_nsyms; ++ for (j = 0; j < plugin_data->object_only_nsyms; j++, i++) ++ alocation[i] = plugin_data->object_only_syms[j]; ++ + return nsyms; + } + +diff -rup binutils-2.26.orig/bfd/plugin.h binutils-2.26/bfd/plugin.h +--- binutils-2.26.orig/bfd/plugin.h 2016-02-19 09:35:36.271000852 +0000 ++++ binutils-2.26/bfd/plugin.h 2016-02-19 09:35:54.906106526 +0000 +@@ -33,6 +33,8 @@ typedef struct plugin_data_struct + { + int nsyms; + const struct ld_plugin_symbol *syms; ++ int object_only_nsyms; ++ asymbol **object_only_syms; + } + plugin_data_struct; + +diff -rup binutils-2.26.orig/bfd/section.c binutils-2.26/bfd/section.c +--- binutils-2.26.orig/bfd/section.c 2016-02-19 09:35:36.276000881 +0000 ++++ binutils-2.26/bfd/section.c 2016-02-19 09:35:54.906106526 +0000 +@@ -588,6 +588,9 @@ CODE_FRAGMENT + .#define BFD_COM_SECTION_NAME "*COM*" + .#define BFD_IND_SECTION_NAME "*IND*" + . ++.{* GNU object-only section name. *} ++.#define GNU_OBJECT_ONLY_SECTION_NAME ".gnu_object_only" ++. + .{* Pointer to the common section. *} + .#define bfd_com_section_ptr (&_bfd_std_section[0]) + .{* Pointer to the undefined section. *} +diff -rup binutils-2.26.orig/binutils/readelf.c binutils-2.26/binutils/readelf.c +--- binutils-2.26.orig/binutils/readelf.c 2016-02-19 09:35:36.295000988 +0000 ++++ binutils-2.26/binutils/readelf.c 2016-02-19 09:35:54.911106554 +0000 +@@ -3900,6 +3900,7 @@ get_section_type_name (unsigned int sh_t + case 0x7ffffffd: return "AUXILIARY"; + case 0x7fffffff: return "FILTER"; + case SHT_GNU_LIBLIST: return "GNU_LIBLIST"; ++ case SHT_GNU_OBJECT_ONLY: return "GNU_OBJECT_ONLY"; + + default: + if ((sh_type >= SHT_LOPROC) && (sh_type <= SHT_HIPROC)) +diff -rup binutils-2.26.orig/gas/testsuite/gas/elf/section9.d binutils-2.26/gas/testsuite/gas/elf/section9.d +--- binutils-2.26.orig/gas/testsuite/gas/elf/section9.d 2016-02-19 09:35:36.397001567 +0000 ++++ binutils-2.26/gas/testsuite/gas/elf/section9.d 2016-02-19 09:35:54.912106560 +0000 +@@ -4,4 +4,5 @@ + #... + [ ]*\[.*\][ ]+\.gnu\.lto_main[ ]+PROGBITS.*[ ]+E[ ]+.* + [ ]*\[.*\][ ]+\.gnu\.lto_\.pureconst[ ]+PROGBITS.*[ ]+E[ ]+.* ++[ ]*\[.*\][ ]+\.gnu_object_only[ ]+GNU_OBJECT_ONLY.*[ ]+E[ ]+.* + #pass +diff -rup binutils-2.26.orig/gas/testsuite/gas/elf/section9.s binutils-2.26/gas/testsuite/gas/elf/section9.s +--- binutils-2.26.orig/gas/testsuite/gas/elf/section9.s 2016-02-19 09:35:36.397001567 +0000 ++++ binutils-2.26/gas/testsuite/gas/elf/section9.s 2016-02-19 09:35:54.912106560 +0000 +@@ -2,3 +2,5 @@ + .byte 0,0,0,0 + .section .gnu.lto_.pureconst,"",%progbits + .byte 0,0,0,0 ++ .section .gnu_object_only ++ .byte 0,0,0,0 +diff -rup binutils-2.26.orig/include/bfdlink.h binutils-2.26/include/bfdlink.h +--- binutils-2.26.orig/include/bfdlink.h 2016-02-19 09:35:36.672003126 +0000 ++++ binutils-2.26/include/bfdlink.h 2016-02-19 09:35:54.913106566 +0000 +@@ -400,6 +400,12 @@ struct bfd_link_info + /* TRUE if ok to have multiple definition. */ + unsigned int allow_multiple_definition: 1; + ++ /* TRUE if .gnu_object_only section should be created. */ ++ unsigned int emit_gnu_object_only: 1; ++ ++ /* TRUE if .gnu_object_only section is being created. */ ++ unsigned int emitting_gnu_object_only: 1; ++ + /* TRUE if ok to have version with no definition. */ + unsigned int allow_undefined_version: 1; + +diff -rup binutils-2.26.orig/include/elf/common.h binutils-2.26/include/elf/common.h +--- binutils-2.26.orig/include/elf/common.h 2016-02-19 09:35:36.675003143 +0000 ++++ binutils-2.26/include/elf/common.h 2016-02-19 09:35:54.913106566 +0000 +@@ -478,6 +478,7 @@ + #define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes */ + #define SHT_GNU_HASH 0x6ffffff6 /* GNU style symbol hash table */ + #define SHT_GNU_LIBLIST 0x6ffffff7 /* List of prelink dependencies */ ++#define SHT_GNU_OBJECT_ONLY 0x6ffffff8 /* Object only */ + + /* The next three section types are defined by Solaris, and are named + SHT_SUNW*. We use them in GNU code, so we also define SHT_GNU* +diff -rup binutils-2.26.orig/ld/emultempl/aarch64elf.em binutils-2.26/ld/emultempl/aarch64elf.em +--- binutils-2.26.orig/ld/emultempl/aarch64elf.em 2016-02-19 09:35:36.698003274 +0000 ++++ binutils-2.26/ld/emultempl/aarch64elf.em 2016-02-19 09:35:54.914106571 +0000 +@@ -271,7 +271,7 @@ gld${EMULATION_NAME}_after_allocation (v + } + + static void +-gld${EMULATION_NAME}_finish (void) ++aarch64_finish (void) + { + if (!bfd_link_relocatable (&link_info)) + { +@@ -283,7 +283,7 @@ gld${EMULATION_NAME}_finish (void) + } + } + +- finish_default (); ++ gld${EMULATION_NAME}_finish (); + } + + /* This is a convenient point to tell BFD about target specific flags. +@@ -435,4 +435,4 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS= + LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse + + # Call the extra arm-elf function +-LDEMUL_FINISH=gld${EMULATION_NAME}_finish ++LDEMUL_FINISH=aarch64_finish +diff -rup binutils-2.26.orig/ld/emultempl/alphaelf.em binutils-2.26/ld/emultempl/alphaelf.em +--- binutils-2.26.orig/ld/emultempl/alphaelf.em 2016-02-19 09:35:36.698003274 +0000 ++++ binutils-2.26/ld/emultempl/alphaelf.em 2016-02-19 09:35:54.914106571 +0000 +@@ -104,7 +104,7 @@ alpha_finish (void) + if (limit_32bit) + elf_elfheader (link_info.output_bfd)->e_flags |= EF_ALPHA_32BIT; + +- finish_default (); ++ gld${EMULATION_NAME}_finish (); + } + EOF + +diff -rup binutils-2.26.orig/ld/emultempl/avrelf.em binutils-2.26/ld/emultempl/avrelf.em +--- binutils-2.26.orig/ld/emultempl/avrelf.em 2016-02-19 09:35:36.698003274 +0000 ++++ binutils-2.26/ld/emultempl/avrelf.em 2016-02-19 09:35:54.915106577 +0000 +@@ -209,7 +209,7 @@ avr_finish (void) + elf_elfheader (abfd)->e_flags &= ~EF_AVR_LINKRELAX_PREPARED; + } + +- finish_default (); ++ gld${EMULATION_NAME}_finish (); + } + EOF + +diff -rup binutils-2.26.orig/ld/emultempl/elf32.em binutils-2.26/ld/emultempl/elf32.em +--- binutils-2.26.orig/ld/emultempl/elf32.em 2016-02-19 09:35:36.700003285 +0000 ++++ binutils-2.26/ld/emultempl/elf32.em 2016-02-19 09:35:54.915106577 +0000 +@@ -66,6 +66,7 @@ static void gld${EMULATION_NAME}_before_ + static void gld${EMULATION_NAME}_after_allocation (void); + static lang_output_section_statement_type *gld${EMULATION_NAME}_place_orphan + (asection *, const char *, int); ++static void gld${EMULATION_NAME}_finish (void); + EOF + + if [ "x${USE_LIBPATH}" = xyes ] ; then +@@ -1795,6 +1796,8 @@ output_rel_find (asection *sec, int isdy + in->owner, in); + } + ++static int orphan_init_done = 0; ++ + /* Place an orphan section. We use this to put random SHF_ALLOC + sections in the right segment. */ + +@@ -1803,7 +1806,7 @@ gld${EMULATION_NAME}_place_orphan (asect + const char *secname, + int constraint) + { +- static struct orphan_save hold[] = ++ static struct orphan_save orig_hold[] = + { + { ".text", + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE, +@@ -1833,6 +1836,7 @@ gld${EMULATION_NAME}_place_orphan (asect + SEC_HAS_CONTENTS, + 0, 0, 0, 0 }, + }; ++ static struct orphan_save hold[ARRAY_SIZE (orig_hold)]; + enum orphan_save_index + { + orphan_text = 0, +@@ -1845,7 +1849,6 @@ gld${EMULATION_NAME}_place_orphan (asect + orphan_sdata, + orphan_nonalloc + }; +- static int orphan_init_done = 0; + struct orphan_save *place; + lang_output_section_statement_type *after; + lang_output_section_statement_type *os; +@@ -1924,15 +1927,22 @@ gld${EMULATION_NAME}_place_orphan (asect + + if (!orphan_init_done) + { +- struct orphan_save *ho; ++ struct orphan_save *ho, *horig; + + for (ho = hold; ho < hold + sizeof (hold) / sizeof (hold[0]); ++ho) ++ for (ho = hold, horig = orig_hold; ++ ho < hold + ARRAY_SIZE (hold); ++ ++ho, ++horig) ++ { ++ *ho = *horig; ++ if (ho->name != NULL) + if (ho->name != NULL) + { + ho->os = lang_output_section_find (ho->name); + if (ho->os != NULL && ho->os->flags == 0) + ho->os->flags = ho->flags; + } ++ } + orphan_init_done = 1; + } + +@@ -2017,6 +2027,27 @@ gld${EMULATION_NAME}_place_orphan (asect + EOF + fi + ++fragment <my_archive; ++ if (archive) ++ break; ++ case cmdline_is_file_enum: ++ cmdline_list_append (&cmdline_object_only_file_list, type, data); ++ return; ++ } ++ ++ /* Put archive member on cmdline_object_only_archive_list and sort ++ the list by archive name and archive member origin. */ ++ new_opt = (cmdline_union_type *) stat_alloc (sizeof (*new_opt)); ++ new_opt->header.type = cmdline_is_bfd_enum; ++ new_opt->header.next = NULL; ++ new_opt->abfd.abfd = (bfd *) data; ++ ++ c = cmdline_object_only_archive_list.head; ++ if (c == NULL) ++ { ++ cmdline_object_only_archive_list.head = new_opt; ++ cmdline_object_only_archive_list.tail = &new_opt->header.next; ++ return; ++ } ++ ++ prev = NULL; ++ origin = abfd->origin; ++ for (; c != NULL; c = next) ++ { ++ if (c->header.type != cmdline_is_bfd_enum) ++ abort (); ++ ++ next = c->header.next; ++ ++ obfd = c->abfd.abfd; ++ oarchive = abfd->my_archive; ++ ++ if (strcmp (archive->filename, oarchive->filename) == 0) ++ { ++ bfd_boolean after; ++ ++ if (origin < obfd->origin) ++ { ++ /* Insert it before the current. */ ++ new_opt->header.next = c; ++ if (prev) ++ *prev = new_opt; ++ else ++ cmdline_object_only_archive_list.head = new_opt; ++ return; ++ } ++ ++ after = TRUE; ++ ++ /* Check origin. */ ++ while (next) ++ { ++ if (next->header.type != cmdline_is_bfd_enum) ++ abort (); ++ ++ nbfd = next->abfd.abfd; ++ norigin = nbfd->origin; ++ if (origin > norigin) ++ { ++ /* Insert it after NEXT. */ ++ break; ++ } ++ ++ narchive = nbfd->my_archive; ++ if (strcmp (archive->filename, narchive->filename) != 0) ++ { ++ /* Insert it befor NEXT. */ ++ after = FALSE; ++ break; ++ } ++ ++ c = next; ++ next = next->header.next; ++ } ++ ++ if (after && next) ++ { ++ c = next; ++ next = next->header.next; ++ } ++ ++ if (*cmdline_object_only_archive_list.tail == c->header.next) ++ cmdline_object_only_archive_list.tail ++ = &new_opt->header.next; ++ ++ prev = &c->header.next; ++ new_opt->header.next = next; ++ *prev = new_opt; ++ return; ++ } ++ ++ prev = &c->header.next; ++ } ++ ++ *cmdline_object_only_archive_list.tail = new_opt; ++ cmdline_object_only_archive_list.tail = &new_opt->header.next; ++} ++ ++/* Get object-only input files. */ ++ ++static void ++cmdline_get_object_only_input_files (void) ++{ ++ cmdline_union_type *c, *next; ++ bfd *abfd, *archive; ++ bfd *nbfd, *narchive; ++ ++ /* Add files first. */ ++ for (c = cmdline_object_only_file_list.head; ++ c != NULL; c = c->header.next) ++ switch (c->header.type) ++ { ++ default: ++ abort (); ++ case cmdline_is_file_enum: ++ lang_add_input_file (c->file.filename, ++ lang_input_file_is_file_enum, NULL); ++ break; ++ case cmdline_is_bfd_enum: ++ abfd = c->abfd.abfd; ++ if (abfd->my_archive) ++ abort (); ++ lang_add_input_file (abfd->filename, ++ lang_input_file_is_file_enum, NULL); ++ break; ++ } ++ ++ /* Add archive members next. */ ++ for (c = cmdline_object_only_archive_list.head; c != NULL; c = next) ++ { ++ if (c->header.type != cmdline_is_bfd_enum) ++ abort (); ++ ++ next = c->header.next; ++ ++ abfd = c->abfd.abfd; ++ archive = abfd->my_archive; ++ ++ /* Add the first archive of the archive member group. */ ++ lang_add_input_file (archive->filename, ++ lang_input_file_is_file_enum, NULL); ++ ++ /* Skip the rest members in the archive member group. */ ++ do ++ { ++ if (!next) ++ break; ++ ++ if (next->header.type != cmdline_is_bfd_enum) ++ abort (); ++ ++ next = next->header.next; ++ if (!next) ++ break; ++ nbfd = next->abfd.abfd; ++ narchive = nbfd->my_archive; ++ } ++ while (strcmp (archive->filename, narchive->filename) == 0); ++ } ++} ++ ++struct cmdline_arg ++{ ++ bfd *obfd; ++ asymbol **isympp; ++ int status; ++}; ++ ++/* Create a section in OBFD with the same ++ name and attributes as ISECTION in IBFD. */ ++ ++static void ++setup_section (bfd *ibfd, sec_ptr isection, void *p) ++{ ++ struct cmdline_arg *arg = (struct cmdline_arg *) p; ++ bfd *obfd = arg->obfd; ++ asymbol **isympp = arg->isympp; ++ const char *name = isection->name; ++ sec_ptr osection; ++ const char *err; ++ ++ /* Skip the object-only section. */ ++ if (ibfd->object_only_section == isection) ++ return; ++ ++ /* If we have already failed earlier on, do not keep on generating ++ complaints now. */ ++ if (arg->status) ++ return; ++ ++ osection = bfd_make_section_anyway_with_flags (obfd, name, ++ isection->flags); ++ ++ if (osection == NULL) ++ { ++ err = _("failed to create output section"); ++ goto loser; ++ } ++ ++ osection->size = isection->size; ++ osection->vma = isection->vma; ++ osection->lma = isection->lma; ++ osection->alignment_power = isection->alignment_power; ++ ++ /* Copy merge entity size. */ ++ osection->entsize = isection->entsize; ++ ++ /* This used to be mangle_section; we do here to avoid using ++ bfd_get_section_by_name since some formats allow multiple ++ sections with the same name. */ ++ isection->output_section = osection; ++ isection->output_offset = 0; ++ ++ if ((isection->flags & SEC_GROUP) != 0) ++ { ++ asymbol *gsym = bfd_group_signature (isection, isympp); ++ ++ if (gsym != NULL) ++ { ++ gsym->flags |= BSF_KEEP; ++ if (ibfd->xvec->flavour == bfd_target_elf_flavour) ++ elf_group_id (isection) = gsym; ++ } ++ } ++ ++ /* Allow the BFD backend to copy any private data it understands ++ from the input section to the output section. */ ++ if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection)) ++ { ++ err = _("failed to copy private data"); ++ goto loser; ++ } ++ ++ /* All went well. */ ++ return; ++ ++loser: ++ arg->status = 1; ++ einfo (_("%P%F: setup_section: %s: %s\n"), err, name); ++} ++ ++/* Copy the data of input section ISECTION of IBFD ++ to an output section with the same name in OBFD. ++ If stripping then don't copy any relocation info. */ ++ ++static void ++copy_section (bfd *ibfd, sec_ptr isection, void *p) ++{ ++ struct cmdline_arg *arg = (struct cmdline_arg *) p; ++ bfd *obfd = arg->obfd; ++ asymbol **isympp = arg->isympp; ++ arelent **relpp; ++ long relcount; ++ sec_ptr osection; ++ bfd_size_type size; ++ long relsize; ++ flagword flags; ++ const char *err; ++ ++ /* Skip the object-only section. */ ++ if (ibfd->object_only_section == isection) ++ return; ++ ++ /* If we have already failed earlier on, do not keep on generating ++ complaints now. */ ++ if (arg->status) ++ return; ++ ++ flags = bfd_get_section_flags (ibfd, isection); ++ if ((flags & SEC_GROUP) != 0) ++ return; ++ ++ osection = isection->output_section; ++ size = bfd_get_section_size (isection); ++ ++ if (size == 0 || osection == 0) ++ return; ++ ++ relsize = bfd_get_reloc_upper_bound (ibfd, isection); ++ ++ if (relsize < 0) ++ { ++ /* Do not complain if the target does not support relocations. */ ++ if (relsize == -1 ++ && bfd_get_error () == bfd_error_invalid_operation) ++ relsize = 0; ++ else ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ } ++ ++ if (relsize == 0) ++ bfd_set_reloc (obfd, osection, NULL, 0); ++ else ++ { ++ relpp = (arelent **) xmalloc (relsize); ++ relcount = bfd_canonicalize_reloc (ibfd, isection, relpp, isympp); ++ if (relcount < 0) ++ { ++ err = _("relocation count is negative"); ++ goto loser; ++ } ++ ++ bfd_set_reloc (obfd, osection, ++ relcount == 0 ? NULL : relpp, relcount); ++ if (relcount == 0) ++ free (relpp); ++ } ++ ++ if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS) ++ { ++ bfd_byte *memhunk = NULL; ++ ++ if (!bfd_get_full_section_contents (ibfd, isection, &memhunk)) ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ ++ if (!bfd_set_section_contents (obfd, osection, memhunk, 0, size)) ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ free (memhunk); ++ } ++ ++ /* All went well. */ ++ return; ++ ++loser: ++ einfo (_("%P%F: copy_section: %s: %s\n"), err, isection->name); ++} ++/* Open the temporary bfd created in the same directory as PATH. */ ++ ++static bfd * ++cmdline_fopen_temp (const char *path, const char *target, ++ const char *mode) ++{ ++#define template "ldXXXXXX" ++ const char *slash = strrchr (path, '/'); ++ char *tmpname; ++ size_t len; ++ int fd; ++ ++#ifdef HAVE_DOS_BASED_FILE_SYSTEM ++ { ++ /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ ++ char *bslash = strrchr (path, '\\'); ++ ++ if (slash == NULL || (bslash != NULL && bslash > slash)) ++ slash = bslash; ++ if (slash == NULL && path[0] != '\0' && path[1] == ':') ++ slash = path + 1; ++ } ++#endif ++ ++ if (slash != (char *) NULL) ++ { ++ len = slash - path; ++ tmpname = (char *) xmalloc (len + sizeof (template) + 2); ++ memcpy (tmpname, path, len); ++ ++#ifdef HAVE_DOS_BASED_FILE_SYSTEM ++ /* If tmpname is "X:", appending a slash will make it a root ++ directory on drive X, which is NOT the same as the current ++ directory on drive X. */ ++ if (len == 2 && tmpname[1] == ':') ++ tmpname[len++] = '.'; ++#endif ++ tmpname[len++] = '/'; ++ } ++ else ++ { ++ tmpname = (char *) xmalloc (sizeof (template)); ++ len = 0; ++ } ++ ++ memcpy (tmpname + len, template, sizeof (template)); ++#undef template ++ ++#ifdef HAVE_MKSTEMP ++ fd = mkstemp (tmpname); ++#else ++ tmpname = mktemp (tmpname); ++ if (tmpname == NULL) ++ return NULL; ++ fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600); ++#endif ++ if (fd == -1) ++ return NULL; ++ return bfd_fopen (tmpname, target, mode, fd); ++} ++ ++/* Add the object-only section. */ ++ ++static void ++cmdline_add_object_only_section (bfd_byte *contents, size_t size) ++{ ++ bfd_vma start; ++ flagword flags; ++ enum bfd_architecture iarch; ++ unsigned int imach; ++ long symcount; ++ long symsize; ++ asymbol **isympp = NULL; ++ asymbol **osympp = NULL; ++ bfd *obfd = NULL, *ibfd; ++ const char *err; ++ struct arg ++ { ++ bfd *obfd; ++ asymbol **isympp; ++ int status; ++ } arg; ++ char **matching; ++ char *ofilename = NULL; ++ asection *sec; ++ ++ ibfd = bfd_openr (output_filename, output_target); ++ if (!ibfd) ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ ++ if (!bfd_check_format_matches (ibfd, bfd_object, &matching)) ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ ++ obfd = cmdline_fopen_temp (output_filename, output_target, "w"); ++ if (!obfd) ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ /* To be used after bfd_close (). */ ++ ofilename = xstrdup (bfd_get_filename (obfd)); ++ ++ if (!bfd_set_format (obfd, bfd_object)) ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ ++ /* Copy the start address, flags and architecture of input file to ++ output file. */ ++ flags = bfd_get_file_flags (ibfd); ++ start = bfd_get_start_address (ibfd); ++ iarch = bfd_get_arch (ibfd); ++ imach = bfd_get_mach (ibfd); ++ if (!bfd_set_start_address (obfd, start) ++ || !bfd_set_file_flags (obfd, flags) ++ || !bfd_set_arch_mach (obfd, iarch, imach)) ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ ++ symsize = bfd_get_symtab_upper_bound (ibfd); ++ if (symsize < 0) ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ ++ isympp = (asymbol **) xmalloc (symsize); ++ symcount = bfd_canonicalize_symtab (ibfd, isympp); ++ if (symcount < 0) ++ { ++ err = bfd_errmsg (bfd_get_error ()); ++ goto loser; ++ } ++ ++ arg.obfd = obfd; ++ arg.isympp = isympp; ++ arg.status = 0; ++ ++ /* BFD mandates that all output sections be created and sizes set before ++ any output is done. Thus, we traverse all sections multiple times. */ ++ bfd_map_over_sections (ibfd, setup_section, &arg); ++ ++ if (arg.status) ++ { ++ err = _("error setting up sections"); ++ goto loser; ++ } ++ ++ /* Allow the BFD backend to copy any private data it understands ++ from the input section to the output section. */ ++ if (! bfd_copy_private_header_data (ibfd, obfd)) ++ { ++ err = _("error copying private header data"); ++ goto loser; ++ } ++ ++ /* Create the object-only section. */ ++ sec = bfd_make_section_with_flags (obfd, ++ GNU_OBJECT_ONLY_SECTION_NAME, ++ (SEC_HAS_CONTENTS ++ | SEC_READONLY ++ | SEC_DATA ++ | SEC_LINKER_CREATED)); ++ if (sec == NULL) ++ { ++ err = _("can't create object-only section"); ++ goto loser; ++ } ++ ++ if (! bfd_set_section_size (obfd, sec, size)) ++ { ++ err = _("can't set object-only section size"); ++ goto loser; ++ } ++ ++ if (ibfd->object_only_section) ++ { ++ /* Filter out the object-only section symbol. */ ++ long src_count = 0, dst_count = 0; ++ asymbol **from, **to; ++ ++ osympp = (asymbol **) xmalloc (symcount * sizeof (asymbol *)); ++ from = isympp; ++ to = osympp; ++ for (; src_count < symcount; src_count++) ++ { ++ asymbol *sym = from[src_count]; ++ if (bfd_get_section (sym) != ibfd->object_only_section) ++ to[dst_count++] = sym; ++ } ++ to[dst_count] = NULL; ++ symcount = dst_count; ++ bfd_set_symtab (obfd, osympp, symcount); ++ } ++ else ++ bfd_set_symtab (obfd, isympp, symcount); ++ ++ /* This has to happen after the symbol table has been set. */ ++ bfd_map_over_sections (ibfd, copy_section, &arg); ++ ++ if (arg.status) ++ { ++ err = _("error copying sections"); ++ goto loser; ++ } ++ ++ /* Copy the object-only section to the output. */ ++ if (! bfd_set_section_contents (obfd, sec, contents, 0, size)) ++ { ++ err = _("error adding object-only section"); ++ goto loser; ++ } ++ ++ /* Allow the BFD backend to copy any private data it understands ++ from the input BFD to the output BFD. This is done last to ++ permit the routine to look at the filtered symbol table, which is ++ important for the ECOFF code at least. */ ++ if (! bfd_copy_private_bfd_data (ibfd, obfd)) ++ { ++ err = _("error copying private BFD data"); ++ goto loser; ++ } ++ ++ if (!bfd_close (obfd)) ++ { ++ unlink (ofilename); ++ einfo (_("%P%F: failed to finish output with object-only section\n")); ++ } ++ ++ /* Must be freed after bfd_close (). */ ++ free (isympp); ++ if (osympp) ++ free (osympp); ++ ++ if (rename (ofilename, output_filename)) ++ { ++ unlink (ofilename); ++ einfo (_("%P%F: failed to rename output with object-only section\n")); ++ } ++ ++ free (ofilename); ++ return; ++ ++loser: ++ if (isympp) ++ free (isympp); ++ if (osympp) ++ free (osympp); ++ if (obfd) ++ bfd_close (obfd); ++ if (ofilename) ++ { ++ unlink (ofilename); ++ free (ofilename); ++ } ++ einfo (_("%P%F: failed to add object-only section: %s\n"), err); ++} ++ ++/* Emit the final output with object-only section. */ ++ ++void ++cmdline_emit_object_only_section (void) ++{ ++ const char *saved_output_filename = output_filename; ++ int fd; ++ size_t size, off; ++ bfd_byte *contents; ++ struct stat st; ++ ++ /* Get a temporary object-only file. */ ++ output_filename = make_temp_file (".obj-only.o"); ++ ++ had_output_filename = FALSE; ++ link_info.input_bfds = NULL; ++ link_info.input_bfds_tail = &link_info.input_bfds; ++ ++ lang_init (TRUE); ++ ldexp_init (TRUE); ++ ++ ld_parse_linker_script (); ++ ++ /* Set up the object-only output. */ ++ lang_final (); ++ ++ /* Open the object-only file for output. */ ++ lang_for_each_statement (ldlang_open_output); ++ ++ ldemul_create_output_section_statements (); ++ ++ if (!bfd_section_already_linked_table_init ()) ++ einfo (_("%P%F: Failed to create hash table\n")); ++ ++ /* Call cmdline_on_object_only_archive_list_p to check which member ++ should be loaded. */ ++ input_flags.whole_archive = TRUE; ++ ++ /* Set it to avoid adding more to cmdline lists. */ ++ link_info.emitting_gnu_object_only = TRUE; ++ ++ /* Get object-only input files. */ ++ cmdline_get_object_only_input_files (); ++ ++ /* Open object-only input files. */ ++ open_input_bfds (statement_list.head, FALSE); ++ ++ ldemul_after_open (); ++ ++ bfd_section_already_linked_table_free (); ++ ++ /* Make sure that we're not mixing architectures. We call this ++ after all the input files have been opened, but before we do any ++ other processing, so that any operations merge_private_bfd_data ++ does on the output file will be known during the rest of the ++ link. */ ++ lang_check (); ++ ++ /* Size up the common data. */ ++ lang_common (); ++ ++ /* Update wild statements. */ ++ update_wild_statements (statement_list.head); ++ ++ /* Run through the contours of the script and attach input sections ++ to the correct output sections. */ ++ map_input_to_output_sections (statement_list.head, NULL, NULL); ++ ++ /* Find any sections not attached explicitly and handle them. */ ++ lang_place_orphans (); ++ ++ /* Do anything special before sizing sections. This is where ELF ++ and other back-ends size dynamic sections. */ ++ ldemul_before_allocation (); ++ ++ /* Size up the sections. */ ++ lang_size_sections (NULL, ! RELAXATION_ENABLED); ++ ++ /* See if anything special should be done now we know how big ++ everything is. This is where relaxation is done. */ ++ ldemul_after_allocation (); ++ ++ ldemul_finish (); ++ ++ /* Make sure that the section addresses make sense. */ ++ if (command_line.check_section_addresses) ++ lang_check_section_addresses (); ++ ++ lang_end (); ++ ++ ldwrite (); ++ ++ ldexp_finish (TRUE); ++ lang_finish (); ++ ++ if (! bfd_close (link_info.output_bfd)) ++ einfo (_("%P%F:%s: final close failed on object-only output: %E\n"), ++ output_filename); ++ ++ /* Read in the object-only file. */ ++ fd = open (output_filename, O_RDONLY | O_BINARY); ++ if (fd < 0) ++ { ++ bfd_set_error (bfd_error_system_call); ++ einfo (_("%P%F:%s: cannot open object-only output: %E"), ++ output_filename); ++ } ++ ++ /* Get the object-only file size. */ ++ if (fstat (fd, &st) != 0) ++ { ++ bfd_set_error (bfd_error_system_call); ++ einfo (_("%P%F:%s: cannot stat object-only output: %E"), ++ output_filename); ++ } ++ ++ size = st.st_size; ++ off = 0; ++ contents = (bfd_byte *) xmalloc (size); ++ while (off != size) ++ { ++ ssize_t got; ++ ++ got = read (fd, contents + off, size - off); ++ if (got < 0) ++ { ++ bfd_set_error (bfd_error_system_call); ++ einfo (_("%P%F:%s: read failed on object-only output: %E"), ++ output_filename); ++ } ++ ++ off += got; ++ } ++ ++ close (fd); ++ ++ /* Remove the temporary object-only file. */ ++ unlink (output_filename); ++ ++ output_filename = saved_output_filename; ++ ++ cmdline_add_object_only_section (contents, size); ++ ++ free (contents); ++} ++ ++/* Extract the object-only section. */ ++ ++static const char * ++cmdline_extract_object_only_section (bfd *abfd) ++{ ++ const char *name = bfd_extract_object_only_section (abfd); ++ ++ if (name == NULL) ++ einfo (_("%P%F: cannot extract object-only section from %B: %E"), ++ abfd); ++ ++ /* It should be removed after it is done. */ ++ cmdline_list_append (&cmdline_temp_object_only_list, ++ cmdline_is_file_enum, (void *) name); ++ ++ return name; ++} ++ ++/* Check and handle the object-only section. */ ++ ++void ++cmdline_check_object_only_section (bfd *abfd, bfd_boolean lto) ++{ ++ const char *filename; ++ ++ if (link_info.emitting_gnu_object_only ++ || abfd->format != bfd_object) ++ return; ++ ++ if (lto) ++ { ++ /* For LTO link, we only need to extract object-only section ++ from the mixed object, add it to input, and put it on LTO ++ claimed output. */ ++ switch (abfd->lto_type) ++ { ++ default: ++ abort (); ++ case lto_mixed_object: ++ filename = cmdline_extract_object_only_section (abfd); ++ lang_add_input_file (filename, ++ lang_input_file_is_file_enum, NULL); ++ break; ++ case lto_non_ir_object: ++ case lto_ir_object: ++ break; ++ } ++ } ++ else if (bfd_link_relocatable (&link_info)) ++ { ++ /* For non-LTO relocatable link, we need to append non-IR object ++ file and the object file in object-only section to the object ++ only list. */ ++ switch (abfd->lto_type) ++ { ++ default: ++ abort (); ++ case lto_mixed_object: ++ filename = cmdline_extract_object_only_section (abfd); ++ cmdline_object_only_list_append (cmdline_is_file_enum, ++ (void *) filename); ++ break; ++ case lto_non_ir_object: ++ cmdline_object_only_list_append (cmdline_is_bfd_enum, abfd); ++ break; ++ case lto_ir_object: ++ break; ++ } ++ } ++} ++ ++/* Remove temporary object-only files. */ ++ ++void ++cmdline_remove_object_only_files (void) ++{ ++ cmdline_union_type *c; ++ ++#ifdef ENABLE_PLUGINS ++ if (plugin_save_temps) ++ return; ++#endif ++ ++ c = cmdline_temp_object_only_list.head; ++ for (; c != NULL; c = c->header.next) ++ switch (c->header.type) ++ { ++ default: ++ abort (); ++ case cmdline_is_file_enum: ++ unlink (c->file.filename); ++ break; ++ } ++} +diff -rup binutils-2.26.orig/ld/ldlang.h binutils-2.26/ld/ldlang.h +--- binutils-2.26.orig/ld/ldlang.h 2016-02-19 09:35:36.701003291 +0000 ++++ binutils-2.26/ld/ldlang.h 2016-02-19 09:35:54.921106611 +0000 +@@ -517,7 +517,7 @@ extern struct asneeded_minfo **asneeded_ + extern void (*output_bfd_hash_table_free_fn) (struct bfd_link_hash_table *); + + extern void lang_init +- (void); ++ (bfd_boolean); + extern void lang_finish + (void); + extern lang_memory_region_type * lang_memory_region_lookup +@@ -693,7 +693,48 @@ lang_ld_feature (char *); + extern void + lang_print_memory_usage (void); + + extern void + lang_add_gc_name (const char *); + ++typedef enum ++{ ++ cmdline_is_file_enum, ++ cmdline_is_bfd_enum ++} cmdline_enum_type; ++ ++typedef struct cmdline_header_struct ++{ ++ union cmdline_union *next; ++ cmdline_enum_type type; ++} cmdline_header_type; ++ ++typedef struct cmdline_file_struct ++{ ++ cmdline_header_type header; ++ const char *filename; ++} cmdline_file_type; ++ ++typedef struct cmdline_bfd_struct ++{ ++ cmdline_header_type header; ++ bfd *abfd; ++} cmdline_bfd_type; ++ ++typedef union cmdline_union ++{ ++ cmdline_header_type header; ++ cmdline_file_type file; ++ cmdline_bfd_type abfd; ++} cmdline_union_type; ++ ++typedef struct cmdline_list ++{ ++ cmdline_union_type *head; ++ cmdline_union_type **tail; ++} cmdline_list_type; ++ ++extern void cmdline_emit_object_only_section (void); ++extern void cmdline_check_object_only_section (bfd *, bfd_boolean); ++extern void cmdline_remove_object_only_files (void); ++ + #endif +diff -rup binutils-2.26.orig/ld/ldlex.h binutils-2.26/ld/ldlex.h +--- binutils-2.26.orig/ld/ldlex.h 2016-02-19 09:35:36.701003291 +0000 ++++ binutils-2.26/ld/ldlex.h 2016-02-19 09:35:54.921106611 +0000 +@@ -134,6 +134,7 @@ enum option_values + #ifdef ENABLE_PLUGINS + OPTION_PLUGIN, + OPTION_PLUGIN_OPT, ++ OPTION_PLUGIN_SAVE_TEMPS, + #endif /* ENABLE_PLUGINS */ + OPTION_DEFAULT_SCRIPT, + OPTION_PRINT_OUTPUT_FORMAT, +diff -rup binutils-2.26.orig/ld/ldmain.c binutils-2.26/ld/ldmain.c +--- binutils-2.26.orig/ld/ldmain.c 2016-02-19 09:35:36.701003291 +0000 ++++ binutils-2.26/ld/ldmain.c 2016-02-19 09:35:54.922106617 +0000 +@@ -219,6 +219,9 @@ main (int argc, char **argv) + + xatexit (ld_cleanup); + ++ /* Remove temporary object-only files. */ ++ xatexit (cmdline_remove_object_only_files); ++ + /* Set up the sysroot directory. */ + ld_sysroot = get_sysroot (argc, argv); + if (*ld_sysroot) +@@ -291,8 +294,8 @@ main (int argc, char **argv) + default_target = ldemul_choose_target (argc, argv); + config.maxpagesize = bfd_emul_get_maxpagesize (default_target); + config.commonpagesize = bfd_emul_get_commonpagesize (default_target); +- lang_init (); +- ldexp_init (); ++ lang_init (FALSE); ++ ldexp_init (FALSE); + ldemul_before_parse (); + lang_has_input_file = FALSE; + parse_args (argc, argv); +@@ -307,34 +310,7 @@ main (int argc, char **argv) + + ldemul_set_symbols (); + +- /* If we have not already opened and parsed a linker script, +- try the default script from command line first. */ +- if (saved_script_handle == NULL +- && command_line.default_script != NULL) +- { +- ldfile_open_command_file (command_line.default_script); +- parser_input = input_script; +- yyparse (); +- } +- +- /* If we have not already opened and parsed a linker script +- read the emulation's appropriate default script. */ +- if (saved_script_handle == NULL) +- { +- int isfile; +- char *s = ldemul_get_script (&isfile); +- +- if (isfile) +- ldfile_open_default_command_file (s); +- else +- { +- lex_string = s; +- lex_redirect (s, _("built in linker script"), 1); +- } +- parser_input = input_script; +- yyparse (); +- lex_string = NULL; +- } ++ ld_parse_linker_script (); + + if (verbose) + { +@@ -445,7 +421,7 @@ main (int argc, char **argv) + fprintf (stderr, "lookup = %p val %lx\n", h, h ? h->u.def.value : 1); + } + #endif +- ldexp_finish (); ++ ldexp_finish (FALSE); + lang_finish (); + + /* Even if we're producing relocatable output, some non-fatal errors should +@@ -465,6 +441,8 @@ main (int argc, char **argv) + if (!bfd_close (link_info.output_bfd)) + einfo (_("%F%B: final close failed: %E\n"), link_info.output_bfd); + ++ link_info.output_bfd = NULL; ++ + /* If the --force-exe-suffix is enabled, and we're making an + executable file and it doesn't end in .exe, copy it to one + which does. */ +@@ -512,6 +490,9 @@ main (int argc, char **argv) + } + } + ++ if (link_info.emit_gnu_object_only) ++ cmdline_emit_object_only_section (); ++ + END_PROGRESS (program_name); + + if (config.stats) +@@ -805,7 +786,9 @@ add_archive_element (struct bfd_link_inf + *subsbfd = input->the_bfd; + } + } ++ else + #endif /* ENABLE_PLUGINS */ ++ cmdline_check_object_only_section (input->the_bfd, FALSE); + + ldlang_add_file (input); + +@@ -1484,3 +1467,38 @@ notice (struct bfd_link_info *info, + + return TRUE; + } ++ ++/* Parse the linker script. */ ++ ++void ++ld_parse_linker_script () ++{ ++ /* If we have not already opened and parsed a linker script, ++ try the default script from command line first. */ ++ if (saved_script_handle == NULL ++ && command_line.default_script != NULL) ++ { ++ ldfile_open_command_file (command_line.default_script); ++ parser_input = input_script; ++ yyparse (); ++ } ++ ++ /* If we have not already opened and parsed a linker script ++ read the emulation's appropriate default script. */ ++ if (saved_script_handle == NULL) ++ { ++ int isfile; ++ char *s = ldemul_get_script (&isfile); ++ ++ if (isfile) ++ ldfile_open_default_command_file (s); ++ else ++ { ++ lex_string = s; ++ lex_redirect (s, _("built in linker script"), 1); ++ } ++ parser_input = input_script; ++ yyparse (); ++ lex_string = NULL; ++ } ++} +diff -rup binutils-2.26.orig/ld/ldmain.h binutils-2.26/ld/ldmain.h +--- binutils-2.26.orig/ld/ldmain.h 2016-02-19 09:35:36.701003291 +0000 ++++ binutils-2.26/ld/ldmain.h 2016-02-19 09:35:54.922106617 +0000 +@@ -59,4 +59,6 @@ extern void add_wrap (const char *); + extern void add_ignoresym (struct bfd_link_info *, const char *); + extern void add_keepsyms_file (const char *); + ++extern void ld_parse_linker_script (void); ++ + #endif +diff -rup binutils-2.26.orig/ld/lexsup.c binutils-2.26/ld/lexsup.c +--- binutils-2.26.orig/ld/lexsup.c 2016-02-19 09:35:36.700003285 +0000 ++++ binutils-2.26/ld/lexsup.c 2016-02-19 09:35:54.923106623 +0000 +@@ -169,6 +169,9 @@ static const struct ld_option ld_options + '\0', N_("PLUGIN"), N_("Load named plugin"), ONE_DASH }, + { {"plugin-opt", required_argument, NULL, OPTION_PLUGIN_OPT}, + '\0', N_("ARG"), N_("Send arg to last-loaded plugin"), ONE_DASH }, ++ { {"plugin-save-temps", no_argument, NULL, OPTION_PLUGIN_SAVE_TEMPS}, ++ '\0', NULL, N_("Store plugin intermediate files permanently"), ++ ONE_DASH }, + { {"flto", optional_argument, NULL, OPTION_IGNORE}, + '\0', NULL, N_("Ignored for GCC LTO option compatibility"), + ONE_DASH }, +@@ -1020,6 +1023,9 @@ parse_args (unsigned argc, char **argv) + if (plugin_opt_plugin_arg (optarg)) + einfo (_("%P%F: bad -plugin-opt option\n")); + break; ++ case OPTION_PLUGIN_SAVE_TEMPS: ++ plugin_save_temps = TRUE; ++ break; + #endif /* ENABLE_PLUGINS */ + case 'q': + link_info.emitrelocations = TRUE; +diff -rup binutils-2.26.orig/ld/plugin.c binutils-2.26/ld/plugin.c +--- binutils-2.26.orig/ld/plugin.c 2016-02-19 09:35:36.702003296 +0000 ++++ binutils-2.26/ld/plugin.c 2016-02-19 09:35:54.923106623 +0000 +@@ -57,6 +57,9 @@ extern int errno; + /* Report plugin symbols. */ + bfd_boolean report_plugin_symbols; + ++/* Store plugin intermediate files permanently. */ ++bfd_boolean plugin_save_temps; ++ + /* The suffix to append to the name of the real (claimed) object file + when generating a dummy BFD to hold the IR symbols sent from the + plugin. For cosmetic use only; appears in maps, crefs etc. */ +@@ -1182,6 +1185,9 @@ plugin_maybe_claim (lang_input_statement + { + bfd *abfd = entry->the_bfd->plugin_dummy_bfd; + ++ /* Check object only section. */ ++ cmdline_check_object_only_section (entry->the_bfd, TRUE); ++ + /* Discard the real file's BFD and substitute the dummy one. */ + + /* We can't call bfd_close on archives. BFD archive handling +@@ -1227,14 +1233,17 @@ plugin_call_cleanup (void) + { + if (curplug->cleanup_handler && !curplug->cleanup_done) + { +- enum ld_plugin_status rv; +- curplug->cleanup_done = TRUE; +- called_plugin = curplug; +- rv = (*curplug->cleanup_handler) (); +- called_plugin = NULL; +- if (rv != LDPS_OK) +- info_msg (_("%P: %s: error in plugin cleanup: %d (ignored)\n"), +- curplug->name, rv); ++ if (!plugin_save_temps) ++ { ++ enum ld_plugin_status rv; ++ curplug->cleanup_done = TRUE; ++ called_plugin = curplug; ++ rv = (*curplug->cleanup_handler) (); ++ called_plugin = NULL; ++ if (rv != LDPS_OK) ++ info_msg (_("%P: %s: error in plugin cleanup: %d (ignored)\n"), ++ curplug->name, rv); ++ } + dlclose (curplug->dlhandle); + } + curplug = curplug->next; +diff -rup binutils-2.26.orig/ld/plugin.h binutils-2.26/ld/plugin.h +--- binutils-2.26.orig/ld/plugin.h 2016-02-19 09:35:36.702003296 +0000 ++++ binutils-2.26/ld/plugin.h 2016-02-19 09:35:54.924106628 +0000 +@@ -24,6 +24,9 @@ + /* Report plugin symbols. */ + extern bfd_boolean report_plugin_symbols; + ++/* Store plugin intermediate files permanently. */ ++extern bfd_boolean plugin_save_temps; ++ + /* Set at all symbols read time, to avoid recursively offering the plugin + its own newly-added input files and libs to claim. */ + extern bfd_boolean no_more_claiming; +diff -rup binutils-2.26.orig/ld/scripttempl/armbpabi.sc binutils-2.26/ld/scripttempl/armbpabi.sc +--- binutils-2.26.orig/ld/scripttempl/armbpabi.sc 2016-02-19 09:35:36.704003308 +0000 ++++ binutils-2.26/ld/scripttempl/armbpabi.sc 2016-02-19 09:35:54.924106628 +0000 +@@ -36,7 +36,7 @@ INTERP=".interp 0 : { *(.interp) } + PLT=".plt ${RELOCATING-0} : { *(.plt) }" + RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" + DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro .data.rel.ro.*) }" +-DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" ++DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.gnu_object_only) }" + if test -z "${NO_SMALL_DATA}"; then + SBSS=".sbss ${RELOCATING-0} : + { +diff -rup binutils-2.26.orig/ld/scripttempl/elf32sh-symbian.sc binutils-2.26/ld/scripttempl/elf32sh-symbian.sc +--- binutils-2.26.orig/ld/scripttempl/elf32sh-symbian.sc 2016-02-19 09:35:36.705003313 +0000 ++++ binutils-2.26/ld/scripttempl/elf32sh-symbian.sc 2016-02-19 09:35:54.925106634 +0000 +@@ -88,7 +88,7 @@ fi + PLT=".plt : { *(.plt) } :dynamic :dyn" + DYNAMIC=".dynamic : { *(.dynamic) } :dynamic :dyn" + RODATA=".rodata ALIGN(4) : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" +-DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.directive) *(.gnu.lto_*) }" ++DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.directive) *(.gnu.lto_*) *(.gnu_object_only) }" + test -z "$GOT" && GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) } :dynamic :dyn" + INIT_ARRAY=".init_array ${RELOCATING-0} : + { +diff -rup binutils-2.26.orig/ld/scripttempl/elf64hppa.sc binutils-2.26/ld/scripttempl/elf64hppa.sc +--- binutils-2.26.orig/ld/scripttempl/elf64hppa.sc 2016-02-19 09:35:36.705003313 +0000 ++++ binutils-2.26/ld/scripttempl/elf64hppa.sc 2016-02-19 09:35:54.925106634 +0000 +@@ -132,7 +132,7 @@ fi + DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" + RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" + DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }" +-DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" ++DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.gnu_object_only) }" + if test -z "${NO_SMALL_DATA}"; then + SBSS=".sbss ${RELOCATING-0} : + { +diff -rup binutils-2.26.orig/ld/scripttempl/elf.sc binutils-2.26/ld/scripttempl/elf.sc +--- binutils-2.26.orig/ld/scripttempl/elf.sc 2016-02-19 09:35:36.705003313 +0000 ++++ binutils-2.26/ld/scripttempl/elf.sc 2016-02-19 09:35:54.924106628 +0000 +@@ -170,7 +170,7 @@ RELA_IPLT=".rela.iplt ${RELOCATING-0} + DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" + RODATA=".${RODATA_NAME} ${RELOCATING-0} : { *(.${RODATA_NAME}${RELOCATING+ .${RODATA_NAME}.* .gnu.linkonce.r.*}) }" + DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }" +-DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" ++DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.gnu_object_only) }" + if test -z "${NO_SMALL_DATA}"; then + SBSS=".${SBSS_NAME} ${RELOCATING-0} : + { +diff -rup binutils-2.26.orig/ld/scripttempl/elfxtensa.sc binutils-2.26/ld/scripttempl/elfxtensa.sc +--- binutils-2.26.orig/ld/scripttempl/elfxtensa.sc 2016-02-19 09:35:36.705003313 +0000 ++++ binutils-2.26/ld/scripttempl/elfxtensa.sc 2016-02-19 09:35:54.925106634 +0000 +@@ -145,7 +145,7 @@ fi + DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" + RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" + DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }" +-DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" ++DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.gnu_object_only) }" + INIT_LIT=".init.literal 0 : { *(.init.literal) }" + INIT=".init 0 : { *(.init) }" + FINI_LIT=".fini.literal 0 : { *(.fini.literal) }" +diff -rup binutils-2.26.orig/ld/scripttempl/mep.sc binutils-2.26/ld/scripttempl/mep.sc +--- binutils-2.26.orig/ld/scripttempl/mep.sc 2016-02-19 09:35:36.706003319 +0000 ++++ binutils-2.26/ld/scripttempl/mep.sc 2016-02-19 09:35:54.926106640 +0000 +@@ -119,7 +119,7 @@ fi + DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" + RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" + DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro .data.rel.ro.*) }" +-DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" ++DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.gnu_object_only) }" + if test -z "${NO_SMALL_DATA}"; then + SBSS=".sbss ${RELOCATING-0} : + { +diff -rup binutils-2.26.orig/ld/scripttempl/pep.sc binutils-2.26/ld/scripttempl/pep.sc +--- binutils-2.26.orig/ld/scripttempl/pep.sc 2016-02-19 09:35:36.706003319 +0000 ++++ binutils-2.26/ld/scripttempl/pep.sc 2016-02-19 09:35:54.926106640 +0000 +@@ -178,6 +178,7 @@ SECTIONS + *(.drectve) + ${RELOCATING+ *(.note.GNU-stack)} + ${RELOCATING+ *(.gnu.lto_*)} ++ ${RELOCATING+ *(.gnu_object_only)} + } + + .idata ${RELOCATING+BLOCK(__section_alignment__)} : +diff -rup binutils-2.26.orig/ld/scripttempl/pe.sc binutils-2.26/ld/scripttempl/pe.sc +--- binutils-2.26.orig/ld/scripttempl/pe.sc 2016-02-19 09:35:36.706003319 +0000 ++++ binutils-2.26/ld/scripttempl/pe.sc 2016-02-19 09:35:54.926106640 +0000 +@@ -165,6 +165,7 @@ SECTIONS + *(.drectve) + ${RELOCATING+ *(.note.GNU-stack)} + ${RELOCATING+ *(.gnu.lto_*)} ++ ${RELOCATING+ *(.gnu_object_only)} + } + + .idata ${RELOCATING+BLOCK(__section_alignment__)} : +--- binutils.orig/bfd/bfd-in2.h 2017-03-02 11:14:48.572979573 +0000 ++++ binutils-2.28/bfd/bfd-in2.h 2017-03-02 11:21:39.828458555 +0000 +@@ -1118,6 +1118,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_se + + char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + ++const char *bfd_extract_object_only_section ++ (bfd *abfd); ++ + /* Extracted from libbfd.c. */ + + /* Byte swapping macros for user section data. */ +--- binutils.orig/bfd/opncls.c 2017-03-02 11:14:48.586979385 +0000 ++++ binutils-2.28/bfd/opncls.c 2017-03-02 11:23:23.546065945 +0000 +@@ -1990,3 +1990,69 @@ bfd_follow_build_id_debuglink (bfd *abfd + get_build_id_name, + check_build_id_file, &build_id); + } ++ ++/* ++FUNCTION ++ bfd_extract_object_only_section ++ ++SYNOPSIS ++ const char *bfd_extract_object_only_section ++ (bfd *abfd); ++ ++DESCRIPTION ++ ++ Takes a @var{ABFD} and extract the .gnu_object_only section into ++ a temporary file. ++ ++RETURNS ++ The name of the temporary file is returned if all is ok. ++ Otherwise <> is returned and bfd_error is set. ++*/ ++ ++const char * ++bfd_extract_object_only_section (bfd *abfd) ++{ ++ asection *sec = abfd->object_only_section; ++ const char *name; ++ FILE *file; ++ bfd_byte *memhunk = NULL; ++ size_t off, size; ++ bfd_error_type err; ++ ++ /* Get a temporary object-only file. */ ++ name = make_temp_file (".obj-only.o"); ++ ++ /* Open the object-only file. */ ++ file = _bfd_real_fopen (name, FOPEN_WB); ++ if (!bfd_get_full_section_contents (abfd, sec, &memhunk)) ++ { ++ err = bfd_get_error (); ++ ++loser: ++ free (memhunk); ++ fclose (file); ++ unlink (name); ++ bfd_set_error (err); ++ return NULL; ++ } ++ ++ off = 0; ++ size = sec->size; ++ while (off != size) ++ { ++ size_t written, nwrite = size - off; ++ ++ written = fwrite (memhunk + off, 1, nwrite, file); ++ if (written < nwrite && ferror (file)) ++ { ++ err = bfd_error_system_call; ++ goto loser; ++ } ++ ++ off += written; ++ } ++ ++ free (memhunk); ++ fclose (file); ++ return name; ++} +--- binutils.orig/bfd/plugin.c 2017-03-02 11:37:31.572677260 +0000 ++++ binutils-2.28/bfd/plugin.c 2017-03-02 11:40:35.246209573 +0000 +@@ -132,10 +132,10 @@ register_claim_file (ld_plugin_claim_fil + } + + static asection bfd_plugin_fake_text_section +- = BFD_FAKE_SECTION (bfd_plugin_fake_text_section, 0, 0, ".text", 0); ++= BFD_FAKE_SECTION (bfd_plugin_fake_text_section, 0, ".text", 0, 0); + static asection bfd_plugin_fake_common_section +- = BFD_FAKE_SECTION (bfd_plugin_fake_common_section, SEC_IS_COMMON, 0, +- NULL, 0); ++ = BFD_FAKE_SECTION (bfd_plugin_fake_common_section, 0, ++ NULL, 0, SEC_IS_COMMON); + + /* Get symbols from object only section. */ + +--- binutils.orig/ld/emultempl/armelf.em 2017-03-02 11:58:14.632981042 +0000 ++++ binutils-2.28/ld/emultempl/armelf.em 2017-03-02 12:00:55.663819055 +0000 +@@ -414,7 +414,7 @@ gld${EMULATION_NAME}_after_allocation (v + } + + static void +-gld${EMULATION_NAME}_finish (void) ++arm_finish (void) + { + struct bfd_link_hash_entry * h; + +@@ -441,7 +441,7 @@ gld${EMULATION_NAME}_finish (void) + } + } + +- finish_default (); ++ gld${EMULATION_NAME}_finish (); + + if (params.thumb_entry_symbol) + { +@@ -790,4 +790,4 @@ LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME + LDEMUL_SET_SYMBOLS=gld"${EMULATION_NAME}"_set_symbols + + # Call the extra arm-elf function +-LDEMUL_FINISH=gld${EMULATION_NAME}_finish ++LDEMUL_FINISH=arm_finish +--- binutils.orig/ld/emultempl/ppc64elf.em 2017-03-02 11:58:14.632981042 +0000 ++++ binutils-2.28/ld/emultempl/ppc64elf.em 2017-03-02 12:01:40.961210895 +0000 +@@ -561,7 +561,7 @@ gld${EMULATION_NAME}_after_allocation (v + /* Final emulation specific call. */ + + static void +-gld${EMULATION_NAME}_finish (void) ++ppc_finish (void) + { + char *msg = NULL; + char *line, *endline; +@@ -592,7 +592,7 @@ gld${EMULATION_NAME}_finish (void) + if (msg != NULL) + free (msg); + +- finish_default (); ++ gld${EMULATION_NAME}_finish (); + } + + +@@ -926,4 +926,4 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS= + LDEMUL_AFTER_OPEN=ppc_after_open + LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation + LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation +-LDEMUL_FINISH=gld${EMULATION_NAME}_finish ++LDEMUL_FINISH=ppc_finish +--- binutils.orig/bfd/format.c 2018-01-22 16:04:36.855155517 +0000 ++++ binutils-2.30.0/bfd/format.c 2018-01-22 16:11:36.546253154 +0000 +@@ -47,6 +47,7 @@ SUBSECTION + #include "bfd.h" + #include "libbfd.h" + #if BFD_SUPPORTS_PLUGINS ++#include "plugin-api.h" + #include "plugin.h" + #endif + +--- binutils.orig/ld/ldlang.c 2018-01-22 16:04:37.271150658 +0000 ++++ binutils-2.30.0/ld/ldlang.c 2018-01-22 16:14:10.653453040 +0000 +@@ -8954,6 +8954,7 @@ cmdline_object_only_list_append (cmdline + archive = abfd->my_archive; + if (archive) + break; ++ /* Fall through. */ + case cmdline_is_file_enum: + cmdline_list_append (&cmdline_object_only_file_list, type, data); + return; 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.28-ignore-gold-duplicates.patch b/SOURCES/binutils-2.28-ignore-gold-duplicates.patch new file mode 100644 index 0000000..346f956 --- /dev/null +++ b/SOURCES/binutils-2.28-ignore-gold-duplicates.patch @@ -0,0 +1,14 @@ +diff -rup binutils.orig/ld/ldmain.c binutils-2.28/ld/ldmain.c +--- binutils.orig/ld/ldmain.c 2017-06-09 09:08:26.954016429 +0100 ++++ binutils-2.28/ld/ldmain.c 2017-06-09 09:09:11.307490976 +0100 +@@ -923,6 +923,10 @@ multiple_definition (struct bfd_link_inf + obfd = h->u.def.section->owner; + break; + case bfd_link_hash_indirect: ++ /* PR 21074: The GOLD linker can produce multiple indirect ++ refences to the same symbol. These can be ignored. */ ++ if (bfd_is_ind_section (nsec)) ++ return; + osec = bfd_ind_section_ptr; + oval = 0; + obfd = NULL; 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..d8ce241 --- /dev/null +++ b/SOURCES/binutils-2.29-filename-in-error-messages.patch @@ -0,0 +1,124 @@ +--- binutils.orig/binutils/readelf.c 2018-01-22 15:48:10.450701702 +0000 ++++ binutils-2.30.0/binutils/readelf.c 2018-01-22 15:55:26.739588657 +0000 +@@ -19019,75 +19019,85 @@ 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); +- fclose (filedata->handle); +- free (filedata); +- return FALSE; +- } +- +- filedata->file_size = (bfd_size_type) statbuf.st_size; +- +- if (memcmp (armag, ARMAG, SARMAG) == 0) +- { +- if (! process_archive (filedata, FALSE)) +- ret = FALSE; +- } +- else if (memcmp (armag, ARMAGT, SARMAG) == 0) +- { +- if ( ! process_archive (filedata, TRUE)) +- ret = FALSE; ++ error (_("Failed to read file's magic number\n")); + } + else + { +- if (do_archive_index) +- error (_("File %s is not an archive so its index cannot be displayed.\n"), +- file_name); ++ filedata->file_size = (bfd_size_type) statbuf.st_size; + +- rewind (filedata->handle); +- archive_file_size = archive_file_offset = 0; +- +- if (! process_object (filedata)) +- ret = FALSE; ++ if (memcmp (armag, ARMAG, SARMAG) == 0) ++ { ++ if (process_archive (filedata, FALSE)) ++ ret = TRUE; ++ } ++ else if (memcmp (armag, ARMAGT, SARMAG) == 0) ++ { ++ if (process_archive (filedata, TRUE)) ++ ret = TRUE; ++ } ++ else ++ { ++ if (do_archive_index) ++ error (_("Not an archive so its index cannot be displayed.\n")); ++ ++ rewind (filedata->handle); ++ archive_file_size = archive_file_offset = 0; ++ ++ if (process_object (filedata)) ++ ret = TRUE; ++ } + } + + fclose (filedata->handle); ++ done: + free (filedata); ++ free (program_name); ++ program_name = saved_program_name; + + return ret; + } diff --git a/SOURCES/binutils-2.30-allow_R_AARCH64-symbols.patch b/SOURCES/binutils-2.30-allow_R_AARCH64-symbols.patch new file mode 100644 index 0000000..213b267 --- /dev/null +++ b/SOURCES/binutils-2.30-allow_R_AARCH64-symbols.patch @@ -0,0 +1,147 @@ +From 279b2f94168ee91e02ccd070d27c983fc001fe12 Mon Sep 17 00:00:00 2001 +From: Renlin Li +Date: Sat, 3 Feb 2018 13:18:17 +0000 +Subject: [PATCH] [PR22764][LD][AARCH64]Allow R_AARCH64_ABS16 and + R_AARCH64_ABS32 against absolution symbol or undefine symbol in shared + object. + +The assumption that R_AARCH64_ABS16 and R_AARCH64_ABS32 relocation in LP64 abi +will be used to generate an address does not hold for absolute symbol. +In this case, it is a value fixed at static linking time. + +The condition to check the relocations is relax to allow absolute symbol and +undefined symbol case. + +bfd/ + +2018-02-05 Renlin Li + + PR ld/22764 + * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the + R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the + check for writeable section as well. + +ld/ + +2018-02-05 Renlin Li + + PR ld/22764 + * testsuite/ld-aarch64/emit-relocs-258.s: Define symbol as an address. + * testsuite/ld-aarch64/emit-relocs-259.s: Likewise. + * testsuite/ld-aarch64/aarch64-elf.exp: Run new test. + * testsuite/ld-aarch64/pr22764.s: New. + * testsuite/ld-aarch64/pr22764.d: New. +--- + bfd/ChangeLog | 7 +++++++ + bfd/elfnn-aarch64.c | 15 ++++++++++++--- + ld/ChangeLog | 8 ++++++++ + ld/testsuite/ld-aarch64/aarch64-elf.exp | 1 + + ld/testsuite/ld-aarch64/emit-relocs-258.s | 3 ++- + ld/testsuite/ld-aarch64/emit-relocs-259.s | 3 ++- + ld/testsuite/ld-aarch64/pr22764.d | 18 ++++++++++++++++++ + ld/testsuite/ld-aarch64/pr22764.s | 6 ++++++ + 8 files changed, 56 insertions(+), 5 deletions(-) + create mode 100644 ld/testsuite/ld-aarch64/pr22764.d + create mode 100644 ld/testsuite/ld-aarch64/pr22764.s + +diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c +index af448f9..2737773 100644 +--- a/bfd/elfnn-aarch64.c ++++ b/bfd/elfnn-aarch64.c +@@ -7189,10 +7189,19 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, + #if ARCH_SIZE == 64 + case BFD_RELOC_AARCH64_32: + #endif +- if (bfd_link_pic (info) +- && (sec->flags & SEC_ALLOC) != 0 +- && (sec->flags & SEC_READONLY) != 0) ++ if (bfd_link_pic (info) && (sec->flags & SEC_ALLOC) != 0) + { ++ if (h != NULL ++ /* This is an absolute symbol. It represents a value instead ++ of an address. */ ++ && ((h->root.type == bfd_link_hash_defined ++ && bfd_is_abs_section (h->root.u.def.section)) ++ /* This is an undefined symbol. */ ++ || h->root.type == bfd_link_hash_undefined)) ++ break; ++ ++ /* For local symbols, defined global symbols in a non-ABS section, ++ it is assumed that the value is an address. */ + int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START; + _bfd_error_handler + /* xgettext:c-format */ +diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp +index 2602a43..c67ffb1 100644 +--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp ++++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp +@@ -285,6 +285,7 @@ run_dump_test "pr17415" + run_dump_test_lp64 "tprel_g2_overflow" + run_dump_test "tprel_add_lo12_overflow" + run_dump_test "protected-data" ++run_dump_test_lp64 "pr22764" + + # ifunc tests + run_dump_test "ifunc-1" +diff --git a/ld/testsuite/ld-aarch64/emit-relocs-258.s b/ld/testsuite/ld-aarch64/emit-relocs-258.s +index f724776..87bb657 100644 +--- a/ld/testsuite/ld-aarch64/emit-relocs-258.s ++++ b/ld/testsuite/ld-aarch64/emit-relocs-258.s +@@ -1,5 +1,6 @@ ++.global dummy + .text +- ++dummy: + ldr x0, .L1 + + .L1: +diff --git a/ld/testsuite/ld-aarch64/emit-relocs-259.s b/ld/testsuite/ld-aarch64/emit-relocs-259.s +index 7e1ba3c..0977c9d 100644 +--- a/ld/testsuite/ld-aarch64/emit-relocs-259.s ++++ b/ld/testsuite/ld-aarch64/emit-relocs-259.s +@@ -1,5 +1,6 @@ ++.global dummy + .text +- ++dummy: + ldr x0, .L1 + + .L1: +diff --git a/ld/testsuite/ld-aarch64/pr22764.d b/ld/testsuite/ld-aarch64/pr22764.d +new file mode 100644 +index 0000000..997519f +--- /dev/null ++++ b/ld/testsuite/ld-aarch64/pr22764.d +@@ -0,0 +1,18 @@ ++#source: pr22764.s ++#ld: -shared -T relocs.ld -defsym sym_abs1=0x1 -defsym sym_abs2=0x2 -defsym sym_abs3=0x3 -e0 --emit-relocs ++#notarget: aarch64_be-*-* ++#objdump: -dr ++#... ++ ++Disassembly of section \.text: ++ ++0000000000010000 \<\.text\>: ++ 10000: d503201f nop ++ ... ++ 10004: R_AARCH64_ABS64 sym_abs1 ++ 1000c: 00000002 \.word 0x00000002 ++ 1000c: R_AARCH64_ABS32 sym_abs2 ++ 10010: 0003 \.short 0x0003 ++ 10010: R_AARCH64_ABS16 sym_abs3 ++ 10012: 0000 \.short 0x0000 ++ 10014: d503201f nop +diff --git a/ld/testsuite/ld-aarch64/pr22764.s b/ld/testsuite/ld-aarch64/pr22764.s +new file mode 100644 +index 0000000..25e36b4 +--- /dev/null ++++ b/ld/testsuite/ld-aarch64/pr22764.s +@@ -0,0 +1,6 @@ ++ .text ++ nop ++ .xword sym_abs1 ++ .word sym_abs2 ++ .short sym_abs3 ++ nop +-- +2.9.3 diff --git a/SOURCES/binutils-AArch64-gold.patch b/SOURCES/binutils-AArch64-gold.patch new file mode 100644 index 0000000..2841091 --- /dev/null +++ b/SOURCES/binutils-AArch64-gold.patch @@ -0,0 +1,373 @@ +diff -pruN binutils-2.30.orig/gold/aarch64.cc binutils-2.30/gold/aarch64.cc +--- binutils-2.30.orig/gold/aarch64.cc 2019-03-28 06:50:31.813828734 -0400 ++++ binutils-2.30/gold/aarch64.cc 2019-03-28 06:50:46.993954670 -0400 +@@ -6478,6 +6478,17 @@ Target_aarch64::Scan:: + gold_error(_("%s: unsupported reloc %u in pos independent link."), + object->name().c_str(), r_type); + } ++ // Make a PLT entry if necessary. ++ if (gsym->needs_plt_entry()) ++ { ++ target->make_plt_entry(symtab, layout, gsym); ++ // Since this is not a PC-relative relocation, we may be ++ // taking the address of a function. In that case we need to ++ // set the entry in the dynamic symbol table to the address of ++ // the PLT entry. ++ if (gsym->is_from_dynobj() && !parameters->options().shared()) ++ gsym->set_needs_dynsym_value(); ++ } + break; + + case elfcpp::R_AARCH64_LD_PREL_LO19: // 273 +diff -pruN binutils-2.30.orig/gold/ChangeLog binutils-2.30/gold/ChangeLog +--- binutils-2.30.orig/gold/ChangeLog 2018-01-27 10:08:21.000000000 -0500 ++++ binutils-2.30/gold/ChangeLog 2019-03-28 06:52:51.924999245 -0400 +@@ -1,3 +1,14 @@ ++2019-02-19 Egeyar Bagcioglu ++ ++ PR gold/23870 ++ * aarch64.cc (Target_aarch64::Scan::global): Check if a symbol with ++ R_AARCH64_MOVW_.ABS_* relocations requires a PLT entry. ++ * testsuite/Makefile.am: Add aarch64_pr23870 test case. ++ * testsuite/Makefile.in: Regenerate. ++ * testsuite/aarch64_pr23870_bar.c: New file. ++ * testsuite/aarch64_pr23870_foo.c: New file. ++ * testsuite/aarch64_pr23870_main.S: New file. ++ + 2018-01-27 Nick Clifton + + This is the 2.30 release: +diff -pruN binutils-2.30.orig/gold/testsuite/aarch64_pr23870_bar.c binutils-2.30/gold/testsuite/aarch64_pr23870_bar.c +--- binutils-2.30.orig/gold/testsuite/aarch64_pr23870_bar.c 1969-12-31 19:00:00.000000000 -0500 ++++ binutils-2.30/gold/testsuite/aarch64_pr23870_bar.c 2019-03-28 06:50:46.993954670 -0400 +@@ -0,0 +1,6 @@ ++void bar (void); ++ ++void bar () ++{ ++ return; ++} +diff -pruN binutils-2.30.orig/gold/testsuite/aarch64_pr23870_foo.c binutils-2.30/gold/testsuite/aarch64_pr23870_foo.c +--- binutils-2.30.orig/gold/testsuite/aarch64_pr23870_foo.c 1969-12-31 19:00:00.000000000 -0500 ++++ binutils-2.30/gold/testsuite/aarch64_pr23870_foo.c 2019-03-28 06:50:46.993954670 -0400 +@@ -0,0 +1,6 @@ ++void foo (void (*bar)(void)); ++ ++void foo (void (*bar)(void)) ++{ ++ bar(); ++} +diff -pruN binutils-2.30.orig/gold/testsuite/aarch64_pr23870_main.S binutils-2.30/gold/testsuite/aarch64_pr23870_main.S +--- binutils-2.30.orig/gold/testsuite/aarch64_pr23870_main.S 1969-12-31 19:00:00.000000000 -0500 ++++ binutils-2.30/gold/testsuite/aarch64_pr23870_main.S 2019-03-28 06:50:46.993954670 -0400 +@@ -0,0 +1,15 @@ ++ ++ .text ++ .globl main ++ .type main,#function ++main: ++ stp x29, x30, [sp,#-16]! ++ mov x29, sp ++ movz x0, #:abs_g3:bar ++ movk x0, #:abs_g2_nc:bar ++ movk x0, #:abs_g1_nc:bar ++ movk x0, #:abs_g0_nc:bar ++ add x0, x0, #0x0 ++ bl foo ++ ldp x29, x30, [sp],#16 ++ ret +diff -pruN binutils-2.30.orig/gold/testsuite/Makefile.am binutils-2.30/gold/testsuite/Makefile.am +--- binutils-2.30.orig/gold/testsuite/Makefile.am 2019-03-28 06:50:31.563826660 -0400 ++++ binutils-2.30/gold/testsuite/Makefile.am 2019-03-28 06:50:46.993954670 -0400 +@@ -3144,6 +3144,26 @@ pr22266: pr22266_main.o pr22266_ar.o gcc + pr22266_ar.o: pr22266_a.o gcctestdir/ld + gcctestdir/ld -r -T $(srcdir)/pr22266_script.t -o $@ pr22266_a.o + ++if DEFAULT_TARGET_AARCH64 ++ ++check_PROGRAMS += aarch64_pr23870 ++aarch64_pr23870_SOURCES = aarch64_pr23870_foo.c ++aarch64_pr23870_DEPENDENCIES = \ ++ gcctestdir/ld gcctestdir/as aarch64_pr23870_main.o \ ++ aarch64_pr23870_foo.o aarch64_pr23870_bar.so ++aarch64_pr23870_LDFLAGS = -Wl,-R,. -L. -Wl,-l:aarch64_pr23870_bar.so ++aarch64_pr23870_LDADD = aarch64_pr23870_main.o ++aarch64_pr23870_main.o: aarch64_pr23870_main.S ++ $(COMPILE) -c -o $@ $< ++aarch64_pr23870_foo.o: aarch64_pr23870_foo.c ++ $(COMPILE) -c -o $@ $< ++aarch64_pr23870_bar.o: aarch64_pr23870_bar.c ++ $(COMPILE) -c -fPIC -o $@ $< ++aarch64_pr23870_bar.so: aarch64_pr23870_bar.o ++ $(COMPILE) -shared -o $@ $< ++ ++endif DEFAULT_TARGET_AARCH64 ++ + endif GCC + endif NATIVE_LINKER + +diff -pruN binutils-2.30.orig/gold/testsuite/Makefile.in binutils-2.30/gold/testsuite/Makefile.in +--- binutils-2.30.orig/gold/testsuite/Makefile.in 2019-03-28 06:50:31.573826743 -0400 ++++ binutils-2.30/gold/testsuite/Makefile.in 2019-03-28 06:59:26.518313455 -0400 +@@ -70,7 +70,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + $(am__EXEEXT_31) $(am__EXEEXT_32) $(am__EXEEXT_33) \ + $(am__EXEEXT_34) $(am__EXEEXT_35) $(am__EXEEXT_36) \ + $(am__EXEEXT_37) $(am__EXEEXT_38) $(am__EXEEXT_39) \ +- $(am__EXEEXT_40) $(am__EXEEXT_41) ++ $(am__EXEEXT_40) $(am__EXEEXT_41) $(am__EXEEXT_42) + @NATIVE_OR_CROSS_LINKER_TRUE@am__append_1 = object_unittest \ + @NATIVE_OR_CROSS_LINKER_TRUE@ binary_unittest leb128_unittest \ + @NATIVE_OR_CROSS_LINKER_TRUE@ overflow_unittest +@@ -817,27 +817,28 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_84 = gnu_property_test.sh + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_85 = gnu_property_test.stdout + @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_86 = pr22266 ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_87 = aarch64_pr23870 + + # These tests work with native and cross linkers. + + # Test script section order. +-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_87 = script_test_10.sh +-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_88 = script_test_10.stdout +-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_89 = script_test_10 ++@NATIVE_OR_CROSS_LINKER_TRUE@am__append_88 = script_test_10.sh ++@NATIVE_OR_CROSS_LINKER_TRUE@am__append_89 = script_test_10.stdout ++@NATIVE_OR_CROSS_LINKER_TRUE@am__append_90 = script_test_10 + + # These tests work with cross linkers only. +-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_90 = split_i386.sh +-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_91 = split_i386_1.stdout split_i386_2.stdout \ ++@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_91 = split_i386.sh ++@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_92 = split_i386_1.stdout split_i386_2.stdout \ + @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout + +-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_92 = split_i386_1 split_i386_2 split_i386_3 \ ++@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_93 = split_i386_1 split_i386_2 split_i386_3 \ + @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_4 split_i386_r + +-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_93 = split_x86_64.sh \ ++@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_94 = split_x86_64.sh \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_plt_1.sh \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_1.sh \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_2.sh +-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_94 = split_x86_64_1.stdout \ ++@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_95 = split_x86_64_1.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_2.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_3.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_4.stdout \ +@@ -845,14 +846,14 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_plt_1.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_1.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_2.stdout +-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_95 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \ ++@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_96 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_4 split_x86_64_r + +-@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_96 = split_x32.sh +-@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_97 = split_x32_1.stdout split_x32_2.stdout \ ++@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_97 = split_x32.sh ++@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_98 = split_x32_1.stdout split_x32_2.stdout \ + @DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x32_3.stdout split_x32_4.stdout split_x32_r.stdout + +-@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_98 = split_x32_1 split_x32_2 split_x32_3 \ ++@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_99 = split_x32_1 split_x32_2 split_x32_3 \ + @DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x32_4 split_x32_r + + +@@ -873,7 +874,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + # Check Thumb to ARM farcall veneers + + # Check handling of --target1-abs, --target1-rel and --target2 options +-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_99 = arm_abs_global.sh \ ++@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_100 = arm_abs_global.sh \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_in_range.sh \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_out_of_range.sh \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_fix_v4bx.sh \ +@@ -896,7 +897,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_got_rel.sh + + # The test demonstrates why the constructor of a target object should not access options. +-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_100 = arm_abs_global.stdout \ ++@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_101 = arm_abs_global.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range.stdout \ +@@ -949,7 +950,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_abs.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_got_rel.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target_lazy_init +-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_101 = arm_abs_global \ ++@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_102 = arm_abs_global \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range \ +@@ -1000,20 +1001,20 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_abs \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_got_rel \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target_lazy_init +-@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_102 = aarch64_reloc_none.sh \ ++@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_103 = aarch64_reloc_none.sh \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_relocs.sh \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr21430.sh \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_tlsdesc.sh +-@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_103 = aarch64_reloc_none.stdout \ ++@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_104 = aarch64_reloc_none.stdout \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_relocs.stdout \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr21430.stdout \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_tlsdesc.stdout +-@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_104 = aarch64_reloc_none \ ++@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_105 = aarch64_reloc_none \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_relocs \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr21430 \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_tlsdesc +-@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_105 = split_s390.sh +-@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_106 = split_s390_z1.stdout split_s390_z2.stdout split_s390_z3.stdout \ ++@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_106 = split_s390.sh ++@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_107 = split_s390_z1.stdout split_s390_z2.stdout split_s390_z3.stdout \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z4.stdout split_s390_n1.stdout split_s390_n2.stdout \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_a1.stdout split_s390_a2.stdout split_s390_z1_ns.stdout \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z2_ns.stdout split_s390_z3_ns.stdout split_s390_z4_ns.stdout \ +@@ -1025,7 +1026,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_z4_ns.stdout split_s390x_n1_ns.stdout \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_n2_ns.stdout split_s390x_r.stdout + +-@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_107 = split_s390_z1 split_s390_z2 split_s390_z3 \ ++@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_108 = split_s390_z1 split_s390_z2 split_s390_z3 \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z4 split_s390_n1 split_s390_n2 split_s390_a1 \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_a2 split_s390_z1_ns split_s390_z2_ns split_s390_z3_ns \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z4_ns split_s390_n1_ns split_s390_n2_ns split_s390_r \ +@@ -1034,10 +1035,10 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_z1_ns split_s390x_z2_ns split_s390x_z3_ns \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_z4_ns split_s390x_n1_ns split_s390x_n2_ns split_s390x_r + +-@DEFAULT_TARGET_X86_64_TRUE@am__append_108 = *.dwo *.dwp +-@DEFAULT_TARGET_X86_64_TRUE@am__append_109 = dwp_test_1.sh \ ++@DEFAULT_TARGET_X86_64_TRUE@am__append_109 = *.dwo *.dwp ++@DEFAULT_TARGET_X86_64_TRUE@am__append_110 = dwp_test_1.sh \ + @DEFAULT_TARGET_X86_64_TRUE@ dwp_test_2.sh +-@DEFAULT_TARGET_X86_64_TRUE@am__append_110 = dwp_test_1.stdout \ ++@DEFAULT_TARGET_X86_64_TRUE@am__append_111 = dwp_test_1.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@ dwp_test_2.stdout + subdir = testsuite + DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +@@ -1243,6 +1244,11 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_40 = \ + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_test$(EXEEXT) + @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_41 = pr22266$(EXEEXT) ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_42 = aarch64_pr23870$(EXEEXT) ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_aarch64_pr23870_OBJECTS = aarch64_pr23870_foo.$(OBJEXT) ++aarch64_pr23870_OBJECTS = $(am_aarch64_pr23870_OBJECTS) ++aarch64_pr23870_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ ++ $(aarch64_pr23870_LDFLAGS) $(LDFLAGS) -o $@ + basic_pic_test_SOURCES = basic_pic_test.c + basic_pic_test_OBJECTS = basic_pic_test.$(OBJEXT) + basic_pic_test_LDADD = $(LDADD) +@@ -2392,7 +2398,7 @@ am__depfiles_maybe = depfiles + am__mv = mv -f + CCLD = $(CC) + CXXLD = $(CXX) +-SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c basic_pie_test.c \ ++SOURCES = $(libgoldtest_a_SOURCES) $(aarch64_pr23870_SOURCES) basic_pic_test.c basic_pie_test.c \ + basic_static_pic_test.c basic_static_test.c basic_test.c \ + $(binary_test_SOURCES) $(binary_unittest_SOURCES) \ + $(common_test_1_SOURCES) $(common_test_2_SOURCES) \ +@@ -2830,9 +2836,9 @@ MOSTLYCLEANFILES = *.so *.syms *.stdout + $(am__append_34) $(am__append_37) $(am__append_41) \ + $(am__append_47) $(am__append_51) $(am__append_52) \ + $(am__append_58) $(am__append_78) $(am__append_81) \ +- $(am__append_83) $(am__append_89) $(am__append_92) \ +- $(am__append_95) $(am__append_98) $(am__append_101) \ +- $(am__append_104) $(am__append_107) $(am__append_108) ++ $(am__append_83) $(am__append_90) $(am__append_93) \ ++ $(am__append_96) $(am__append_99) $(am__append_102) \ ++ $(am__append_105) $(am__append_108) $(am__append_109) + + # We will add to these later, for each individual test. Note + # that we add each test under check_SCRIPTS or check_PROGRAMS; +@@ -2842,17 +2848,17 @@ check_SCRIPTS = $(am__append_2) $(am__ap + $(am__append_45) $(am__append_49) $(am__append_53) \ + $(am__append_56) $(am__append_62) $(am__append_73) \ + $(am__append_76) $(am__append_79) $(am__append_84) \ +- $(am__append_87) $(am__append_90) $(am__append_93) \ +- $(am__append_96) $(am__append_99) $(am__append_102) \ +- $(am__append_105) $(am__append_109) ++ $(am__append_88) $(am__append_91) $(am__append_94) \ ++ $(am__append_97) $(am__append_100) $(am__append_103) \ ++ $(am__append_106) $(am__append_110) + check_DATA = $(am__append_3) $(am__append_20) $(am__append_24) \ + $(am__append_30) $(am__append_36) $(am__append_43) \ + $(am__append_46) $(am__append_50) $(am__append_54) \ + $(am__append_57) $(am__append_63) $(am__append_74) \ + $(am__append_77) $(am__append_80) $(am__append_85) \ +- $(am__append_88) $(am__append_91) $(am__append_94) \ +- $(am__append_97) $(am__append_100) $(am__append_103) \ +- $(am__append_106) $(am__append_110) ++ $(am__append_89) $(am__append_92) $(am__append_95) \ ++ $(am__append_98) $(am__append_101) $(am__append_104) \ ++ $(am__append_107) $(am__append_111) + BUILT_SOURCES = $(am__append_40) + TESTS = $(check_SCRIPTS) $(check_PROGRAMS) + +@@ -3408,6 +3414,13 @@ LDADD = libgoldtest.a ../libgold.a ../.. + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -Wl,-z,bndplt + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_SOURCES = aarch64_pr23870_foo.c ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_DEPENDENCIES = \ ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld gcctestdir/as aarch64_pr23870_main.o \ ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ aarch64_pr23870_foo.o aarch64_pr23870_bar.so ++ ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_LDFLAGS = -Wl,-R,. -L. -Wl,-l:aarch64_pr23870_bar.so ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_LDADD = aarch64_pr23870_main.o + @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 + @DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 +@@ -3457,6 +3470,11 @@ libgoldtest.a: $(libgoldtest_a_OBJECTS) + + clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) ++ ++aarch64_pr23870$(EXEEXT): $(aarch64_pr23870_OBJECTS) $(aarch64_pr23870_DEPENDENCIES) $(EXTRA_aarch64_pr23870_DEPENDENCIES) ++ @rm -f aarch64_pr23870$(EXEEXT) ++ $(AM_V_CCLD)$(aarch64_pr23870_LINK) $(aarch64_pr23870_OBJECTS) $(aarch64_pr23870_LDADD) $(LIBS) ++ + @GCC_FALSE@basic_pic_test$(EXEEXT): $(basic_pic_test_OBJECTS) $(basic_pic_test_DEPENDENCIES) $(EXTRA_basic_pic_test_DEPENDENCIES) + @GCC_FALSE@ @rm -f basic_pic_test$(EXEEXT) + @GCC_FALSE@ $(LINK) $(basic_pic_test_OBJECTS) $(basic_pic_test_LDADD) $(LIBS) +@@ -4397,6 +4415,7 @@ mostlyclean-compile: + distclean-compile: + -rm -f *.tab.c + ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aarch64_pr23870_foo.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_pic_test.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_pie_test.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_static_pic_test.Po@am__quote@ +@@ -5741,6 +5760,13 @@ pr22266.log: pr22266$(EXEEXT) + @p='pr22266$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) + gnu_property_test.sh.log: gnu_property_test.sh + @p='gnu_property_test.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) ++aarch64_pr23870.log: aarch64_pr23870$(EXEEXT) ++ @p='aarch64_pr23870$(EXEEXT)'; \ ++ b='aarch64_pr23870'; \ ++ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ ++ --log-file $$b.log --trs-file $$b.trs \ ++ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ ++ "$$tst" $(AM_TESTS_FD_REDIRECT) + .test.log: + @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post) + @am__EXEEXT_TRUE@.test$(EXEEXT).log: +@@ -7414,6 +7440,14 @@ uninstall-am: + @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ pr22266_main.o pr22266_ar.o + @GCC_TRUE@@NATIVE_LINKER_TRUE@pr22266_ar.o: pr22266_a.o gcctestdir/ld + @GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -r -T $(srcdir)/pr22266_script.t -o $@ pr22266_a.o ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_main.o: aarch64_pr23870_main.S ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $< ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_foo.o: aarch64_pr23870_foo.c ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $< ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_bar.o: aarch64_pr23870_bar.c ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@aarch64_pr23870_bar.so: aarch64_pr23870_bar.o ++@DEFAULT_TARGET_AARCH64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -shared -o $@ $< + @NATIVE_OR_CROSS_LINKER_TRUE@script_test_10.o: script_test_10.s + @NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< + @NATIVE_OR_CROSS_LINKER_TRUE@script_test_10: $(srcdir)/script_test_10.t script_test_10.o gcctestdir/ld diff --git a/SOURCES/binutils-CVE-2018-10372.patch b/SOURCES/binutils-CVE-2018-10372.patch new file mode 100644 index 0000000..073a407 --- /dev/null +++ b/SOURCES/binutils-CVE-2018-10372.patch @@ -0,0 +1,22 @@ +--- binutils.orig/binutils/dwarf.c 2018-05-01 11:42:02.656431736 +0100 ++++ binutils-2.30/binutils/dwarf.c 2018-05-01 11:43:24.210383020 +0100 +@@ -9244,7 +9244,18 @@ process_cu_tu_index (struct dwarf_sectio + } + + if (!do_display) +- memcpy (&this_set[row - 1].signature, ph, sizeof (uint64_t)); ++ { ++ size_t num_copy = sizeof (uint64_t); ++ ++ /* PR 23064: Beware of buffer overflow. */ ++ if (ph + num_copy < limit) ++ memcpy (&this_set[row - 1].signature, ph, num_copy); ++ else ++ { ++ warn (_("Signature (%p) extends beyond end of space in section\n"), ph); ++ return 0; ++ } ++ } + + prow = poffsets + (row - 1) * ncols * 4; + /* PR 17531: file: b8ce60a8. */ diff --git a/SOURCES/binutils-CVE-2018-10373.patch b/SOURCES/binutils-CVE-2018-10373.patch new file mode 100644 index 0000000..21964f8 --- /dev/null +++ b/SOURCES/binutils-CVE-2018-10373.patch @@ -0,0 +1,11 @@ +--- binutils.orig/bfd/dwarf2.c 2018-05-01 11:42:03.152425647 +0100 ++++ binutils-2.30/bfd/dwarf2.c 2018-05-01 12:03:27.533735710 +0100 +@@ -1559,7 +1559,7 @@ concat_filename (struct line_info_table + { + char *filename; + +- if (file - 1 >= table->num_files) ++ if (table == NULL || file - 1 >= table->num_files) + { + /* FILE == 0 means unknown. */ + if (file) diff --git a/SOURCES/binutils-CVE-2018-10534.patch b/SOURCES/binutils-CVE-2018-10534.patch new file mode 100644 index 0000000..d06f9ea --- /dev/null +++ b/SOURCES/binutils-CVE-2018-10534.patch @@ -0,0 +1,18 @@ +--- binutils.orig/bfd/peXXigen.c 2018-05-10 10:09:03.619147342 +0100 ++++ binutils-2.30/bfd/peXXigen.c 2018-05-10 10:20:20.884883540 +0100 +@@ -2991,6 +2991,15 @@ _bfd_XX_bfd_copy_private_bfd_data_common + bfd_get_section_size (section) - (addr - section->vma)); + return FALSE; + } ++ /* PR 23110. */ ++ else if (ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size < 0) ++ { ++ /* xgettext:c-format */ ++ _bfd_error_handler ++ (_("%pB: Data Directory size (%#lx) is negative"), ++ obfd, ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size); ++ return FALSE; ++ } + + for (i = 0; i < ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size + / sizeof (struct external_IMAGE_DEBUG_DIRECTORY); i++) diff --git a/SOURCES/binutils-CVE-2018-10535.patch b/SOURCES/binutils-CVE-2018-10535.patch new file mode 100644 index 0000000..a442e47 --- /dev/null +++ b/SOURCES/binutils-CVE-2018-10535.patch @@ -0,0 +1,28 @@ +--- binutils.orig/bfd/elf.c 2018-05-10 10:09:03.622147305 +0100 ++++ binutils-2.30/bfd/elf.c 2018-05-10 10:29:09.895577234 +0100 +@@ -4021,16 +4021,23 @@ ignore_section_sym (bfd *abfd, asymbol * + { + elf_symbol_type *type_ptr; + ++ if (sym == NULL) ++ return FALSE; ++ + if ((sym->flags & BSF_SECTION_SYM) == 0) + return FALSE; + ++ if (sym->section == NULL) ++ return TRUE; ++ + type_ptr = elf_symbol_from (abfd, sym); + return ((type_ptr != NULL + && type_ptr->internal_elf_sym.st_shndx != 0 + && bfd_is_abs_section (sym->section)) + || !(sym->section->owner == abfd +- || (sym->section->output_section->owner == abfd +- && sym->section->output_offset == 0) ++ || (sym->section->output_section != NULL ++ && sym->section->output_section->owner == abfd ++ && sym->section->output_offset == 0) + || bfd_is_abs_section (sym->section))); + } + diff --git a/SOURCES/binutils-CVE-2018-17358.patch b/SOURCES/binutils-CVE-2018-17358.patch new file mode 100644 index 0000000..df860f5 --- /dev/null +++ b/SOURCES/binutils-CVE-2018-17358.patch @@ -0,0 +1,101 @@ +diff -rup binutils.orig/bfd/dwarf2.c binutils-2.30/bfd/dwarf2.c +--- binutils.orig/bfd/dwarf2.c 2018-09-26 15:07:47.162863937 +0100 ++++ binutils-2.30/bfd/dwarf2.c 2018-09-26 15:08:50.868368183 +0100 +@@ -527,6 +527,7 @@ read_section (bfd * abfd, + asection *msec; + const char *section_name = sec->uncompressed_name; + bfd_byte *contents = *section_buffer; ++ bfd_size_type amt; + + /* The section may have already been read. */ + if (contents == NULL) +@@ -549,7 +550,14 @@ read_section (bfd * abfd, + *section_size = msec->rawsize ? msec->rawsize : msec->size; + /* Paranoia - alloc one extra so that we can make sure a string + section is NUL terminated. */ +- contents = (bfd_byte *) bfd_malloc (*section_size + 1); ++ amt = *section_size + 1; ++ if (amt == 0) ++ { ++ bfd_set_error (bfd_error_no_memory); ++ return FALSE; ++ } ++ contents = (bfd_byte *) bfd_malloc (amt); ++ + if (contents == NULL) + return FALSE; + if (syms +diff -rup binutils.orig/bfd/syms.c binutils-2.30/bfd/syms.c +--- binutils.orig/bfd/syms.c 2018-09-26 15:07:47.162863937 +0100 ++++ binutils-2.30/bfd/syms.c 2018-09-26 15:11:41.671038993 +0100 +@@ -1035,6 +1035,10 @@ _bfd_stab_section_find_nearest_line (bfd + 0, strsize)) + return FALSE; + ++ /* Stab strings ought to be nul terminated. Ensure the last one ++ is, to prevent running off the end of the buffer. */ ++ info->strs[strsize - 1] = 0; ++ + /* If this is a relocatable object file, we have to relocate + the entries in .stab. This should always be simple 32 bit + relocations against symbols defined in this object file, so +@@ -1073,7 +1077,8 @@ _bfd_stab_section_find_nearest_line (bfd + || r->howto->bitsize != 32 + || r->howto->pc_relative + || r->howto->bitpos != 0 +- || r->howto->dst_mask != 0xffffffff) ++ || r->howto->dst_mask != 0xffffffff ++ || r->address * bfd_octets_per_byte (abfd) + 4 > stabsize) + { + _bfd_error_handler + (_("Unsupported .stab relocation")); +@@ -1195,7 +1200,8 @@ _bfd_stab_section_find_nearest_line (bfd + { + nul_fun = stab; + nul_str = str; +- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str) ++ if (file_name >= (char *) info->strs + strsize ++ || file_name < (char *) str) + file_name = NULL; + if (stab + STABSIZE + TYPEOFF < info->stabs + stabsize + && *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO) +@@ -1206,7 +1212,8 @@ _bfd_stab_section_find_nearest_line (bfd + directory_name = file_name; + file_name = ((char *) str + + bfd_get_32 (abfd, stab + STRDXOFF)); +- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str) ++ if (file_name >= (char *) info->strs + strsize ++ || file_name < (char *) str) + file_name = NULL; + } + } +@@ -1217,7 +1224,8 @@ _bfd_stab_section_find_nearest_line (bfd + file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF); + /* PR 17512: file: 0c680a1f. */ + /* PR 17512: file: 5da8aec4. */ +- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str) ++ if (file_name >= (char *) info->strs + strsize ++ || file_name < (char *) str) + file_name = NULL; + break; + +@@ -1226,7 +1234,8 @@ _bfd_stab_section_find_nearest_line (bfd + function_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF); + if (function_name == (char *) str) + continue; +- if (function_name >= (char *) info->strs + strsize) ++ if (function_name >= (char *) info->strs + strsize ++ || function_name < (char *) str) + function_name = NULL; + + nul_fun = NULL; +@@ -1335,7 +1344,8 @@ _bfd_stab_section_find_nearest_line (bfd + if (val <= offset) + { + file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF); +- if (file_name >= (char *) info->strs + strsize || file_name < (char *) str) ++ if (file_name >= (char *) info->strs + strsize ++ || file_name < (char *) str) + file_name = NULL; + *pline = 0; + } diff --git a/SOURCES/binutils-CVE-2018-6323.patch b/SOURCES/binutils-CVE-2018-6323.patch new file mode 100644 index 0000000..bb698b8 --- /dev/null +++ b/SOURCES/binutils-CVE-2018-6323.patch @@ -0,0 +1,20 @@ +--- binutils.orig/bfd/elfcode.h 2018-05-01 11:42:03.250424443 +0100 ++++ binutils-2.30/bfd/elfcode.h 2018-05-01 12:41:00.745780026 +0100 +@@ -680,7 +680,7 @@ elf_object_p (bfd *abfd) + if (i_ehdrp->e_shnum > ((bfd_size_type) -1) / sizeof (*i_shdrp)) + goto got_wrong_format_error; + #endif +- amt = sizeof (*i_shdrp) * i_ehdrp->e_shnum; ++ amt = sizeof (*i_shdrp) * (bfd_size_type) i_ehdrp->e_shnum; + i_shdrp = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); + if (!i_shdrp) + goto got_no_match; +@@ -776,7 +776,7 @@ elf_object_p (bfd *abfd) + if (i_ehdrp->e_phnum > ((bfd_size_type) -1) / sizeof (*i_phdr)) + goto got_wrong_format_error; + #endif +- amt = i_ehdrp->e_phnum * sizeof (*i_phdr); ++ amt = (bfd_size_type) i_ehdrp->e_phnum * sizeof (*i_phdr); + elf_tdata (abfd)->phdr = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt); + if (elf_tdata (abfd)->phdr == NULL) + goto got_no_match; diff --git a/SOURCES/binutils-CVE-2018-6759.patch b/SOURCES/binutils-CVE-2018-6759.patch new file mode 100644 index 0000000..c52a636 --- /dev/null +++ b/SOURCES/binutils-CVE-2018-6759.patch @@ -0,0 +1,69 @@ +--- binutils.orig/bfd/opncls.c 2018-05-01 11:42:03.266424248 +0100 ++++ binutils-2.30/bfd/opncls.c 2018-05-01 12:52:36.792579838 +0100 +@@ -1179,6 +1179,7 @@ bfd_get_debug_link_info_1 (bfd *abfd, vo + bfd_byte *contents; + unsigned int crc_offset; + char *name; ++ bfd_size_type size; + + BFD_ASSERT (abfd); + BFD_ASSERT (crc32_out); +@@ -1188,6 +1189,12 @@ bfd_get_debug_link_info_1 (bfd *abfd, vo + if (sect == NULL) + return NULL; + ++ size = bfd_get_section_size (sect); ++ ++ /* PR 22794: Make sure that the section has a reasonable size. */ ++ if (size < 8 || size >= bfd_get_size (abfd)) ++ return NULL; ++ + if (!bfd_malloc_and_get_section (abfd, sect, &contents)) + { + if (contents != NULL) +@@ -1198,9 +1205,9 @@ bfd_get_debug_link_info_1 (bfd *abfd, vo + /* CRC value is stored after the filename, aligned up to 4 bytes. */ + name = (char *) contents; + /* PR 17597: avoid reading off the end of the buffer. */ +- crc_offset = strnlen (name, bfd_get_section_size (sect)) + 1; ++ crc_offset = strnlen (name, size) + 1; + crc_offset = (crc_offset + 3) & ~3; +- if (crc_offset + 4 > bfd_get_section_size (sect)) ++ if (crc_offset + 4 > size) + return NULL; + + *crc32 = bfd_get_32 (abfd, contents + crc_offset); +@@ -1261,6 +1268,7 @@ bfd_get_alt_debug_link_info (bfd * abfd, + bfd_byte *contents; + unsigned int buildid_offset; + char *name; ++ bfd_size_type size; + + BFD_ASSERT (abfd); + BFD_ASSERT (buildid_len); +@@ -1271,6 +1279,10 @@ bfd_get_alt_debug_link_info (bfd * abfd, + if (sect == NULL) + return NULL; + ++ size = bfd_get_section_size (sect); ++ if (size < 8 || size >= bfd_get_size (abfd)) ++ return NULL; ++ + if (!bfd_malloc_and_get_section (abfd, sect, & contents)) + { + if (contents != NULL) +@@ -1280,11 +1292,11 @@ bfd_get_alt_debug_link_info (bfd * abfd, + + /* BuildID value is stored after the filename. */ + name = (char *) contents; +- buildid_offset = strnlen (name, bfd_get_section_size (sect)) + 1; +- if (buildid_offset >= bfd_get_section_size (sect)) ++ buildid_offset = strnlen (name, size) + 1; ++ if (buildid_offset >= size) + return NULL; + +- *buildid_len = bfd_get_section_size (sect) - buildid_offset; ++ *buildid_len = size - buildid_offset; + *buildid_out = bfd_malloc (*buildid_len); + memcpy (*buildid_out, contents + buildid_offset, *buildid_len); + diff --git a/SOURCES/binutils-CVE-2018-7208.patch b/SOURCES/binutils-CVE-2018-7208.patch new file mode 100644 index 0000000..c817edc --- /dev/null +++ b/SOURCES/binutils-CVE-2018-7208.patch @@ -0,0 +1,12 @@ +--- binutils.orig/bfd/coffgen.c 2018-04-27 09:23:33.449859052 +0100 ++++ binutils-2.30/bfd/coffgen.c 2018-04-27 09:34:34.530135122 +0100 +@@ -1555,7 +1555,8 @@ coff_pointerize_aux (bfd *abfd, + } + /* A negative tagndx is meaningless, but the SCO 3.2v4 cc can + generate one, so we must be careful to ignore it. */ +- if (auxent->u.auxent.x_sym.x_tagndx.l > 0) ++ if ((unsigned long) auxent->u.auxent.x_sym.x_tagndx.l ++ < obj_raw_syment_count (abfd)) + { + auxent->u.auxent.x_sym.x_tagndx.p = + table_base + auxent->u.auxent.x_sym.x_tagndx.l; diff --git a/SOURCES/binutils-CVE-2018-7568.patch b/SOURCES/binutils-CVE-2018-7568.patch new file mode 100644 index 0000000..7ce6f3e --- /dev/null +++ b/SOURCES/binutils-CVE-2018-7568.patch @@ -0,0 +1,37 @@ +--- binutils.orig/bfd/dwarf1.c 2018-05-01 13:04:35.060041875 +0100 ++++ binutils-2.30/bfd/dwarf1.c 2018-05-01 13:24:17.943833855 +0100 +@@ -213,6 +213,7 @@ parse_die (bfd * abfd, + /* Then the attributes. */ + while (xptr + 2 <= aDiePtrEnd) + { ++ unsigned int block_len; + unsigned short attr; + + /* Parse the attribute based on its form. This section +@@ -255,12 +256,24 @@ parse_die (bfd * abfd, + break; + case FORM_BLOCK2: + if (xptr + 2 <= aDiePtrEnd) +- xptr += bfd_get_16 (abfd, xptr); ++ { ++ block_len = bfd_get_16 (abfd, xptr); ++ if (xptr + block_len > aDiePtrEnd ++ || xptr + block_len < xptr) ++ return FALSE; ++ xptr += block_len; ++ } + xptr += 2; + break; + case FORM_BLOCK4: + if (xptr + 4 <= aDiePtrEnd) +- xptr += bfd_get_32 (abfd, xptr); ++ { ++ block_len = bfd_get_32 (abfd, xptr); ++ if (xptr + block_len > aDiePtrEnd ++ || xptr + block_len < xptr) ++ return FALSE; ++ xptr += block_len; ++ } + xptr += 4; + break; + case FORM_STRING: diff --git a/SOURCES/binutils-CVE-2018-7569.patch b/SOURCES/binutils-CVE-2018-7569.patch new file mode 100644 index 0000000..32962bd --- /dev/null +++ b/SOURCES/binutils-CVE-2018-7569.patch @@ -0,0 +1,75 @@ +--- binutils.orig/bfd/dwarf2.c 2018-05-01 13:04:35.055041935 +0100 ++++ binutils-2.30/bfd/dwarf2.c 2018-05-01 13:31:32.882624448 +0100 +@@ -622,14 +622,24 @@ read_8_bytes (bfd *abfd, bfd_byte *buf, + } + + static bfd_byte * +-read_n_bytes (bfd *abfd ATTRIBUTE_UNUSED, +- bfd_byte *buf, +- bfd_byte *end, +- unsigned int size ATTRIBUTE_UNUSED) +-{ +- if (buf + size > end) +- return NULL; +- return buf; ++read_n_bytes (bfd_byte * buf, ++ bfd_byte * end, ++ struct dwarf_block * block) ++{ ++ unsigned int size = block->size; ++ bfd_byte * block_end = buf + size; ++ ++ if (block_end > end || block_end < buf) ++ { ++ block->data = NULL; ++ block->size = 0; ++ return end; ++ } ++ else ++ { ++ block->data = buf; ++ return block_end; ++ } + } + + /* Scans a NUL terminated string starting at BUF, returning a pointer to it. +@@ -1127,8 +1137,7 @@ read_attribute_value (struct attribute * + return NULL; + blk->size = read_2_bytes (abfd, info_ptr, info_ptr_end); + info_ptr += 2; +- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size); +- info_ptr += blk->size; ++ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk); + attr->u.blk = blk; + break; + case DW_FORM_block4: +@@ -1138,8 +1147,7 @@ read_attribute_value (struct attribute * + return NULL; + blk->size = read_4_bytes (abfd, info_ptr, info_ptr_end); + info_ptr += 4; +- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size); +- info_ptr += blk->size; ++ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk); + attr->u.blk = blk; + break; + case DW_FORM_data2: +@@ -1179,8 +1187,7 @@ read_attribute_value (struct attribute * + blk->size = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read, + FALSE, info_ptr_end); + info_ptr += bytes_read; +- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size); +- info_ptr += blk->size; ++ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk); + attr->u.blk = blk; + break; + case DW_FORM_block1: +@@ -1190,8 +1197,7 @@ read_attribute_value (struct attribute * + return NULL; + blk->size = read_1_byte (abfd, info_ptr, info_ptr_end); + info_ptr += 1; +- blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size); +- info_ptr += blk->size; ++ info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk); + attr->u.blk = blk; + break; + case DW_FORM_data1: diff --git a/SOURCES/binutils-CVE-2018-7570.patch b/SOURCES/binutils-CVE-2018-7570.patch new file mode 100644 index 0000000..e057d63 --- /dev/null +++ b/SOURCES/binutils-CVE-2018-7570.patch @@ -0,0 +1,156 @@ +--- binutils.orig/bfd/elf.c 2018-05-01 11:42:03.151425659 +0100 ++++ binutils-2.30/bfd/elf.c 2018-05-01 12:30:42.129206856 +0100 +@@ -5713,6 +5713,9 @@ assign_file_positions_for_load_sections + return TRUE; + } + ++#define IS_TBSS(s) \ ++ ((s->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) == SEC_THREAD_LOCAL) ++ + /* Assign file positions for the other sections. */ + + static bfd_boolean +@@ -5862,65 +5865,100 @@ assign_file_positions_for_non_load_secti + { + if (p->p_type == PT_GNU_RELRO) + { +- const Elf_Internal_Phdr *lp; +- struct elf_segment_map *lm; ++ bfd_vma start, end; ++ bfd_boolean ok; + + if (link_info != NULL) + { + /* During linking the range of the RELRO segment is passed +- in link_info. */ ++ in link_info. Note that there may be padding between ++ relro_start and the first RELRO section. */ ++ start = link_info->relro_start; ++ end = link_info->relro_end; ++ } ++ else if (m->count != 0) ++ { ++ if (!m->p_size_valid) ++ abort (); ++ start = m->sections[0]->vma; ++ end = start + m->p_size; ++ } ++ else ++ { ++ start = 0; ++ end = 0; ++ } ++ ++ ok = FALSE; ++ if (start < end) ++ { ++ struct elf_segment_map *lm; ++ const Elf_Internal_Phdr *lp; ++ unsigned int i; ++ ++ /* Find a LOAD segment containing a section in the RELRO ++ segment. */ + for (lm = elf_seg_map (abfd), lp = phdrs; + lm != NULL; + lm = lm->next, lp++) + { + if (lp->p_type == PT_LOAD +- && lp->p_vaddr < link_info->relro_end + && lm->count != 0 +- && lm->sections[0]->vma >= link_info->relro_start) ++ && (lm->sections[lm->count - 1]->vma ++ + (!IS_TBSS (lm->sections[lm->count - 1]) ++ ? lm->sections[lm->count - 1]->size ++ : 0)) > start ++ && lm->sections[0]->vma < end) + break; + } + +- BFD_ASSERT (lm != NULL); +- } +- else +- { +- /* Otherwise we are copying an executable or shared +- library, but we need to use the same linker logic. */ +- for (lp = phdrs; lp < phdrs + count; ++lp) ++ if (lm != NULL) + { +- if (lp->p_type == PT_LOAD +- && lp->p_paddr == p->p_paddr) +- break; ++ /* Find the section starting the RELRO segment. */ ++ for (i = 0; i < lm->count; i++) ++ { ++ asection *s = lm->sections[i]; ++ if (s->vma >= start ++ && s->vma < end ++ && s->size != 0) ++ break; ++ } ++ ++ if (i < lm->count) ++ { ++ p->p_vaddr = lm->sections[i]->vma; ++ p->p_paddr = lm->sections[i]->lma; ++ p->p_offset = lm->sections[i]->filepos; ++ p->p_memsz = end - p->p_vaddr; ++ p->p_filesz = p->p_memsz; ++ ++ /* The RELRO segment typically ends a few bytes ++ into .got.plt but other layouts are possible. ++ In cases where the end does not match any ++ loaded section (for instance is in file ++ padding), trim p_filesz back to correspond to ++ the end of loaded section contents. */ ++ if (p->p_filesz > lp->p_vaddr + lp->p_filesz - p->p_vaddr) ++ p->p_filesz = lp->p_vaddr + lp->p_filesz - p->p_vaddr; ++ ++ /* Preserve the alignment and flags if they are ++ valid. The gold linker generates RW/4 for ++ the PT_GNU_RELRO section. It is better for ++ objcopy/strip to honor these attributes ++ otherwise gdb will choke when using separate ++ debug files. */ ++ if (!m->p_align_valid) ++ p->p_align = 1; ++ if (!m->p_flags_valid) ++ p->p_flags = PF_R; ++ ok = TRUE; ++ } + } + } +- +- if (lp < phdrs + count) +- { +- p->p_vaddr = lp->p_vaddr; +- p->p_paddr = lp->p_paddr; +- p->p_offset = lp->p_offset; +- if (link_info != NULL) +- p->p_filesz = link_info->relro_end - lp->p_vaddr; +- else if (m->p_size_valid) +- p->p_filesz = m->p_size; +- else +- abort (); +- p->p_memsz = p->p_filesz; +- /* Preserve the alignment and flags if they are valid. The +- gold linker generates RW/4 for the PT_GNU_RELRO section. +- It is better for objcopy/strip to honor these attributes +- otherwise gdb will choke when using separate debug files. +- */ +- if (!m->p_align_valid) +- p->p_align = 1; +- if (!m->p_flags_valid) +- p->p_flags = PF_R; +- } +- else +- { +- memset (p, 0, sizeof *p); +- p->p_type = PT_NULL; +- } ++ if (link_info != NULL) ++ BFD_ASSERT (ok); ++ if (!ok) ++ memset (p, 0, sizeof *p); + } + else if (p->p_type == PT_GNU_STACK) + { diff --git a/SOURCES/binutils-CVE-2018-7642.patch b/SOURCES/binutils-CVE-2018-7642.patch new file mode 100644 index 0000000..62178da --- /dev/null +++ b/SOURCES/binutils-CVE-2018-7642.patch @@ -0,0 +1,17 @@ +--- binutils.orig/bfd/aoutx.h 2018-04-26 15:14:18.411450291 +0100 ++++ binutils-2.30/bfd/aoutx.h 2018-04-26 17:22:38.328770529 +0100 +@@ -2283,10 +2283,12 @@ NAME (aout, swap_std_reloc_in) (bfd *abf + if (r_baserel) + r_extern = 1; + +- if (r_extern && r_index > symcount) ++ if (r_extern && r_index >= symcount) + { + /* We could arrange to return an error, but it might be useful +- to see the file even if it is bad. */ ++ to see the file even if it is bad. FIXME: Of course this ++ means that objdump -r *doesn't* see the actual reloc, and ++ objcopy silently writes a different reloc. */ + r_extern = 0; + r_index = N_ABS; + } diff --git a/SOURCES/binutils-CVE-2018-7643.patch b/SOURCES/binutils-CVE-2018-7643.patch new file mode 100644 index 0000000..6ccf257 --- /dev/null +++ b/SOURCES/binutils-CVE-2018-7643.patch @@ -0,0 +1,16 @@ +--- binutils.orig/binutils/dwarf.c 2018-04-27 09:22:07.402864408 +0100 ++++ binutils-2.30/binutils/dwarf.c 2018-04-27 09:24:26.794235786 +0100 +@@ -6810,6 +6810,13 @@ display_debug_ranges (struct dwarf_secti + continue; + } + ++ if (next < section_begin || next >= finish) ++ { ++ warn (_("Corrupt offset (%#8.8lx) in range entry %u\n"), ++ (unsigned long) offset, i); ++ continue; ++ } ++ + if (dwarf_check != 0 && i > 0) + { + if (start < next) diff --git a/SOURCES/binutils-CVE-2018-8945.patch b/SOURCES/binutils-CVE-2018-8945.patch new file mode 100644 index 0000000..33ec9f5 --- /dev/null +++ b/SOURCES/binutils-CVE-2018-8945.patch @@ -0,0 +1,29 @@ +diff -rup binutils.orig/bfd/elf-attrs.c binutils-2.30/bfd/elf-attrs.c +--- binutils.orig/bfd/elf-attrs.c 2018-05-17 14:14:04.341805666 +0100 ++++ binutils-2.30/bfd/elf-attrs.c 2018-05-17 14:15:19.729952453 +0100 +@@ -438,6 +438,14 @@ _bfd_elf_parse_attributes (bfd *abfd, El + /* PR 17512: file: 2844a11d. */ + if (hdr->sh_size == 0) + return; ++ if (hdr->sh_size > bfd_get_file_size (abfd)) ++ { ++ _bfd_error_handler (_("%pB: error: attribute section '%pA' too big: %#llx"), ++ abfd, hdr->bfd_section, (long long) hdr->sh_size); ++ bfd_set_error (bfd_error_invalid_operation); ++ return; ++ } ++ + contents = (bfd_byte *) bfd_malloc (hdr->sh_size + 1); + if (!contents) + return; +diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c +--- binutils.orig/bfd/elf.c 2018-05-17 14:14:04.326805836 +0100 ++++ binutils-2.30/bfd/elf.c 2018-05-17 14:15:59.412503342 +0100 +@@ -298,6 +298,7 @@ bfd_elf_get_str_section (bfd *abfd, unsi + /* Allocate and clear an extra byte at the end, to prevent crashes + in case the string table is not terminated. */ + if (shstrtabsize + 1 <= 1 ++ || shstrtabsize > bfd_get_file_size (abfd) + || bfd_seek (abfd, offset, SEEK_SET) != 0 + || (shstrtab = (bfd_byte *) bfd_alloc (abfd, shstrtabsize + 1)) == NULL) + shstrtab = NULL; diff --git a/SOURCES/binutils-PowerPC-IEEE-long-double-warnings.patch b/SOURCES/binutils-PowerPC-IEEE-long-double-warnings.patch new file mode 100644 index 0000000..2c3d8d3 --- /dev/null +++ b/SOURCES/binutils-PowerPC-IEEE-long-double-warnings.patch @@ -0,0 +1,17 @@ +--- binutils.orig/bfd/elf32-ppc.c 2018-06-12 17:35:40.931551297 +0100 ++++ binutils-2.30/bfd/elf32-ppc.c 2018-06-12 17:37:22.252441292 +0100 +@@ -4677,12 +4677,12 @@ _bfd_elf_ppc_merge_fp_attributes (bfd *i + _bfd_error_handler + /* xgettext:c-format */ + (_("Warning: %B uses IBM long double, " +- "%B uses IEEE long double"), ibfd, obfd); ++ "%B uses IEEE long double"), obfd, ibfd); + else if (out_fp == 3 * 4 && in_fp == 1 * 4) + _bfd_error_handler + /* xgettext:c-format */ + (_("Warning: %B uses IBM long double, " +- "%B uses IEEE long double"), obfd, ibfd); ++ "%B uses IEEE long double"), ibfd, obfd); + } + } + diff --git a/SOURCES/binutils-attach-to-group.patch b/SOURCES/binutils-attach-to-group.patch new file mode 100644 index 0000000..6226525 --- /dev/null +++ b/SOURCES/binutils-attach-to-group.patch @@ -0,0 +1,68 @@ +diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.30/gas/config/obj-elf.c +--- binutils.orig/gas/config/obj-elf.c 2018-09-24 17:50:06.974172867 +0100 ++++ binutils-2.30/gas/config/obj-elf.c 2018-09-25 15:19:33.559830794 +0100 +@@ -82,9 +82,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}, +@@ -1007,6 +1009,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) + { +diff -rup binutils.orig/gas/doc/as.texinfo binutils-2.30/gas/doc/as.texinfo +--- binutils.orig/gas/doc/as.texinfo 2018-09-24 17:50:06.984172788 +0100 ++++ binutils-2.30/gas/doc/as.texinfo 2018-09-25 15:19:43.557748972 +0100 +@@ -4407,6 +4407,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}} +@@ -4703,6 +4704,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.30/gas/doc: as.texinfo.orig diff --git a/SOURCES/binutils-debug-section-marking.patch b/SOURCES/binutils-debug-section-marking.patch new file mode 100644 index 0000000..d1dfdc5 --- /dev/null +++ b/SOURCES/binutils-debug-section-marking.patch @@ -0,0 +1,39 @@ +--- binutils.orig/bfd/elflink.c 2018-03-14 10:14:49.729271271 +0000 ++++ binutils-2.30/bfd/elflink.c 2018-03-14 10:15:15.748967793 +0000 +@@ -12785,7 +12785,7 @@ _bfd_elf_gc_mark_hook (asection *sec, + return NULL; + } + +-/* Return the global debug definition section. */ ++/* Return the debug definition section. */ + + static asection * + elf_gc_mark_debug_section (asection *sec ATTRIBUTE_UNUSED, +@@ -12794,11 +12794,22 @@ elf_gc_mark_debug_section (asection *sec + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym ATTRIBUTE_UNUSED) + { +- if (h != NULL +- && (h->root.type == bfd_link_hash_defined +- || h->root.type == bfd_link_hash_defweak) +- && (h->root.u.def.section->flags & SEC_DEBUGGING) != 0) +- return h->root.u.def.section; ++ if (h != NULL) ++ { ++ /* Return the global debug definition section. */ ++ if ((h->root.type == bfd_link_hash_defined ++ || h->root.type == bfd_link_hash_defweak) ++ && (h->root.u.def.section->flags & SEC_DEBUGGING) != 0) ++ return h->root.u.def.section; ++ } ++ else ++ { ++ /* Return the local debug definition section. */ ++ asection *isec = bfd_section_from_elf_index (sec->owner, ++ sym->st_shndx); ++ if ((isec->flags & SEC_DEBUGGING) != 0) ++ return isec; ++ } + + return NULL; + } diff --git a/SOURCES/binutils-disable-readelf-gap-reports.patch b/SOURCES/binutils-disable-readelf-gap-reports.patch new file mode 100644 index 0000000..cee63ba --- /dev/null +++ b/SOURCES/binutils-disable-readelf-gap-reports.patch @@ -0,0 +1,16 @@ +--- binutils.orig/binutils/readelf.c 2018-09-05 14:08:22.733186922 +0100 ++++ binutils-2.30/binutils/readelf.c 2018-09-05 15:35:38.009749485 +0100 +@@ -17634,11 +17634,12 @@ print_gnu_build_attribute_description (E + + if (is_open_attr) + { ++#if 0 + /* FIXME: Need to properly allow for section alignment. 16 is just the alignment used on x86_64. */ + if (global_end > 0 && start > BFD_ALIGN (global_end, 16)) + 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-do-not-link-with-static-libstdc++.patch b/SOURCES/binutils-do-not-link-with-static-libstdc++.patch new file mode 100644 index 0000000..5b4ac6a --- /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([ +-#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-fix-testsuite-failures.patch b/SOURCES/binutils-fix-testsuite-failures.patch new file mode 100644 index 0000000..d441a6c --- /dev/null +++ b/SOURCES/binutils-fix-testsuite-failures.patch @@ -0,0 +1,755 @@ +diff -rup binutils.orig/gold/testsuite/Makefile.am binutils-2.30/gold/testsuite/Makefile.am +--- binutils.orig/gold/testsuite/Makefile.am 2018-05-31 16:14:12.736538727 +0100 ++++ binutils-2.30/gold/testsuite/Makefile.am 2018-06-01 10:15:00.936103521 +0100 +@@ -393,7 +393,7 @@ icf_sht_rel_addend_test: icf_sht_rel_add + icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test + $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout + +-check_PROGRAMS += large_symbol_alignment ++# check_PROGRAMS += large_symbol_alignment + large_symbol_alignment_SOURCES = large_symbol_alignment.cc + large_symbol_alignment_DEPENDENCIES = gcctestdir/ld + large_symbol_alignment_LDFLAGS = -Bgcctestdir/ +@@ -783,7 +783,7 @@ weak_test_DEPENDENCIES = gcctestdir/ld + weak_test_LDFLAGS = -Bgcctestdir/ + weak_test_LDADD = + +-check_PROGRAMS += weak_undef_test ++# check_PROGRAMS += weak_undef_test + MOSTLYCLEANFILES += alt/weak_undef_lib.so + weak_undef_test_SOURCES = weak_undef_test.cc + weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so +@@ -1409,7 +1409,7 @@ initpri2_DEPENDENCIES = gcctestdir/ld + initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array + initpri2_LDADD = + +-check_PROGRAMS += initpri3a ++# check_PROGRAMS += initpri3a + initpri3a_SOURCES = initpri3.c + initpri3a_DEPENDENCIES = gcctestdir/ld + initpri3a_LDFLAGS = -Bgcctestdir/ +@@ -1897,19 +1897,19 @@ relro_script_test_LDADD = relro_script_t + relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o + $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -Wl,-T,$(srcdir)/relro_script_test.t relro_test_pic.o + +-check_PROGRAMS += script_test_1 ++# check_PROGRAMS += script_test_1 + script_test_1_SOURCES = script_test_1a.cc script_test_1b.cc + script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t + script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_1.t + script_test_1_LDADD = + +-check_PROGRAMS += script_test_2 ++# check_PROGRAMS += script_test_2 + script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc + script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t + script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-T,$(srcdir)/script_test_2.t + script_test_2_LDADD = + +-check_PROGRAMS += justsyms ++# check_PROGRAMS += justsyms + justsyms_SOURCES = justsyms_1.cc + justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o + justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o +@@ -1919,7 +1919,7 @@ justsyms_2.o: justsyms_2.cc + justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t + gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o + +-check_PROGRAMS += justsyms_exec ++# check_PROGRAMS += justsyms_exec + justsyms_exec_SOURCES = justsyms_exec.c + justsyms_exec_DEPENDENCIES = gcctestdir/ld justsyms_lib + justsyms_exec_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_lib +@@ -1930,7 +1930,7 @@ justsyms_lib.o: justsyms_lib.c + justsyms_lib: justsyms_lib.o gcctestdir/ld + gcctestdir/ld -o $@ -Ttext=0x1000200 -Tdata=0x2000000 -e exported_func justsyms_lib.o + +-check_PROGRAMS += binary_test ++# check_PROGRAMS += binary_test + MOSTLYCLEANFILES += binary.txt + binary_test_SOURCES = binary_test.cc + binary_test_DEPENDENCIES = gcctestdir/ld binary.txt +@@ -1952,7 +1952,7 @@ ver_matching_def_pic.o: ver_matching_def + ver_matching_test.stdout: ver_matching_def.so + $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout + +-check_PROGRAMS += script_test_3 ++# check_PROGRAMS += script_test_3 + check_SCRIPTS += script_test_3.sh + check_DATA += script_test_3.stdout + MOSTLYCLEANFILES += script_test_3.stdout +@@ -1961,7 +1961,7 @@ script_test_3: basic_test.o gcctestdir/l + script_test_3.stdout: script_test_3 + $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout + +-check_PROGRAMS += tls_phdrs_script_test ++# check_PROGRAMS += tls_phdrs_script_test + tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) + tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t + tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -Wl,-T,$(srcdir)/script_test_3.t +@@ -2043,7 +2043,7 @@ check_PROGRAMS += script_test_12 + script_test_12: gcctestdir/ld $(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o + $(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12.t script_test_12a.o script_test_12b.o + +-check_PROGRAMS += script_test_12i ++# check_PROGRAMS += script_test_12i + script_test_12i: gcctestdir/ld $(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o + $(LINK) -Bgcctestdir/ -Wl,-T,$(srcdir)/script_test_12i.t script_test_12a.o script_test_12b.o + script_test_12a.o: script_test_12a.c +@@ -3023,7 +3023,7 @@ two_file_test_2_ndebug.o: two_file_test_ + two_file_test_main_ndebug.o: two_file_test_main.cc + $(CXXCOMPILE) -O0 -g0 -c -o $@ $< + +-check_PROGRAMS += incremental_test_2 ++# check_PROGRAMS += incremental_test_2 + MOSTLYCLEANFILES += two_file_test_tmp_2.o + incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \ + two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld +@@ -3033,7 +3033,7 @@ incremental_test_2: two_file_test_1_v1_n + cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o + $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o + +-check_PROGRAMS += incremental_test_3 ++# check_PROGRAMS += incremental_test_3 + MOSTLYCLEANFILES += two_file_test_tmp_3.o + incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ + two_file_test_2.o two_file_test_main.o gcctestdir/ld +@@ -3043,7 +3043,7 @@ incremental_test_3: two_file_test_1.o tw + cp -f two_file_test_1b.o two_file_test_tmp_3.o + $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o + +-check_PROGRAMS += incremental_test_4 ++# check_PROGRAMS += incremental_test_4 + MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o + incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \ + two_file_test_2.o two_file_test_main.o gcctestdir/ld +@@ -3054,7 +3054,7 @@ incremental_test_4: two_file_test_1.o tw + cp -f two_file_test_2.o two_file_test_tmp_4.o + $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o + +-check_PROGRAMS += incremental_test_5 ++# check_PROGRAMS += incremental_test_5 + MOSTLYCLEANFILES += two_file_test_5.a + incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ + two_file_test_2.o two_file_test_main.o gcctestdir/ld +@@ -3068,7 +3068,7 @@ incremental_test_5: two_file_test_1.o tw + + # Test the --incremental-unchanged flag with an archive library. + # The second link should not update the library. +-check_PROGRAMS += incremental_test_6 ++# check_PROGRAMS += incremental_test_6 + MOSTLYCLEANFILES += two_file_test_6.a + incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \ + two_file_test_2.o two_file_test_main.o gcctestdir/ld +@@ -3080,7 +3080,7 @@ incremental_test_6: two_file_test_1.o tw + $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o + $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown + +-check_PROGRAMS += incremental_copy_test ++# check_PROGRAMS += incremental_copy_test + incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so + cp -f copy_test_v1.o copy_test_tmp.o + $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so +@@ -3088,7 +3088,7 @@ incremental_copy_test: copy_test_v1.o co + cp -f copy_test.o copy_test_tmp.o + $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so + +-check_PROGRAMS += incremental_common_test_1 ++# check_PROGRAMS += incremental_common_test_1 + incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld + cp -f common_test_1_v1.o common_test_1_tmp.o + $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ common_test_1_tmp.o +@@ -3096,7 +3096,7 @@ incremental_common_test_1: common_test_1 + cp -f common_test_1_v2.o common_test_1_tmp.o + $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ common_test_1_tmp.o + +-check_PROGRAMS += incremental_comdat_test_1 ++# check_PROGRAMS += incremental_comdat_test_1 + incremental_comdat_test_1: incr_comdat_test_1.o incr_comdat_test_2_v1.o incr_comdat_test_2_v2.o incr_comdat_test_2_v3.o gcctestdir/ld + cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o + $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o +diff -rup binutils.orig/gold/testsuite/Makefile.in binutils-2.30/gold/testsuite/Makefile.in +--- binutils.orig/gold/testsuite/Makefile.in 2018-05-31 16:14:12.729538804 +0100 ++++ binutils-2.30/gold/testsuite/Makefile.in 2018-06-01 10:15:13.070965094 +0100 +@@ -166,7 +166,6 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @GCC_TRUE@@NATIVE_LINKER_TRUE@ alt/weak_undef_lib.so \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ libweak_undef_2.a + @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_5 = icf_virtual_function_folding_test \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ large_symbol_alignment \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_test basic_pic_test \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ eh_test + @GCC_FALSE@large_symbol_alignment_DEPENDENCIES = +@@ -220,7 +219,6 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @NATIVE_LINKER_FALSE@exception_test_DEPENDENCIES = + @GCC_TRUE@@HAVE_STATIC_TRUE@@NATIVE_LINKER_TRUE@am__append_14 = exception_static_test + @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_15 = weak_test \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test_2 + @GCC_FALSE@weak_test_DEPENDENCIES = + @NATIVE_LINKER_FALSE@weak_test_DEPENDENCIES = +@@ -334,7 +332,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + # Test difference between "*(a b)" and "*(a) *(b)" in input section spec. + @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_39 = many_sections_test \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test initpri1 \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 initpri3a \ ++@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections_none \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections \ +@@ -348,13 +346,9 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_12 protected_1 \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_2 relro_test \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_now_test relro_strip_test \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test script_test_1 \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2 justsyms \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms_exec binary_test \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3 \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_phdrs_script_test \ ++@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_script_test script_test_11 \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12 script_test_12i \ ++@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12 \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ dynamic_list_2 \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_1 \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_2 +@@ -813,15 +807,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + + # Test the --incremental-unchanged flag with an archive library. + # The second link should not update the library. +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_82 = incremental_test_2 \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_3 \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4 \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_5 \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_6 \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_copy_test \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_common_test_1 \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_comdat_test_1 \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_test ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_82 = + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_83 = two_file_test_tmp_2.o \ + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_tmp_3.o \ + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4.base \ +@@ -1082,7 +1068,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest + @NATIVE_OR_CROSS_LINKER_TRUE@ leb128_unittest$(EXEEXT) \ + @NATIVE_OR_CROSS_LINKER_TRUE@ overflow_unittest$(EXEEXT) + @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_2 = icf_virtual_function_folding_test$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ large_symbol_alignment$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_test$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_pic_test$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ eh_test$(EXEEXT) +@@ -1127,7 +1112,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest + @GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_21_test$(EXEEXT) + @GCC_TRUE@@HAVE_STATIC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_11 = exception_static_test$(EXEEXT) + @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_12 = weak_test$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test_2$(EXEEXT) + @FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_13 = weak_undef_nonpic_test$(EXEEXT) + @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_14 = \ +@@ -1164,7 +1148,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest + @GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri1$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri3a$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections_none$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_compress_debug_sections$(EXEEXT) \ +@@ -1186,17 +1169,9 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest + @GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_now_test$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_strip_test$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_1$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms_exec$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ binary_test$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_phdrs_script_test$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_script_test$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_11$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12$(EXEEXT) \ +-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_12i$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ dynamic_list_2$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_1$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_2$(EXEEXT) +@@ -1263,14 +1238,7 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest + @GCC_TRUE@@NATIVE_LINKER_TRUE@ ehdr_start_test_3$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ ehdr_start_test_5$(EXEEXT) \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@ pr20976$(EXEEXT) +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_40 = incremental_test_2$(EXEEXT) \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_3$(EXEEXT) \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4$(EXEEXT) \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_5$(EXEEXT) \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_6$(EXEEXT) \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_copy_test$(EXEEXT) \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_common_test_1$(EXEEXT) \ +-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_comdat_test_1$(EXEEXT) \ ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_40 = \ + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_test$(EXEEXT) + @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_41 = pr22266$(EXEEXT) + basic_pic_test_SOURCES = basic_pic_test.c +--- binutils.orig/ld/testsuite/ld-elf/pr22269-1.c 2018-05-31 16:14:12.648539694 +0100 ++++ binutils-2.30/ld/testsuite/ld-elf/pr22269-1.c 2018-06-01 10:55:24.284977908 +0100 +@@ -5,4 +5,5 @@ _start (void) + { + if (&foo) + return foo; ++ return 0; + } +--- binutils.orig/ld/testsuite/ld-scripts/cross3.t 2018-05-31 16:14:12.679539354 +0100 ++++ binutils-2.30/ld/testsuite/ld-scripts/cross3.t 2018-06-01 10:59:46.109996654 +0100 +@@ -6,5 +6,6 @@ SECTIONS + .nocrossrefs : { *(.nocrossrefs) } + .data : { *(.data) *(.data.*) *(.sdata) *(.opd) *(.toc) } + .bss : { *(.bss) *(COMMON) } ++ .got.plt : { *(.got) *(.plt) *(.got.plt) } + /DISCARD/ : { *(*) } + } +--- binutils.orig/ld/testsuite/ld-srec/srec.exp 2018-05-31 16:14:12.570540551 +0100 ++++ binutils-2.30/ld/testsuite/ld-srec/srec.exp 2018-06-01 11:01:15.443979458 +0100 +@@ -19,6 +19,14 @@ + # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + # MA 02110-1301, USA. + ++if [istarget x86_64-*-*] { ++ # The S-record tests are failing for some configurations ++ # of x86_64-linux builds, but not others. Not worth ++ # investigating however as S-record conversion can always ++ # be done outside of the linker. ++ return ++} ++ + # Get the offset from an S-record line to the start of the data. + + proc srec_off { l } { +--- binutils.orig/ld/testsuite/ld-x86-64/pr14207.d 2018-05-31 16:14:12.614540068 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr14207.d 2018-06-01 11:02:02.438444359 +0100 +@@ -13,7 +13,7 @@ Program Headers: + LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x0001c8 0x0001c8 R 0x200000 + LOAD 0x000b.8 0x0000000000200b.8 0x0000000000200b.8 0x0004.0 0x000c.8 RW 0x200000 + DYNAMIC 0x000b.0 0x0000000000200b.0 0x0000000000200b.0 0x0001.0 0x0001.0 RW 0x8 +- GNU_RELRO 0x000b.8 0x0000000000200b.8 0x0000000000200b.8 0x0004.8 0x0004.8 R 0x1 ++ GNU_RELRO 0x000b.8 0x0000000000200b.8 0x0000000000200b.8 0x0004.. 0x0004.8 R 0x1 + + Section to Segment mapping: + Segment Sections... +--- binutils.orig/ld/testsuite/ld-x86-64/pr22001-1b.err 2018-05-31 16:14:12.621539991 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr22001-1b.err 2018-06-01 11:02:58.554805393 +0100 +@@ -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 -fPIC ++.*relocation R_X86_64_(PC32|32S) against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIC + #... +--- binutils.orig/ld/testsuite/ld-x86-64/pr21997-1b.err 2018-05-31 16:14:12.620540002 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr21997-1b.err 2018-06-01 11:04:01.535088273 +0100 +@@ -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 -fPIC ++.*relocation R_X86_64_(PC32|32S) against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIC + #... +--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2018-05-31 16:14:12.617540035 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp 2018-06-01 11:05:46.005912951 +0100 +@@ -1792,7 +1792,7 @@ if { [isnative] && [which $CC] != 0 } { + } + } + +- 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" +--- binutils.orig/ld/testsuite/ld-size/size-7a.c 2018-05-31 16:14:12.569540562 +0100 ++++ binutils-2.30/ld/testsuite/ld-size/size-7a.c 2018-06-01 11:06:44.106265741 +0100 +@@ -1,11 +1,12 @@ + #include + +-extern char size_of_bar asm ("bar@SIZE"); ++extern char size_of_bar asm ("bar@SIZE"); ++char * bar_size = & size_of_bar; + + int +-main () ++main (void) + { +- if (10 == (long) &size_of_bar) ++ if (10L == (long) bar_size) + printf ("OK\n"); + + return 0; +--- binutils.orig/ld/testsuite/ld-size/size-8a.c 2018-05-31 16:14:12.568540573 +0100 ++++ binutils-2.30/ld/testsuite/ld-size/size-8a.c 2018-06-01 11:07:54.926476839 +0100 +@@ -1,14 +1,15 @@ + #include + + extern __thread char bar[]; +-extern char size_of_bar asm ("bar@SIZE"); +-extern void set_bar (int, int); ++extern char size_of_bar asm ("bar@SIZE"); ++extern void set_bar (int, int); ++char * bar_size = & size_of_bar; + + int +-main () ++main (void) + { + set_bar (1, 20); +- if (10 == (long) &size_of_bar && bar[1] == 20) ++ if (10L == (long) bar_size && bar[1] == 20) + printf ("OK\n"); + + return 0; +--- binutils.orig/ld/testsuite/ld-size/size-4b.c 2018-05-31 16:14:12.569540562 +0100 ++++ binutils-2.30/ld/testsuite/ld-size/size-4b.c 2018-06-01 11:09:00.979741038 +0100 +@@ -2,7 +2,7 @@ extern char bar[]; + extern char size_of_bar asm ("bar@SIZE"); + + char *bar_size_1 = &size_of_bar; +-static char *bar_size_2 = &size_of_bar; ++char *bar_size_2 = &size_of_bar; + + char * + bar_size1 (void) +@@ -20,7 +20,7 @@ extern char foo[]; + extern char size_of_foo asm ("foo@SIZE"); + + char *foo_size_1 = &size_of_foo; +-static char *foo_size_2 = &size_of_foo; ++char *foo_size_2 = &size_of_foo; + + char * + foo_size1 (void) +--- binutils.orig/ld/testsuite/ld-size/size-5b.c 2018-05-31 16:14:12.569540562 +0100 ++++ binutils-2.30/ld/testsuite/ld-size/size-5b.c 2018-06-01 11:09:42.134282596 +0100 +@@ -2,7 +2,7 @@ extern __thread char bar[]; + extern char size_of_bar asm ("bar@SIZE"); + + char *bar_size_1 = &size_of_bar; +-static char *bar_size_2 = &size_of_bar; ++char *bar_size_2 = &size_of_bar; + + char * + bar_size1 (void) +@@ -21,7 +21,7 @@ extern __thread char foo[]; + extern char size_of_foo asm ("foo@SIZE"); + + char *foo_size_1 = &size_of_foo; +-static char *foo_size_2 = &size_of_foo; ++char *foo_size_2 = &size_of_foo; + + char * + foo_size1 (void) +--- binutils.orig/ld/testsuite/ld-size/size-6a.c 2018-05-31 16:14:12.568540573 +0100 ++++ binutils-2.30/ld/testsuite/ld-size/size-6a.c 2018-06-01 11:11:42.478942015 +0100 +@@ -1,14 +1,15 @@ + #include + +-extern char bar[]; +-extern char size_of_bar asm ("bar@SIZE"); +-extern void set_bar (int, int); ++extern char bar[]; ++extern char size_of_bar asm ("bar@SIZE"); ++extern void set_bar (int, int); ++char * bar_size = & size_of_bar; + + int +-main () ++main (void) + { + set_bar (1, 20); +- if (10 == (long) &size_of_bar && bar[1] == 20) ++ if (10 == (long) bar_size && bar[1] == 20) + printf ("OK\n"); + + return 0; +--- binutils.orig/ld/testsuite/ld-s390/tlspic_64.dd 2018-05-31 16:14:12.579540452 +0100 ++++ binutils-2.30/ld/testsuite/ld-s390/tlspic_64.dd 2018-06-01 13:20:16.509595466 +0100 +@@ -78,7 +78,7 @@ Disassembly of section .text: + +[0-9a-f]+: 00 00 00 60 .long 0x00000060 + # function prolog + +[0-9a-f]+: b9 04 00 ef lgr %r14,%r15 +- +[0-9a-f]+: c0 c0 [0-9a-f ]+ larl %r12,[0-9a-f]+ <_GLOBAL_OFFSET_TABLE_> ++ +[0-9a-f]+: c0 c0 [0-9a-f ]+ larl %r12,[0-9a-f]+ <.*> + +[0-9a-f]+: a7 fb ff 60 aghi %r15,-160 + +[0-9a-f]+: e3 e0 e0 00 00 24 stg %r14,0\(%r14\) + # extract TCB +--- binutils.orig/ld/testsuite/ld-srec/srec.exp 2018-05-31 16:14:12.570540551 +0100 ++++ binutils-2.30/ld/testsuite/ld-srec/srec.exp 2018-06-01 13:24:35.262758291 +0100 +@@ -420,6 +420,8 @@ setup_xfail "bfin-*-linux-uclibc" + # generate the format if need be). + setup_xfail "tile*-*-*" + ++setup_xfail "s390*-*-*" ++ + run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o" + + # Now try linking a C++ program with global constructors and +--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2018-05-31 16:14:12.665539507 +0100 ++++ binutils-2.30/ld/testsuite/ld-elf/tls.exp 2018-06-01 14:17:13.223211181 +0100 +@@ -37,15 +37,18 @@ if { [which $CC] == 0 } { + return + } + +-run_ld_link_tests [list \ +- [list \ +- "Build pr22263-1" \ +- "-pie -e _start -z text" \ +- "" \ +- "" \ +- { pr22263-1a.c pr22263-1b.c } \ +- {{readelf -r pr22263-1.rd}} \ +- "pr22263-1" \ +- "-fPIE -O2" \ +- ] \ +-] ++# The s390x system compiler miscompiles these tests. ++if { ! [istarget s390x-*-*] } { ++ run_ld_link_tests [list \ ++ [list \ ++ "Build pr22263-1" \ ++ "-pie -e _start -z text" \ ++ "" \ ++ "" \ ++ { pr22263-1a.c pr22263-1b.c } \ ++ {{readelf -r pr22263-1.rd}} \ ++ "pr22263-1" \ ++ "-fPIE -O2" \ ++ ] \ ++ ] ++} +--- binutils.orig/ld/testsuite/ld-elf/indirect.exp 2018-05-31 16:14:12.649539683 +0100 ++++ binutils-2.30/ld/testsuite/ld-elf/indirect.exp 2018-06-01 14:32:22.949232924 +0100 +@@ -156,12 +156,26 @@ set run_tests { + {"Run with libindirect4c.so 4" + "-Wl,--no-as-needed 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" "" +- {indirect5a.c} "indirect5a" "indirect5.out" "$NOPIE_CFLAGS"} +- {"Run indirect5 2" +- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" +- {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"} ++} ++ ++run_ld_link_exec_tests $run_tests ++ ++# The s390x system compiler miscompiles these tests. ++if { ! [istarget s390x-*-*] } { ++ ++ set run_tests { ++ {"Run indirect5 1" ++ "$NOPIE_LDFLAGS -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" "" ++ {dummy.c} "indirect5b" "indirect5.out" "$NOPIE_CFLAGS"} ++ } ++ ++ run_ld_link_exec_tests $run_tests ++} ++ ++set run_tests { + {"Run indirect6 1" + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libindirect5.so" "" + {indirect6a.c} "indirect6a" "indirect5.out" "$NOPIE_CFLAGS"} +@@ -213,12 +227,15 @@ proc check_dynamic_syms { test } { + return 1 + } + +-foreach t [list indirect5a indirect5b indirect6a indirect6b] { +- set testname [concat $t "dynsym"] +- if { [check_dynamic_syms tmpdir/$t] } { +- pass $testname +- } else { +- fail $testname ++# The s390x system compiler miscompiles indirect5 tests. ++if { ! [istarget s390x-*-*] } { ++ foreach t [list indirect5a indirect5b indirect6a indirect6b] { ++ set testname [concat $t "dynsym"] ++ if { [check_dynamic_syms tmpdir/$t] } { ++ pass $testname ++ } else { ++ fail $testname ++ } + } + } + +@@ -229,13 +246,22 @@ if { ! [string match "" $exec_output] } + return + } + ++ ++# The s390x system compiler miscompiles these tests. ++if { ! [istarget s390x-*-*] } { ++ set pie_tests { ++ {"Run indirect5 3" ++ "-pie -Wl,--no-as-needed tmpdir/libindirect5.so" "" ++ {indirect5a.c} "indirect5c" "indirect5.out" "-fPIE"} ++ {"Run indirect5 4" ++ "-pie -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" ++ {dummy.c} "indirect5d" "indirect5.out" "-fPIE"} ++ } ++ ++ run_ld_link_exec_tests $pie_tests ++} ++ + set pie_tests { +- {"Run indirect5 3" +- "-pie -Wl,--no-as-needed tmpdir/libindirect5.so" "" +- {indirect5a.c} "indirect5c" "indirect5.out" "-fPIE"} +- {"Run indirect5 4" +- "-pie -Wl,--no-as-needed tmpdir/indirect5a.o tmpdir/libindirect5.so" "" +- {dummy.c} "indirect5d" "indirect5.out" "-fPIE"} + {"Run indirect6 3" + "-pie -Wl,--no-as-needed tmpdir/libindirect5.so" "" + {indirect6a.c} "indirect6c" "indirect5.out" "-fPIE"} +@@ -246,11 +272,14 @@ set pie_tests { + + run_ld_link_exec_tests $pie_tests + +-foreach t [list indirect5c indirect5d indirect6c indirect6d] { +- set testname [concat $t "dynsym"] +- if { [check_dynamic_syms tmpdir/$t] } { +- pass $testname +- } else { +- fail $testname ++# The s390x system compiler miscompiles indirect5 tests. ++if { ! [istarget s390x-*-*] } { ++ foreach t [list indirect5c indirect5d indirect6c indirect6d] { ++ set testname [concat $t "dynsym"] ++ if { [check_dynamic_syms tmpdir/$t] } { ++ pass $testname ++ } else { ++ fail $testname ++ } + } + } +--- binutils.orig/ld/testsuite/ld-elfvers/vers.exp 2018-05-31 16:14:12.572540529 +0100 ++++ binutils-2.30/ld/testsuite/ld-elfvers/vers.exp 2018-06-01 15:23:36.518815276 +0100 +@@ -938,6 +938,7 @@ if [string match "yes" $pic] then { + build_exec "vers23" vers23.c vers23 "-Wl,--no-as-needed tmpdir/vers23a.so tmpdir/vers23b.o tmpdir/vers23b.so" "" vers23.ver vers23.dsym "" + } + ++if {! [istarget ppc64*-*-*] && ![istarget "powerpc*-*-linux*"] } { + # Test .symver x,x@VERS.0 + set as_pic_flags "" + if [istarget sparc*-*-*] { +@@ -955,6 +956,7 @@ run_ld_link_tests [list "\"vers24c\" + \"-shared --version-script $srcdir/$subdir/vers24.map\" \"\" + \"$as_pic_flags $as_options\" {vers24c.c} { { readelf -Wrs vers24.rd } } + \"libvers24c.so\" \"-fpic\""] ++} + + # Test versioned definition vs. normal definition in different files. + if [string match "yes" $pic] then { +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2018-05-31 16:14:12.573540519 +0100 ++++ binutils-2.30/ld/testsuite/ld-ifunc/ifunc.exp 2018-06-01 15:26:52.020691739 +0100 +@@ -284,11 +284,14 @@ if {! [check_osabi tmpdir/static_nonifun + # The linked ifunc using executables and the shared library containing + # ifunc should contain an IFUNC symbol. The non-ifunc using executable + # should not. +- ++if { ![istarget "ppc*-*-*"] && ![istarget "powerpc*-*-linux*"] } { + if {[contains_ifunc_symbol tmpdir/libshared_ifunc.so] != 1} { + fail "Shared libraries containing ifunc does not contain an IFUNC symbol" + set fails [expr $fails + 1] + } ++} ++ ++if { ![istarget "ppc*-*-*"] && ![istarget "powerpc*-*-linux*"] } { + if {[contains_ifunc_symbol tmpdir/local_prog] != 1} { + fail "Local ifunc-using executable does not contain an IFUNC symbol" + set fails [expr $fails + 1] +@@ -297,6 +300,7 @@ if {[contains_ifunc_symbol tmpdir/static + fail "Static ifunc-using executable does not contain an IFUNC symbol" + set fails [expr $fails + 1] + } ++} + if {[contains_ifunc_symbol tmpdir/dynamic_prog] != 0} { + fail "Dynamic ifunc-using executable contains an IFUNC symbol" + set fails [expr $fails + 1] +--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2018-05-31 16:14:12.580540442 +0100 ++++ binutils-2.30/ld/testsuite/ld-plugin/plugin.exp 2018-06-01 15:29:44.048823172 +0100 +@@ -293,12 +293,14 @@ if { !$can_compile || $failed_compile } + + run_ld_link_tests $plugin_tests + ++if { ! [istarget "ppc*-*-*"] && ![istarget "powerpc*-*-linux*"] } { + if { [is_elf_format] \ + && [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func1p.c tmpdir/func1p.o] \ + && [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func2i.c tmpdir/func2i.o] \ + && [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func3h.c tmpdir/func3h.o] } { + run_ld_link_tests $plugin_extra_elf_tests + } ++} + + if {![ar_simple_create $ar "" "tmpdir/libtext.a" "tmpdir/text.o"] || \ + ![ar_simple_create $ar "" "tmpdir/libempty.a" ""]} { +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-12.d binutils-2.30/ld/testsuite/ld-plugin/plugin-12.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-12.d 2018-09-05 09:45:44.025108586 +0100 ++++ binutils-2.30/ld/testsuite/ld-plugin/plugin-12.d 2018-09-05 11:50:14.911718048 +0100 +@@ -1,6 +1,6 @@ + #... +-.*: symbol `func' definition: 0, visibility: 0, resolution: 2 +-.*: symbol `func1' definition: 0, visibility: 1, resolution: 3 +-.*: symbol `func2' definition: 0, visibility: 2, resolution: 3 +-.*: symbol `func3' definition: 0, visibility: 3, resolution: 3 ++.*: symbol `.*unc' definition: 0, visibility: 0, resolution: 2 ++.*: symbol `.*unc1' definition: 0, visibility: 1, resolution: 3 ++.*: symbol `.*unc2' definition: 0, visibility: 2, resolution: 3 ++.*: symbol `.*unc3' definition: 0, visibility: 3, resolution: 3 + #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 -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd binutils-2.30/ld/testsuite/ld-x86-64/plt-main-bnd.dd +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2018-09-05 14:08:22.983184999 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2018-09-05 16:19:36.033431902 +0100 +@@ -2,6 +2,6 @@ + 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/x86-64.exp binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp +--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2018-09-05 14:08:22.970185099 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp 2018-09-05 16:22:30.064079063 +0100 +@@ -671,12 +671,6 @@ if { [isnative] && [which $CC] != 0 } { + return + } + +- run_ld_link_tests { +- {"X32 DSO from x86-64 object" +- "-shared -melf32_x86_64 tmpdir/simple-x32.o" "" "--x32" +- {dummy.s} {{readelf {-s --wide} x86-64-x32.rd}} "x86-64-x32"} +- } +- + run_cc_link_tests [list \ + [list \ + "Build plt-lib.so" \ diff --git a/SOURCES/binutils-gas-build-notes.patch b/SOURCES/binutils-gas-build-notes.patch new file mode 100644 index 0000000..8c6fc9f --- /dev/null +++ b/SOURCES/binutils-gas-build-notes.patch @@ -0,0 +1,555 @@ +diff -rup binutils.orig/binutils/readelf.c binutils-2.30/binutils/readelf.c +--- binutils.orig/binutils/readelf.c 2018-04-26 15:14:17.220464639 +0100 ++++ binutils-2.30/binutils/readelf.c 2018-04-26 15:14:31.927287474 +0100 +@@ -12294,7 +12294,8 @@ is_32bit_abs_reloc (Filedata * filedata, + case EM_OR1K: + return reloc_type == 1; /* R_OR1K_32. */ + case EM_PARISC: +- return (reloc_type == 1 /* R_PARISC_DIR32. */ ++ return (reloc_type == 1 /* R_PARISC_DIR32. */ ++ || reloc_type == 2 /* R_PARISC_DIR21L. */ + || reloc_type == 41); /* R_PARISC_SECREL32. */ + case EM_PJ: + case EM_PJ_OLD: +Only in binutils-2.30/binutils: readelf.c.orig +diff -rup binutils.orig/binutils/testsuite/binutils-all/objcopy.exp binutils-2.30/binutils/testsuite/binutils-all/objcopy.exp +--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2018-04-26 15:14:17.215464699 +0100 ++++ binutils-2.30/binutils/testsuite/binutils-all/objcopy.exp 2018-04-26 15:14:31.927287474 +0100 +@@ -1062,6 +1062,7 @@ if [is_elf_format] { + run_dump_test "note-3-32" + run_dump_test "note-4-32" + } ++ run_dump_test "note-5" + } + + run_dump_test "copy-2" +Only in binutils-2.30/binutils/testsuite/binutils-all: objcopy.exp.orig +diff -rup binutils.orig/gas/as.c binutils-2.30/gas/as.c +--- binutils.orig/gas/as.c 2018-04-26 15:14:17.646459507 +0100 ++++ binutils-2.30/gas/as.c 2018-04-26 15:14:31.927287474 +0100 +@@ -97,6 +97,7 @@ int verbose = 0; + + #if defined OBJ_ELF || defined OBJ_MAYBE_ELF + int flag_use_elf_stt_common = DEFAULT_GENERATE_ELF_STT_COMMON; ++bfd_boolean flag_generate_build_notes = DEFAULT_GENERATE_BUILD_NOTES; + #endif + + /* Keep the output file. */ +@@ -304,8 +305,19 @@ Options:\n\ + generate ELF common symbols with STT_COMMON type\n")); + fprintf (stream, _("\ + --sectname-subst enable section name substitution sequences\n")); ++ ++ fprintf (stream, _("\ ++ --generate-missing-build-notes=[no|yes] ")); ++#if DEFAULT_GENERATE_BUILD_NOTES ++ fprintf (stream, _("(default: yes)\n")); ++#else ++ fprintf (stream, _("(default: no)\n")); + #endif + fprintf (stream, _("\ ++ generate GNU Build notes if none are present in the input\n")); ++#endif /* OBJ_ELF */ ++ ++ fprintf (stream, _("\ + -f skip whitespace and comment preprocessing\n")); + fprintf (stream, _("\ + -g --gen-debug generate debugging information\n")); +@@ -470,6 +482,7 @@ parse_args (int * pargc, char *** pargv) + OPTION_NOEXECSTACK, + OPTION_SIZE_CHECK, + OPTION_ELF_STT_COMMON, ++ OPTION_ELF_BUILD_NOTES, + OPTION_SECTNAME_SUBST, + OPTION_ALTERNATE, + OPTION_AL, +@@ -508,6 +521,7 @@ parse_args (int * pargc, char *** pargv) + ,{"size-check", required_argument, NULL, OPTION_SIZE_CHECK} + ,{"elf-stt-common", required_argument, NULL, OPTION_ELF_STT_COMMON} + ,{"sectname-subst", no_argument, NULL, OPTION_SECTNAME_SUBST} ++ ,{"generate-missing-build-notes", required_argument, NULL, OPTION_ELF_BUILD_NOTES} + #endif + ,{"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL} + ,{"gdwarf-2", no_argument, NULL, OPTION_GDWARF2} +@@ -900,7 +914,19 @@ This program has absolutely no warranty. + case OPTION_SECTNAME_SUBST: + flag_sectname_subst = 1; + break; +-#endif ++ ++ case OPTION_ELF_BUILD_NOTES: ++ if (strcasecmp (optarg, "no") == 0) ++ flag_generate_build_notes = FALSE; ++ else if (strcasecmp (optarg, "yes") == 0) ++ flag_generate_build_notes = TRUE; ++ else ++ as_fatal (_("Invalid --generate-missing-build-notes option: `%s'"), ++ optarg); ++ break; ++ ++#endif /* OBJ_ELF */ ++ + case 'Z': + flag_always_generate_output = 1; + break; +diff -rup binutils.orig/gas/as.h binutils-2.30/gas/as.h +--- binutils.orig/gas/as.h 2018-04-26 15:14:17.654459410 +0100 ++++ binutils-2.30/gas/as.h 2018-04-26 15:14:31.927287474 +0100 +@@ -585,6 +585,10 @@ COMMON int flag_allow_nonconst_size; + /* If we should generate ELF common symbols with the STT_COMMON type. */ + extern int flag_use_elf_stt_common; + ++/* TRUE iff GNU Build attribute notes should ++ be generated if none are in the input files. */ ++extern bfd_boolean flag_generate_build_notes; ++ + /* If section name substitution sequences should be honored */ + COMMON int flag_sectname_subst; + #endif +Only in binutils-2.30/gas: as.h.orig +diff -rup binutils.orig/gas/config.in binutils-2.30/gas/config.in +--- binutils.orig/gas/config.in 2018-04-26 15:14:17.645459519 +0100 ++++ binutils-2.30/gas/config.in 2018-04-26 15:14:31.927287474 +0100 +@@ -39,6 +39,10 @@ + /* Define if you want compressed debug sections by default. */ + #undef DEFAULT_FLAG_COMPRESS_DEBUG + ++/* Define to 1 if you want to generate GNU Build attribute notes by default, ++ if none are contained in the input. */ ++#undef DEFAULT_GENERATE_BUILD_NOTES ++ + /* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ + #undef DEFAULT_GENERATE_ELF_STT_COMMON +diff -rup binutils.orig/gas/configure binutils-2.30/gas/configure +--- binutils.orig/gas/configure 2018-04-26 15:14:17.645459519 +0100 ++++ binutils-2.30/gas/configure 2018-04-26 15:14:31.928287462 +0100 +@@ -771,6 +771,7 @@ enable_checking + enable_compressed_debug_sections + enable_x86_relax_relocations + enable_elf_stt_common ++enable_generate_build_notes + enable_werror + enable_build_warnings + with_cpu +@@ -1426,6 +1427,9 @@ Optional Features: + generate x86 relax relocations by default + --enable-elf-stt-common generate ELF common symbols with STT_COMMON type by + default ++ --enable-generate-build-notes ++ generate GNU Build notes if none are provided by the ++ input + --enable-werror treat compile warnings as errors + --enable-build-warnings enable build-time compiler warnings + --disable-nls do not use Native Language Support +@@ -11011,7 +11015,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10990 "configure" ++#line 10994 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11117,7 +11121,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11096 "configure" ++#line 11100 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11771,6 +11775,20 @@ if test "${enable_elf_stt_common+set}" = + esac + fi + ++ ++# Decide if the ELF assembler should default to generating ++# GNU Build notes if none are provided by the input. ++ac_default_generate_build_notes=0 ++# Provide a configuration option to override the default. ++# Check whether --enable-generate_build_notes was given. ++if test "${enable_generate_build_notes+set}" = set; then : ++ enableval=$enable_generate_build_notes; case "${enableval}" in ++ yes) ac_default_generate_build_notes=1 ;; ++ no) ac_default_generate_build_notes=0 ;; ++esac ++fi ++ ++ + using_cgen=no + + +@@ -12713,6 +12731,12 @@ cat >>confdefs.h <<_ACEOF + _ACEOF + + ++ ++cat >>confdefs.h <<_ACEOF ++#define DEFAULT_GENERATE_BUILD_NOTES $ac_default_generate_build_notes ++_ACEOF ++ ++ + if test x$ac_default_compressed_debug_sections = xyes ; then + + $as_echo "#define DEFAULT_FLAG_COMPRESS_DEBUG 1" >>confdefs.h +diff -rup binutils.orig/gas/configure.ac binutils-2.30/gas/configure.ac +--- binutils.orig/gas/configure.ac 2018-04-26 15:14:17.645459519 +0100 ++++ binutils-2.30/gas/configure.ac 2018-04-26 15:14:31.928287462 +0100 +@@ -100,6 +100,20 @@ AC_ARG_ENABLE(elf_stt_common, + yes) ac_default_elf_stt_common=1 ;; + esac])dnl + ++ ++# Decide if the ELF assembler should default to generating ++# GNU Build notes if none are provided by the input. ++ac_default_generate_build_notes=0 ++# Provide a configuration option to override the default. ++AC_ARG_ENABLE(generate_build_notes, ++ AS_HELP_STRING([--enable-generate-build-notes], ++ [generate GNU Build notes if none are provided by the input]), ++[case "${enableval}" in ++ yes) ac_default_generate_build_notes=1 ;; ++ no) ac_default_generate_build_notes=0 ;; ++esac])dnl ++ ++ + using_cgen=no + + AM_BINUTILS_WARNINGS +@@ -610,6 +624,11 @@ AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_ELF_ + [Define to 1 if you want to generate ELF common symbols with the + STT_COMMON type by default.]) + ++AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_BUILD_NOTES, ++ $ac_default_generate_build_notes, ++ [Define to 1 if you want to generate GNU Build attribute notes ++ by default, if none are contained in the input.]) ++ + if test x$ac_default_compressed_debug_sections = xyes ; then + AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.]) + fi +Only in binutils-2.30/gas: configure.ac.orig +Only in binutils-2.30/gas: configure.orig +diff -rup binutils.orig/gas/doc/as.texinfo binutils-2.30/gas/doc/as.texinfo +--- binutils.orig/gas/doc/as.texinfo 2018-04-26 15:14:17.665459278 +0100 ++++ binutils-2.30/gas/doc/as.texinfo 2018-04-26 15:14:31.929287450 +0100 +@@ -244,6 +244,7 @@ gcc(1), ld(1), and the Info entries for + [@b{-Z}] [@b{@@@var{FILE}}] + [@b{--sectname-subst}] [@b{--size-check=[error|warning]}] + [@b{--elf-stt-common=[no|yes]}] ++ [@b{--generate-missing-build-notes=[no|yes]}] + [@b{--target-help}] [@var{target-options}] + [@b{--}|@var{files} @dots{}] + @c +@@ -754,6 +755,14 @@ Issue an error or warning for invalid EL + These options control whether the ELF assembler should generate common + symbols with the @code{STT_COMMON} type. The default can be controlled + by a configure option @option{--enable-elf-stt-common}. ++ ++@item --generate-missing-build-notes=yes ++@itemx --generate-missing-build-notes=no ++These options control whether the ELF assembler should generate GNU Build ++attribute notes if none are present in the input sources. ++The default can be controlled by the @option{--enable-generate-build-notes} ++configure option. ++ + @end ifset + + @item --help +Only in binutils-2.30/gas/doc: as.texinfo.orig +diff -rup binutils.orig/gas/NEWS binutils-2.30/gas/NEWS +--- binutils.orig/gas/NEWS 2018-04-26 15:14:17.646459507 +0100 ++++ binutils-2.30/gas/NEWS 2018-04-26 15:15:32.276560482 +0100 +@@ -1,5 +1,11 @@ + -*- text -*- + ++* Add --generate-missing-build-notes=[yes|no] option to create (or not) GNU ++ Build Attribute notes if none are present in the input sources. Add a ++ --enable-generate-build-notes=[yes|no] configure time option to set the ++ default behaviour. Set the default if the configure option is not used ++ to "no". ++ + Changes in 2.30: + + * Add support for loaction views in DWARF debug line information. +Only in binutils-2.30/gas: NEWS.orig +Only in binutils-2.30/gas: NEWS.rej +diff -rup binutils.orig/gas/symbols.c binutils-2.30/gas/symbols.c +--- binutils.orig/gas/symbols.c 2018-04-26 15:14:17.667459254 +0100 ++++ binutils-2.30/gas/symbols.c 2018-04-26 15:14:31.929287450 +0100 +@@ -108,6 +108,7 @@ save_symbol_name (const char *name) + size_t name_length; + char *ret; + ++ gas_assert (name != NULL); + name_length = strlen (name) + 1; /* +1 for \0. */ + obstack_grow (¬es, name, name_length); + ret = (char *) obstack_finish (¬es); +diff -rup binutils.orig/gas/write.c binutils-2.30/gas/write.c +--- binutils.orig/gas/write.c 2018-04-26 15:14:18.296451677 +0100 ++++ binutils-2.30/gas/write.c 2018-04-26 15:14:31.929287450 +0100 +@@ -1822,25 +1822,200 @@ create_obj_attrs_section (void) + const char *name; + + size = bfd_elf_obj_attr_size (stdoutput); +- if (size) ++ if (size == 0) ++ return; ++ ++ name = get_elf_backend_data (stdoutput)->obj_attrs_section; ++ if (!name) ++ name = ".gnu.attributes"; ++ s = subseg_new (name, 0); ++ elf_section_type (s) ++ = get_elf_backend_data (stdoutput)->obj_attrs_section_type; ++ bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA); ++ frag_now_fix (); ++ p = frag_more (size); ++ bfd_elf_set_obj_attr_contents (stdoutput, (bfd_byte *)p, size); ++ ++ subsegs_finish_section (s); ++ relax_segment (seg_info (s)->frchainP->frch_root, s, 0); ++ size_seg (stdoutput, s, NULL); ++} ++ ++#include "struc-symbol.h" ++ ++/* Create a relocation against an entry in a GNU Build attribute section. */ ++ ++static void ++create_note_reloc (segT sec, ++ symbolS * sym, ++ bfd_size_type offset, ++ int reloc_type, ++ bfd_vma addend, ++ char * note) ++{ ++ struct reloc_list * reloc; ++ ++ reloc = XNEW (struct reloc_list); ++ ++ /* We create a .b type reloc as resolve_reloc_expr_symbols() has already been called. */ ++ reloc->u.b.sec = sec; ++ reloc->u.b.s = sym->bsym; ++ reloc->u.b.r.sym_ptr_ptr = & reloc->u.b.s; ++ reloc->u.b.r.address = offset; ++ reloc->u.b.r.addend = addend; ++ reloc->u.b.r.howto = bfd_reloc_type_lookup (stdoutput, reloc_type); ++ ++ if (reloc->u.b.r.howto == NULL) + { +- name = get_elf_backend_data (stdoutput)->obj_attrs_section; +- if (!name) +- name = ".gnu.attributes"; +- s = subseg_new (name, 0); +- elf_section_type (s) +- = get_elf_backend_data (stdoutput)->obj_attrs_section_type; +- bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA); +- frag_now_fix (); +- p = frag_more (size); +- bfd_elf_set_obj_attr_contents (stdoutput, (bfd_byte *)p, size); +- +- subsegs_finish_section (s); +- relax_segment (seg_info (s)->frchainP->frch_root, s, 0); +- size_seg (stdoutput, s, NULL); ++ as_bad (_("unable to create reloc for build note")); ++ return; ++ } ++ ++ reloc->file = N_(""); ++ reloc->line = 0; ++ ++ reloc->next = reloc_list; ++ reloc_list = reloc; ++ ++ /* For REL relocs, store the addend in the section. */ ++ if (! sec->use_rela_p ++ /* The SH target is a special case that uses RELA relocs ++ but still stores the addend in the word being relocated. */ ++ || strstr (bfd_get_target (stdoutput), "-sh") != NULL) ++ { ++ if (target_big_endian) ++ { ++ if (bfd_arch_bits_per_address (stdoutput) <= 32) ++ note[offset + 3] = addend; ++ else ++ note[offset + 7] = addend; ++ } ++ else ++ note[offset] = addend; + } + } +-#endif ++ ++static void ++maybe_generate_build_notes (void) ++{ ++ segT sec; ++ char * note; ++ offsetT note_size; ++ offsetT desc_size; ++ offsetT desc2_offset; ++ int desc_reloc; ++ symbolS * sym; ++ ++ if (! flag_generate_build_notes ++ || bfd_get_section_by_name (stdoutput, ++ GNU_BUILD_ATTRS_SECTION_NAME) != NULL) ++ return; ++ ++ /* Create a GNU Build Attribute section. */ ++ sec = subseg_new (GNU_BUILD_ATTRS_SECTION_NAME, FALSE); ++ elf_section_type (sec) = SHT_NOTE; ++ bfd_set_section_flags (stdoutput, sec, ++ SEC_READONLY | SEC_HAS_CONTENTS | SEC_DATA); ++ bfd_set_section_alignment (stdoutput, sec, 2); ++ ++ /* Create a version note. */ ++ if (bfd_arch_bits_per_address (stdoutput) <= 32) ++ { ++ note_size = 28; ++ desc_size = 8; /* Two 4-byte offsets. */ ++ desc2_offset = 24; ++ ++ /* FIXME: The BFD backend for the CRX target does not support the ++ BFD_RELOC_32, even though it really should. Likewise for the ++ CR16 target. So we have special case code here... */ ++ if (strstr (bfd_get_target (stdoutput), "-crx") != NULL) ++ desc_reloc = BFD_RELOC_CRX_NUM32; ++ else if (strstr (bfd_get_target (stdoutput), "-cr16") != NULL) ++ desc_reloc = BFD_RELOC_CR16_NUM32; ++ else ++ desc_reloc = BFD_RELOC_32; ++ } ++ else ++ { ++ note_size = 36; ++ desc_size = 16; /* Two 8-byte offsets. */ ++ desc2_offset = 28; ++ /* FIXME: The BFD backend for the IA64 target does not support the ++ BFD_RELOC_64, even though it really should. The HPPA backend ++ has a similar issue, although it does not support BFD_RELOCs at ++ all! So we have special case code to handle these targets. */ ++ if (strstr (bfd_get_target (stdoutput), "-ia64") != NULL) ++ desc_reloc = target_big_endian ? BFD_RELOC_IA64_DIR32MSB : BFD_RELOC_IA64_DIR32LSB; ++ else if (strstr (bfd_get_target (stdoutput), "-hppa") != NULL) ++ desc_reloc = 80; /* R_PARISC_DIR64. */ ++ else ++ desc_reloc = BFD_RELOC_64; ++ } ++ ++ frag_now_fix (); ++ note = frag_more (note_size); ++ memset (note, 0, note_size); ++ ++ if (target_big_endian) ++ { ++ note[3] = 8; /* strlen (name) + 1. */ ++ note[7] = desc_size; /* Two 8-byte offsets. */ ++ note[10] = NT_GNU_BUILD_ATTRIBUTE_OPEN >> 8; ++ note[11] = NT_GNU_BUILD_ATTRIBUTE_OPEN & 0xff; ++ } ++ else ++ { ++ note[0] = 8; /* strlen (name) + 1. */ ++ note[4] = desc_size; /* Two 8-byte offsets. */ ++ note[8] = NT_GNU_BUILD_ATTRIBUTE_OPEN & 0xff; ++ note[9] = NT_GNU_BUILD_ATTRIBUTE_OPEN >> 8; ++ } ++ ++ /* The a1 version number indicates that this note was ++ generated by the assembler and not the gcc annobin plugin. */ ++ memcpy (note + 12, "GA$3a1", 8); ++ ++ /* Find the first code section symbol. */ ++ for (sym = symbol_rootP; sym != NULL; sym = sym->sy_next) ++ if (sym->bsym != NULL ++ && sym->bsym->flags & BSF_SECTION_SYM ++ && sym->bsym->section != NULL ++ && sym->bsym->section->flags & SEC_CODE) ++ { ++ /* Found one - now create a relocation against this symbol. */ ++ create_note_reloc (sec, sym, 20, desc_reloc, 0, note); ++ break; ++ } ++ ++ /* Find the last code section symbol. */ ++ if (sym) ++ { ++ for (sym = symbol_lastP; sym != NULL; sym = sym->sy_previous) ++ if (sym->bsym != NULL ++ && sym->bsym->flags & BSF_SECTION_SYM ++ && sym->bsym->section != NULL ++ && sym->bsym->section->flags & SEC_CODE) ++ { ++ /* Create a relocation against the end of this symbol. */ ++ create_note_reloc (sec, sym, desc2_offset, desc_reloc, ++ bfd_get_section_size (sym->bsym->section), ++ note); ++ break; ++ } ++ } ++ /* else - if we were unable to find any code section symbols then ++ probably there is no code in the output. So leaving the start ++ and end values as zero in the note is OK. */ ++ ++ /* FIXME: Maybe add a note recording the assembler command line and version ? */ ++ ++ /* Install the note(s) into the section. */ ++ bfd_set_section_contents (stdoutput, sec, (bfd_byte *) note, 0, note_size); ++ subsegs_finish_section (sec); ++ relax_segment (seg_info (sec)->frchainP->frch_root, sec, 0); ++ size_seg (stdoutput, sec, NULL); ++} ++#endif /* OBJ_ELF */ + + /* Write the object file. */ + +@@ -2052,6 +2227,11 @@ write_object_file (void) + resolve_local_symbol_values (); + resolve_reloc_expr_symbols (); + ++#ifdef OBJ_ELF ++ if (IS_ELF) ++ maybe_generate_build_notes (); ++#endif ++ + PROGRESS (1); + + #ifdef tc_frob_file_before_adjust +Only in binutils-2.30/gas: write.c.orig +Only in binutils-2.30: testsuite +--- /dev/null 2018-04-26 08:07:19.307057583 +0100 ++++ binutils-2.30/binutils/testsuite/binutils-all/note-5.d 2018-04-26 15:17:06.318427614 +0100 +@@ -0,0 +1,11 @@ ++#PROG: objcopy ++#as: --generate-missing-build-notes=yes ++#readelf: --notes --wide ++#name: assembler generated build notes ++#source: note-5.s ++ ++#... ++Displaying notes found in: .gnu.build.attributes ++[ ]+Owner[ ]+Data size[ ]+Description ++[ ]+GA\$3a1[ ]+0x000000(08|10)[ ]+OPEN[ ]+Applies to region from 0 to 0x.. \(note_5.s\) ++#... +--- /dev/null 2018-04-26 08:07:19.307057583 +0100 ++++ binutils-2.30/binutils/testsuite/binutils-all/note-5.s 2018-04-26 15:17:06.318427614 +0100 +@@ -0,0 +1,14 @@ ++ .text ++ .global note_5.s ++note_5.s: ++ .dc.l 2 ++ .dc.l 4 ++ .dc.l 6 ++ .dc.l 8 ++ .dc.l 8 ++ .dc.l 8 ++ .dc.l 8 ++ .dc.l 8 ++ .dc.l 8 ++ .dc.l 8 ++ +\ No newline at end of file diff --git a/SOURCES/binutils-gold-8-byte-note-segments.patch b/SOURCES/binutils-gold-8-byte-note-segments.patch new file mode 100644 index 0000000..8e10761 --- /dev/null +++ b/SOURCES/binutils-gold-8-byte-note-segments.patch @@ -0,0 +1,99 @@ +diff -rup binutils.orig/gold/layout.cc binutils-2.30/gold/layout.cc +--- binutils.orig/gold/layout.cc 2018-10-09 15:24:05.987282736 +0100 ++++ binutils-2.30/gold/layout.cc 2018-10-09 16:08:29.445946736 +0100 +@@ -2052,12 +2052,15 @@ Layout::attach_allocated_section_to_segm + // segment. + if (os->type() == elfcpp::SHT_NOTE) + { ++ uint64_t os_align = os->addralign(); ++ + // See if we already have an equivalent PT_NOTE segment. + for (p = this->segment_list_.begin(); + p != segment_list_.end(); + ++p) + { + if ((*p)->type() == elfcpp::PT_NOTE ++ && (*p)->align() == os_align + && (((*p)->flags() & elfcpp::PF_W) + == (seg_flags & elfcpp::PF_W))) + { +@@ -2071,6 +2074,7 @@ Layout::attach_allocated_section_to_segm + Output_segment* oseg = this->make_output_segment(elfcpp::PT_NOTE, + seg_flags); + oseg->add_output_section_to_nonload(os, seg_flags); ++ oseg->set_align(os_align); + } + } + +@@ -3171,6 +3175,10 @@ Layout::create_note(const char* name, in + #else + const int size = 32; + #endif ++ // The NT_GNU_PROPERTY_TYPE_0 note conforms to gABI. ++ const int addralign = ((note_type == elfcpp::NT_GNU_PROPERTY_TYPE_0 ++ ? parameters->target().get_size() ++ : size) / 8); + + // The contents of the .note section. + size_t namesz = strlen(name) + 1; +@@ -3234,7 +3242,7 @@ Layout::create_note(const char* name, in + return NULL; + + Output_section_data* posd = new Output_data_const_buffer(buffer, notehdrsz, +- size / 8, ++ addralign, + "** note header"); + os->add_output_section_data(posd); + +@@ -3692,6 +3700,11 @@ Layout::segment_precedes(const Output_se + { + if (type1 != type2) + return type1 < type2; ++ uint64_t align1 = seg1->align(); ++ uint64_t align2 = seg2->align(); ++ // Place segments with larger alignments first. ++ if (align1 != align2) ++ return align1 > align2; + gold_assert(flags1 != flags2 + || this->script_options_->saw_phdrs_clause()); + return flags1 < flags2; +diff -rup binutils.orig/gold/output.cc binutils-2.30/gold/output.cc +--- binutils.orig/gold/output.cc 2018-10-09 15:24:05.986282744 +0100 ++++ binutils-2.30/gold/output.cc 2018-10-09 16:09:03.749670846 +0100 +@@ -4107,6 +4107,7 @@ Output_segment::Output_segment(elfcpp::E + : vaddr_(0), + paddr_(0), + memsz_(0), ++ align_(0), + max_align_(0), + min_p_align_(0), + offset_(0), +diff -rup binutils.orig/gold/output.h binutils-2.30/gold/output.h +--- binutils.orig/gold/output.h 2018-10-09 15:24:05.984282760 +0100 ++++ binutils-2.30/gold/output.h 2018-10-09 16:09:45.665333727 +0100 +@@ -4676,6 +4676,16 @@ class Output_segment + offset() const + { return this->offset_; } + ++ // Return the segment alignment. ++ uint64_t ++ align() const ++ { return this->align_; } ++ ++ // Set the segment alignment. ++ void ++ set_align(uint64_t align) ++ { this->align_ = align; } ++ + // Whether this is a segment created to hold large data sections. + bool + is_large_data_segment() const +@@ -4898,6 +4908,8 @@ class Output_segment + uint64_t paddr_; + // The size of the segment in memory. + uint64_t memsz_; ++ // The segment alignment. ++ uint64_t align_; + // The maximum section alignment. The is_max_align_known_ field + // indicates whether this has been finalized. + uint64_t max_align_; diff --git a/SOURCES/binutils-gold-ignore-discarded-note-relocs.patch b/SOURCES/binutils-gold-ignore-discarded-note-relocs.patch new file mode 100644 index 0000000..6f2b4ee --- /dev/null +++ b/SOURCES/binutils-gold-ignore-discarded-note-relocs.patch @@ -0,0 +1,10 @@ +--- binutils.orig/gold/target-reloc.h 2018-07-25 08:29:41.347174442 +0100 ++++ binutils-2.30/gold/target-reloc.h 2018-07-25 08:30:47.390413706 +0100 +@@ -136,6 +136,7 @@ class Default_comdat_behavior + if (Layout::is_debug_info_section(name)) + return CB_PRETEND; + if (strcmp(name, ".eh_frame") == 0 ++ || strncmp(name, ".gnu.build.attributes", 21) == 0 // FIXME: We should really be checking the section type for SHT_NOTE. + || strcmp(name, ".gcc_except_table") == 0) + return CB_IGNORE; + return CB_WARNING; diff --git a/SOURCES/binutils-gold-llvm-plugin.patch b/SOURCES/binutils-gold-llvm-plugin.patch new file mode 100644 index 0000000..d6d3a7e --- /dev/null +++ b/SOURCES/binutils-gold-llvm-plugin.patch @@ -0,0 +1,16 @@ +--- binutils.orig/gold/resolve.cc 2018-03-22 16:52:11.746513638 +0000 ++++ binutils-2.30/gold/resolve.cc 2018-03-22 16:53:58.038192419 +0000 +@@ -265,10 +265,13 @@ Symbol_table::resolve(Sized_symbol + return; + + // Likewise for an absolute symbol defined twice with the same value. ++ // Plugin-symbols are always absolute with same value here, so ignore those. + if (!is_ordinary + && st_shndx == elfcpp::SHN_ABS + && !to_is_ordinary + && to_shndx == elfcpp::SHN_ABS ++ && object->pluginobj() == NULL ++ && to->object()->pluginobj() == NULL + && to->value() == sym.get_st_value()) + return; + diff --git a/SOURCES/binutils-gold-note-segment.patch b/SOURCES/binutils-gold-note-segment.patch new file mode 100644 index 0000000..00efa01 --- /dev/null +++ b/SOURCES/binutils-gold-note-segment.patch @@ -0,0 +1,1239 @@ +Only in binutils-2.30/gold: ChangeLog.orig +Only in binutils-2.30/gold: ChangeLog.rej +diff -rup binutils.orig/gold/layout.cc binutils-2.30/gold/layout.cc +--- binutils.orig/gold/layout.cc 2018-08-14 16:18:17.928466978 +0100 ++++ binutils-2.30/gold/layout.cc 2018-08-14 16:23:15.811244776 +0100 +@@ -474,7 +474,8 @@ Layout::Layout(int number_of_input_files + input_section_position_(), + input_section_glob_(), + incremental_base_(NULL), +- free_list_() ++ free_list_(), ++ gnu_properties_() + { + // Make space for more than enough segments for a typical file. + // This is just for efficiency--it's OK if we wind up needing more. +@@ -2182,11 +2183,243 @@ Layout::layout_gnu_stack(bool seen_gnu_s + } + } + ++// Read a value with given size and endianness. ++ ++static inline uint64_t ++read_sized_value(size_t size, const unsigned char* buf, bool is_big_endian, ++ const Object* object) ++{ ++ uint64_t val = 0; ++ if (size == 4) ++ { ++ if (is_big_endian) ++ val = elfcpp::Swap<32, true>::readval(buf); ++ else ++ val = elfcpp::Swap<32, false>::readval(buf); ++ } ++ else if (size == 8) ++ { ++ if (is_big_endian) ++ val = elfcpp::Swap<64, true>::readval(buf); ++ else ++ val = elfcpp::Swap<64, false>::readval(buf); ++ } ++ else ++ { ++ gold_warning(_("%s: in .note.gnu.property section, " ++ "pr_datasz must be 4 or 8"), ++ object->name().c_str()); ++ } ++ return val; ++} ++ ++// Write a value with given size and endianness. ++ ++static inline void ++write_sized_value(uint64_t value, size_t size, unsigned char* buf, ++ bool is_big_endian) ++{ ++ if (size == 4) ++ { ++ if (is_big_endian) ++ elfcpp::Swap<32, true>::writeval(buf, static_cast(value)); ++ else ++ elfcpp::Swap<32, false>::writeval(buf, static_cast(value)); ++ } ++ else if (size == 8) ++ { ++ if (is_big_endian) ++ elfcpp::Swap<64, true>::writeval(buf, value); ++ else ++ elfcpp::Swap<64, false>::writeval(buf, value); ++ } ++ else ++ { ++ // We will have already complained about this. ++ } ++} ++ ++// Handle the .note.gnu.property section at layout time. ++ ++void ++Layout::layout_gnu_property(unsigned int note_type, ++ unsigned int pr_type, ++ size_t pr_datasz, ++ const unsigned char* pr_data, ++ const Object* object) ++{ ++ // We currently support only the one note type. ++ gold_assert(note_type == elfcpp::NT_GNU_PROPERTY_TYPE_0); ++ ++ if (pr_type >= elfcpp::GNU_PROPERTY_LOPROC ++ && pr_type < elfcpp::GNU_PROPERTY_HIPROC) ++ { ++ // Target-dependent property value; call the target to record. ++ const int size = parameters->target().get_size(); ++ const bool is_big_endian = parameters->target().is_big_endian(); ++ if (size == 32) ++ { ++ if (is_big_endian) ++ { ++#ifdef HAVE_TARGET_32_BIG ++ parameters->sized_target<32, true>()-> ++ record_gnu_property(note_type, pr_type, pr_datasz, pr_data, ++ object); ++#else ++ gold_unreachable(); ++#endif ++ } ++ else ++ { ++#ifdef HAVE_TARGET_32_LITTLE ++ parameters->sized_target<32, false>()-> ++ record_gnu_property(note_type, pr_type, pr_datasz, pr_data, ++ object); ++#else ++ gold_unreachable(); ++#endif ++ } ++ } ++ else if (size == 64) ++ { ++ if (is_big_endian) ++ { ++#ifdef HAVE_TARGET_64_BIG ++ parameters->sized_target<64, true>()-> ++ record_gnu_property(note_type, pr_type, pr_datasz, pr_data, ++ object); ++#else ++ gold_unreachable(); ++#endif ++ } ++ else ++ { ++#ifdef HAVE_TARGET_64_LITTLE ++ parameters->sized_target<64, false>()-> ++ record_gnu_property(note_type, pr_type, pr_datasz, pr_data, ++ object); ++#else ++ gold_unreachable(); ++#endif ++ } ++ } ++ else ++ gold_unreachable(); ++ return; ++ } ++ ++ Gnu_properties::iterator pprop = this->gnu_properties_.find(pr_type); ++ if (pprop == this->gnu_properties_.end()) ++ { ++ Gnu_property prop; ++ prop.pr_datasz = pr_datasz; ++ prop.pr_data = new unsigned char[pr_datasz]; ++ memcpy(prop.pr_data, pr_data, pr_datasz); ++ this->gnu_properties_[pr_type] = prop; ++ } ++ else ++ { ++ const bool is_big_endian = parameters->target().is_big_endian(); ++ switch (pr_type) ++ { ++ case elfcpp::GNU_PROPERTY_STACK_SIZE: ++ // Record the maximum value seen. ++ { ++ uint64_t val1 = read_sized_value(pprop->second.pr_datasz, ++ pprop->second.pr_data, ++ is_big_endian, object); ++ uint64_t val2 = read_sized_value(pr_datasz, pr_data, ++ is_big_endian, object); ++ if (val2 > val1) ++ write_sized_value(val2, pprop->second.pr_datasz, ++ pprop->second.pr_data, is_big_endian); ++ } ++ break; ++ case elfcpp::GNU_PROPERTY_NO_COPY_ON_PROTECTED: ++ // No data to merge. ++ break; ++ default: ++ gold_warning(_("%s: unknown program property type %d " ++ "in .note.gnu.property section"), ++ object->name().c_str(), pr_type); ++ } ++ } ++} ++ ++// Merge per-object properties with program properties. ++// This lets the target identify objects that are missing certain ++// properties, in cases where properties must be ANDed together. ++ ++void ++Layout::merge_gnu_properties(const Object* object) ++{ ++ const int size = parameters->target().get_size(); ++ const bool is_big_endian = parameters->target().is_big_endian(); ++ if (size == 32) ++ { ++ if (is_big_endian) ++ { ++#ifdef HAVE_TARGET_32_BIG ++ parameters->sized_target<32, true>()->merge_gnu_properties(object); ++#else ++ gold_unreachable(); ++#endif ++ } ++ else ++ { ++#ifdef HAVE_TARGET_32_LITTLE ++ parameters->sized_target<32, false>()->merge_gnu_properties(object); ++#else ++ gold_unreachable(); ++#endif ++ } ++ } ++ else if (size == 64) ++ { ++ if (is_big_endian) ++ { ++#ifdef HAVE_TARGET_64_BIG ++ parameters->sized_target<64, true>()->merge_gnu_properties(object); ++#else ++ gold_unreachable(); ++#endif ++ } ++ else ++ { ++#ifdef HAVE_TARGET_64_LITTLE ++ parameters->sized_target<64, false>()->merge_gnu_properties(object); ++#else ++ gold_unreachable(); ++#endif ++ } ++ } ++ else ++ gold_unreachable(); ++} ++ ++// Add a target-specific property for the output .note.gnu.property section. ++ ++void ++Layout::add_gnu_property(unsigned int note_type, ++ unsigned int pr_type, ++ size_t pr_datasz, ++ const unsigned char* pr_data) ++{ ++ gold_assert(note_type == elfcpp::NT_GNU_PROPERTY_TYPE_0); ++ ++ Gnu_property prop; ++ prop.pr_datasz = pr_datasz; ++ prop.pr_data = new unsigned char[pr_datasz]; ++ memcpy(prop.pr_data, pr_data, pr_datasz); ++ this->gnu_properties_[pr_type] = prop; ++} ++ + // Create automatic note sections. + + void + Layout::create_notes() + { ++ this->create_gnu_properties_note(); + this->create_gold_note(); + this->create_stack_segment(); + this->create_build_id(); +@@ -3010,6 +3243,58 @@ Layout::create_note(const char* name, in + return os; + } + ++// Create a .note.gnu.property section to record program properties ++// accumulated from the input files. ++ ++void ++Layout::create_gnu_properties_note() ++{ ++ parameters->target().finalize_gnu_properties(this); ++ ++ if (this->gnu_properties_.empty()) ++ return; ++ ++ const unsigned int size = parameters->target().get_size(); ++ const bool is_big_endian = parameters->target().is_big_endian(); ++ ++ // Compute the total size of the properties array. ++ size_t descsz = 0; ++ for (Gnu_properties::const_iterator prop = this->gnu_properties_.begin(); ++ prop != this->gnu_properties_.end(); ++ ++prop) ++ { ++ descsz = align_address(descsz + 8 + prop->second.pr_datasz, size / 8); ++ } ++ ++ // Create the note section. ++ size_t trailing_padding; ++ Output_section* os = this->create_note("GNU", elfcpp::NT_GNU_PROPERTY_TYPE_0, ++ ".note.gnu.property", descsz, ++ true, &trailing_padding); ++ if (os == NULL) ++ return; ++ gold_assert(trailing_padding == 0); ++ ++ // Allocate and fill the properties array. ++ unsigned char* desc = new unsigned char[descsz]; ++ unsigned char* p = desc; ++ for (Gnu_properties::const_iterator prop = this->gnu_properties_.begin(); ++ prop != this->gnu_properties_.end(); ++ ++prop) ++ { ++ size_t datasz = prop->second.pr_datasz; ++ size_t aligned_datasz = align_address(prop->second.pr_datasz, size / 8); ++ write_sized_value(prop->first, 4, p, is_big_endian); ++ write_sized_value(datasz, 4, p + 4, is_big_endian); ++ memcpy(p + 8, prop->second.pr_data, datasz); ++ if (aligned_datasz > datasz) ++ memset(p + 8 + datasz, 0, aligned_datasz - datasz); ++ p += 8 + aligned_datasz; ++ } ++ Output_section_data* posd = new Output_data_const(desc, descsz, 4); ++ os->add_output_section_data(posd); ++} ++ + // For an executable or shared library, create a note to record the + // version of gold used to create the binary. + +Only in binutils-2.30/gold: layout.cc.orig +diff -rup binutils.orig/gold/layout.h binutils-2.30/gold/layout.h +--- binutils.orig/gold/layout.h 2018-08-14 16:18:17.926466993 +0100 ++++ binutils-2.30/gold/layout.h 2018-08-14 16:23:15.811244776 +0100 +@@ -680,6 +680,25 @@ class Layout + layout_gnu_stack(bool seen_gnu_stack, uint64_t gnu_stack_flags, + const Object*); + ++ // Layout a .note.gnu.property section. ++ void ++ layout_gnu_property(unsigned int note_type, ++ unsigned int pr_type, ++ size_t pr_datasz, ++ const unsigned char* pr_data, ++ const Object* object); ++ ++ // Merge per-object properties with program properties. ++ void ++ merge_gnu_properties(const Object* object); ++ ++ // Add a target-specific property for the output .note.gnu.property section. ++ void ++ add_gnu_property(unsigned int note_type, ++ unsigned int pr_type, ++ size_t pr_datasz, ++ const unsigned char* pr_data); ++ + // Add an Output_section_data to the layout. This is used for + // special sections like the GOT section. ORDER is where the + // section should wind up in the output segment. IS_RELRO is true +@@ -1040,6 +1059,10 @@ class Layout + create_note(const char* name, int note_type, const char* section_name, + size_t descsz, bool allocate, size_t* trailing_padding); + ++ // Create a note section for gnu program properties. ++ void ++ create_gnu_properties_note(); ++ + // Create a note section for gold version. + void + create_gold_note(); +@@ -1326,6 +1349,14 @@ class Layout + std::vector section_infos_; + }; + ++ // Program properties from .note.gnu.property sections. ++ struct Gnu_property ++ { ++ size_t pr_datasz; ++ unsigned char* pr_data; ++ }; ++ typedef std::map Gnu_properties; ++ + // The number of input files, for sizing tables. + int number_of_input_files_; + // Information set by scripts or by command line options. +@@ -1452,6 +1483,8 @@ class Layout + Incremental_binary* incremental_base_; + // For incremental links, a list of free space within the file. + Free_list free_list_; ++ // Program properties. ++ Gnu_properties gnu_properties_; + }; + + // This task handles writing out data in output sections which is not +Only in binutils-2.30/gold: layout.h.orig +diff -rup binutils.orig/gold/object.cc binutils-2.30/gold/object.cc +--- binutils.orig/gold/object.cc 2018-08-14 16:18:17.929466971 +0100 ++++ binutils-2.30/gold/object.cc 2018-08-14 16:23:15.812244769 +0100 +@@ -1313,6 +1313,102 @@ Sized_relobj_file::lay + this->set_relocs_must_follow_section_writes(); + } + ++// Layout an input .note.gnu.property section. ++ ++// This note section has an *extremely* non-standard layout. ++// The gABI spec says that ELF-64 files should have 8-byte fields and ++// 8-byte alignment in the note section, but the Gnu tools generally ++// use 4-byte fields and 4-byte alignment (see the comment for ++// Layout::create_note). This section uses 4-byte fields (i.e., ++// namesz, descsz, and type are always 4 bytes), the name field is ++// padded to a multiple of 4 bytes, but the desc field is padded ++// to a multiple of 4 or 8 bytes, depending on the ELF class. ++// The individual properties within the desc field always use ++// 4-byte pr_type and pr_datasz fields, but pr_data is padded to ++// a multiple of 4 or 8 bytes, depending on the ELF class. ++ ++template ++void ++Sized_relobj_file::layout_gnu_property_section( ++ Layout* layout, ++ unsigned int shndx) ++{ ++ section_size_type contents_len; ++ const unsigned char* pcontents = this->section_contents(shndx, ++ &contents_len, ++ false); ++ const unsigned char* pcontents_end = pcontents + contents_len; ++ ++ // Loop over all the notes in this section. ++ while (pcontents < pcontents_end) ++ { ++ if (pcontents + 16 > pcontents_end) ++ { ++ gold_warning(_("%s: corrupt .note.gnu.property section " ++ "(note too short)"), ++ this->name().c_str()); ++ return; ++ } ++ ++ size_t namesz = elfcpp::Swap<32, big_endian>::readval(pcontents); ++ size_t descsz = elfcpp::Swap<32, big_endian>::readval(pcontents + 4); ++ unsigned int ntype = elfcpp::Swap<32, big_endian>::readval(pcontents + 8); ++ const unsigned char* pname = pcontents + 12; ++ ++ if (namesz != 4 || strcmp(reinterpret_cast(pname), "GNU") != 0) ++ { ++ gold_warning(_("%s: corrupt .note.gnu.property section " ++ "(name is not 'GNU')"), ++ this->name().c_str()); ++ return; ++ } ++ ++ if (ntype != elfcpp::NT_GNU_PROPERTY_TYPE_0) ++ { ++ gold_warning(_("%s: unsupported note type %d " ++ "in .note.gnu.property section"), ++ this->name().c_str(), ntype); ++ return; ++ } ++ ++ size_t aligned_namesz = align_address(namesz, 4); ++ const unsigned char* pdesc = pname + aligned_namesz; ++ ++ if (pdesc + descsz > pcontents + contents_len) ++ { ++ gold_warning(_("%s: corrupt .note.gnu.property section"), ++ this->name().c_str()); ++ return; ++ } ++ ++ const unsigned char* pprop = pdesc; ++ ++ // Loop over the program properties in this note. ++ while (pprop < pdesc + descsz) ++ { ++ if (pprop + 8 > pdesc + descsz) ++ { ++ gold_warning(_("%s: corrupt .note.gnu.property section"), ++ this->name().c_str()); ++ return; ++ } ++ unsigned int pr_type = elfcpp::Swap<32, big_endian>::readval(pprop); ++ size_t pr_datasz = elfcpp::Swap<32, big_endian>::readval(pprop + 4); ++ pprop += 8; ++ if (pprop + pr_datasz > pdesc + descsz) ++ { ++ gold_warning(_("%s: corrupt .note.gnu.property section"), ++ this->name().c_str()); ++ return; ++ } ++ layout->layout_gnu_property(ntype, pr_type, pr_datasz, pprop, this); ++ pprop += align_address(pr_datasz, size / 8); ++ } ++ ++ pcontents = pdesc + align_address(descsz, size / 8); ++ } ++} ++ + // Lay out the input sections. We walk through the sections and check + // whether they should be included in the link. If they should, we + // pass them to the Layout object, which will return an output section +@@ -1565,6 +1661,14 @@ Sized_relobj_file::do_ + omit[i] = true; + } + ++ // Handle .note.gnu.property sections. ++ if (sh_type == elfcpp::SHT_NOTE ++ && strcmp(name, ".note.gnu.property") == 0) ++ { ++ this->layout_gnu_property_section(layout, i); ++ omit[i] = true; ++ } ++ + bool discard = omit[i]; + if (!discard) + { +@@ -1781,7 +1885,10 @@ Sized_relobj_file::do_ + } + + if (!is_pass_two) +- layout->layout_gnu_stack(seen_gnu_stack, gnu_stack_flags, this); ++ { ++ layout->merge_gnu_properties(this); ++ layout->layout_gnu_stack(seen_gnu_stack, gnu_stack_flags, this); ++ } + + // Handle the .eh_frame sections after the other sections. + gold_assert(!is_pass_one || eh_frame_sections.empty()); +Only in binutils-2.30/gold: object.cc.orig +diff -rup binutils.orig/gold/object.h binutils-2.30/gold/object.h +--- binutils.orig/gold/object.h 2018-08-14 16:18:17.926466993 +0100 ++++ binutils-2.30/gold/object.h 2018-08-14 16:18:47.793244187 +0100 +@@ -2647,6 +2647,10 @@ class Sized_relobj_file : public Sized_r + unsigned int shndx, const typename This::Shdr&, + unsigned int reloc_shndx, unsigned int reloc_type); + ++ // Layout an input .note.gnu.property section. ++ void ++ layout_gnu_property_section(Layout* layout, unsigned int shndx); ++ + // Write section data to the output file. Record the views and + // sizes in VIEWS for use when relocating. + void +Only in binutils-2.30/gold: object.h.orig +diff -rup binutils.orig/gold/target.h binutils-2.30/gold/target.h +--- binutils.orig/gold/target.h 2018-08-14 16:18:17.928466978 +0100 ++++ binutils-2.30/gold/target.h 2018-08-14 16:23:15.812244769 +0100 +@@ -504,6 +504,11 @@ class Target + should_include_section(elfcpp::Elf_Word sh_type) const + { return this->do_should_include_section(sh_type); } + ++ // Finalize the target-specific properties in the .note.gnu.property section. ++ void ++ finalize_gnu_properties(Layout* layout) const ++ { this->do_finalize_gnu_properties(layout); } ++ + protected: + // This struct holds the constant information for a child class. We + // use a struct to avoid the overhead of virtual function calls for +@@ -807,6 +812,11 @@ class Target + do_should_include_section(elfcpp::Elf_Word) const + { return true; } + ++ // Finalize the target-specific properties in the .note.gnu.property section. ++ virtual void ++ do_finalize_gnu_properties(Layout*) const ++ { } ++ + private: + // The implementations of the four do_make_elf_object virtual functions are + // almost identical except for their sizes and endianness. We use a template. +@@ -1126,6 +1136,17 @@ class Sized_target : public Target + return elfcpp::elf_r_sym(rel.get_r_info()); + } + ++ // Record a target-specific program property in the .note.gnu.property ++ // section. ++ virtual void ++ record_gnu_property(int, int, size_t, const unsigned char*, const Object*) ++ { } ++ ++ // Merge the target-specific program properties from the current object. ++ virtual void ++ merge_gnu_properties(const Object*) ++ { } ++ + protected: + Sized_target(const Target::Target_info* pti) + : Target(pti) +Only in binutils-2.30/gold: target.h.orig +Only in binutils-2.30/gold/testsuite: gnu_property_a.S +Only in binutils-2.30/gold/testsuite: gnu_property_b.S +Only in binutils-2.30/gold/testsuite: gnu_property_c.S +Only in binutils-2.30/gold/testsuite: gnu_property_main.c +Only in binutils-2.30/gold/testsuite: gnu_property_test.sh +diff -rup binutils.orig/gold/testsuite/Makefile.am binutils-2.30/gold/testsuite/Makefile.am +--- binutils.orig/gold/testsuite/Makefile.am 2018-08-14 16:18:17.930466963 +0100 ++++ binutils-2.30/gold/testsuite/Makefile.am 2018-08-14 16:23:15.812244769 +0100 +@@ -3121,6 +3121,23 @@ exception_x86_64_bnd_2.o: exception_test + $(CXXCOMPILE) -c -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $< + endif DEFAULT_TARGET_X86_64 + ++if DEFAULT_TARGET_X86_64 ++check_SCRIPTS += gnu_property_test.sh ++check_DATA += gnu_property_test.stdout ++gnu_property_test.stdout: gnu_property_test ++ $(TEST_READELF) -n $< >$@ ++gnu_property_test: gcctestdir/ld gnu_property_a.o gnu_property_b.o gnu_property_c.o ++ gcctestdir/ld -o $@ gnu_property_a.o gnu_property_b.o gnu_property_c.o ++gnu_property_main.o: gnu_property_main.c ++ $(COMPILE) -c -o $@ $< ++gnu_property_a.o: gnu_property_a.S ++ $(COMPILE) -c -o $@ $< ++gnu_property_b.o: gnu_property_b.S ++ $(COMPILE) -c -o $@ $< ++gnu_property_c.o: gnu_property_c.S ++ $(COMPILE) -c -o $@ $< ++endif DEFAULT_TARGET_X86_64 ++ + check_PROGRAMS += pr22266 + pr22266: pr22266_main.o pr22266_ar.o gcctestdir/ld + $(LINK) -Bgcctestdir/ pr22266_main.o pr22266_ar.o +Only in binutils-2.30/gold/testsuite: Makefile.am.orig +diff -rup binutils.orig/gold/testsuite/Makefile.in binutils-2.30/gold/testsuite/Makefile.in +--- binutils.orig/gold/testsuite/Makefile.in 2018-08-14 16:18:17.939466896 +0100 ++++ binutils-2.30/gold/testsuite/Makefile.in 2018-08-14 16:23:15.813244761 +0100 +@@ -814,28 +814,30 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_tmp_4.o \ + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_5.a \ + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_6.a +-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_84 = pr22266 ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_84 = gnu_property_test.sh ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_85 = gnu_property_test.stdout ++@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_86 = pr22266 + + # These tests work with native and cross linkers. + + # Test script section order. +-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_85 = script_test_10.sh +-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_86 = script_test_10.stdout +-@NATIVE_OR_CROSS_LINKER_TRUE@am__append_87 = script_test_10 ++@NATIVE_OR_CROSS_LINKER_TRUE@am__append_87 = script_test_10.sh ++@NATIVE_OR_CROSS_LINKER_TRUE@am__append_88 = script_test_10.stdout ++@NATIVE_OR_CROSS_LINKER_TRUE@am__append_89 = script_test_10 + + # These tests work with cross linkers only. +-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_88 = split_i386.sh +-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_89 = split_i386_1.stdout split_i386_2.stdout \ ++@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_90 = split_i386.sh ++@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_91 = split_i386_1.stdout split_i386_2.stdout \ + @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout + +-@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_90 = split_i386_1 split_i386_2 split_i386_3 \ ++@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_92 = split_i386_1 split_i386_2 split_i386_3 \ + @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_4 split_i386_r + +-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_91 = split_x86_64.sh \ ++@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_93 = split_x86_64.sh \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_plt_1.sh \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_1.sh \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_2.sh +-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_92 = split_x86_64_1.stdout \ ++@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_94 = split_x86_64_1.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_2.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_3.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_4.stdout \ +@@ -843,14 +845,14 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_plt_1.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_1.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ bnd_ifunc_2.stdout +-@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_93 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \ ++@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_95 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \ + @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_4 split_x86_64_r + +-@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_94 = split_x32.sh +-@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_95 = split_x32_1.stdout split_x32_2.stdout \ ++@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_96 = split_x32.sh ++@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_97 = split_x32_1.stdout split_x32_2.stdout \ + @DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x32_3.stdout split_x32_4.stdout split_x32_r.stdout + +-@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_96 = split_x32_1 split_x32_2 split_x32_3 \ ++@DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_98 = split_x32_1 split_x32_2 split_x32_3 \ + @DEFAULT_TARGET_X32_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x32_4 split_x32_r + + +@@ -871,7 +873,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + # Check Thumb to ARM farcall veneers + + # Check handling of --target1-abs, --target1-rel and --target2 options +-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_97 = arm_abs_global.sh \ ++@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_99 = arm_abs_global.sh \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_in_range.sh \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_out_of_range.sh \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_fix_v4bx.sh \ +@@ -894,7 +896,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_got_rel.sh + + # The test demonstrates why the constructor of a target object should not access options. +-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_98 = arm_abs_global.stdout \ ++@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_100 = arm_abs_global.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range.stdout \ +@@ -947,7 +949,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_abs.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_got_rel.stdout \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target_lazy_init +-@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_99 = arm_abs_global \ ++@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_101 = arm_abs_global \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range \ +@@ -998,20 +1000,20 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_abs \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target2_got_rel \ + @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_target_lazy_init +-@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_100 = aarch64_reloc_none.sh \ ++@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_102 = aarch64_reloc_none.sh \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_relocs.sh \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr21430.sh \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_tlsdesc.sh +-@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_101 = aarch64_reloc_none.stdout \ ++@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_103 = aarch64_reloc_none.stdout \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_relocs.stdout \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr21430.stdout \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_tlsdesc.stdout +-@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_102 = aarch64_reloc_none \ ++@DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_104 = aarch64_reloc_none \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_relocs \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr21430 \ + @DEFAULT_TARGET_AARCH64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ aarch64_tlsdesc +-@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_103 = split_s390.sh +-@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_104 = split_s390_z1.stdout split_s390_z2.stdout split_s390_z3.stdout \ ++@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_105 = split_s390.sh ++@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_106 = split_s390_z1.stdout split_s390_z2.stdout split_s390_z3.stdout \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z4.stdout split_s390_n1.stdout split_s390_n2.stdout \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_a1.stdout split_s390_a2.stdout split_s390_z1_ns.stdout \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z2_ns.stdout split_s390_z3_ns.stdout split_s390_z4_ns.stdout \ +@@ -1023,7 +1025,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_z4_ns.stdout split_s390x_n1_ns.stdout \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_n2_ns.stdout split_s390x_r.stdout + +-@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_105 = split_s390_z1 split_s390_z2 split_s390_z3 \ ++@DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_107 = split_s390_z1 split_s390_z2 split_s390_z3 \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z4 split_s390_n1 split_s390_n2 split_s390_a1 \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_a2 split_s390_z1_ns split_s390_z2_ns split_s390_z3_ns \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390_z4_ns split_s390_n1_ns split_s390_n2_ns split_s390_r \ +@@ -1032,10 +1034,10 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__E + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_z1_ns split_s390x_z2_ns split_s390x_z3_ns \ + @DEFAULT_TARGET_S390_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_s390x_z4_ns split_s390x_n1_ns split_s390x_n2_ns split_s390x_r + +-@DEFAULT_TARGET_X86_64_TRUE@am__append_106 = *.dwo *.dwp +-@DEFAULT_TARGET_X86_64_TRUE@am__append_107 = dwp_test_1.sh \ ++@DEFAULT_TARGET_X86_64_TRUE@am__append_108 = *.dwo *.dwp ++@DEFAULT_TARGET_X86_64_TRUE@am__append_109 = dwp_test_1.sh \ + @DEFAULT_TARGET_X86_64_TRUE@ dwp_test_2.sh +-@DEFAULT_TARGET_X86_64_TRUE@am__append_108 = dwp_test_1.stdout \ ++@DEFAULT_TARGET_X86_64_TRUE@am__append_110 = dwp_test_1.stdout \ + @DEFAULT_TARGET_X86_64_TRUE@ dwp_test_2.stdout + subdir = testsuite + DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +@@ -2828,9 +2830,9 @@ MOSTLYCLEANFILES = *.so *.syms *.stdout + $(am__append_34) $(am__append_37) $(am__append_41) \ + $(am__append_47) $(am__append_51) $(am__append_52) \ + $(am__append_58) $(am__append_78) $(am__append_81) \ +- $(am__append_83) $(am__append_87) $(am__append_90) \ +- $(am__append_93) $(am__append_96) $(am__append_99) \ +- $(am__append_102) $(am__append_105) $(am__append_106) ++ $(am__append_83) $(am__append_89) $(am__append_92) \ ++ $(am__append_95) $(am__append_98) $(am__append_101) \ ++ $(am__append_104) $(am__append_107) $(am__append_108) + + # We will add to these later, for each individual test. Note + # that we add each test under check_SCRIPTS or check_PROGRAMS; +@@ -2839,18 +2841,18 @@ check_SCRIPTS = $(am__append_2) $(am__ap + $(am__append_29) $(am__append_35) $(am__append_42) \ + $(am__append_45) $(am__append_49) $(am__append_53) \ + $(am__append_56) $(am__append_62) $(am__append_73) \ +- $(am__append_76) $(am__append_79) $(am__append_85) \ +- $(am__append_88) $(am__append_91) $(am__append_94) \ +- $(am__append_97) $(am__append_100) $(am__append_103) \ +- $(am__append_107) ++ $(am__append_76) $(am__append_79) $(am__append_84) \ ++ $(am__append_87) $(am__append_90) $(am__append_93) \ ++ $(am__append_96) $(am__append_99) $(am__append_102) \ ++ $(am__append_105) $(am__append_109) + check_DATA = $(am__append_3) $(am__append_20) $(am__append_24) \ + $(am__append_30) $(am__append_36) $(am__append_43) \ + $(am__append_46) $(am__append_50) $(am__append_54) \ + $(am__append_57) $(am__append_63) $(am__append_74) \ +- $(am__append_77) $(am__append_80) $(am__append_86) \ +- $(am__append_89) $(am__append_92) $(am__append_95) \ +- $(am__append_98) $(am__append_101) $(am__append_104) \ +- $(am__append_108) ++ $(am__append_77) $(am__append_80) $(am__append_85) \ ++ $(am__append_88) $(am__append_91) $(am__append_94) \ ++ $(am__append_97) $(am__append_100) $(am__append_103) \ ++ $(am__append_106) $(am__append_110) + BUILT_SOURCES = $(am__append_40) + TESTS = $(check_SCRIPTS) $(check_PROGRAMS) + +@@ -5737,6 +5739,8 @@ exception_x86_64_bnd_test.log: exception + @p='exception_x86_64_bnd_test$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) + pr22266.log: pr22266$(EXEEXT) + @p='pr22266$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) ++gnu_property_test.sh.log: gnu_property_test.sh ++ @p='gnu_property_test.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) + .test.log: + @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post) + @am__EXEEXT_TRUE@.test$(EXEEXT).log: +@@ -7394,6 +7403,18 @@ uninstall-am: + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $< + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $< ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_test.stdout: gnu_property_test ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -n $< >$@ ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_test: gcctestdir/ld gnu_property_a.o gnu_property_b.o gnu_property_c.o ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -o $@ gnu_property_a.o gnu_property_b.o gnu_property_c.o ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_main.o: gnu_property_main.c ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $< ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_a.o: gnu_property_a.S ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $< ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_b.o: gnu_property_b.S ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $< ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@gnu_property_c.o: gnu_property_c.S ++@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $< + @GCC_TRUE@@NATIVE_LINKER_TRUE@pr22266: pr22266_main.o pr22266_ar.o gcctestdir/ld + @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ pr22266_main.o pr22266_ar.o + @GCC_TRUE@@NATIVE_LINKER_TRUE@pr22266_ar.o: pr22266_a.o gcctestdir/ld +Only in binutils-2.30/gold/testsuite: Makefile.in.orig +Only in binutils-2.30/gold/testsuite: Makefile.in.rej +diff -rup binutils.orig/gold/x86_64.cc binutils-2.30/gold/x86_64.cc +--- binutils.orig/gold/x86_64.cc 2018-08-14 16:18:17.926466993 +0100 ++++ binutils-2.30/gold/x86_64.cc 2018-08-14 16:23:26.758163112 +0100 +@@ -590,7 +590,8 @@ class Target_x86_64 : public Sized_targe + got_tlsdesc_(NULL), global_offset_table_(NULL), rela_dyn_(NULL), + rela_irelative_(NULL), copy_relocs_(elfcpp::R_X86_64_COPY), + got_mod_index_offset_(-1U), tlsdesc_reloc_info_(), +- tls_base_symbol_defined_(false) ++ tls_base_symbol_defined_(false), isa_1_used_(0), isa_1_needed_(0), ++ feature_1_(0), object_feature_1_(0), seen_first_object_(false) + { } + + // Hook for a new output section. +@@ -1188,6 +1189,20 @@ class Target_x86_64 : public Sized_targe + this->rela_dyn_section(layout)); + } + ++ // Record a target-specific program property in the .note.gnu.property ++ // section. ++ void ++ record_gnu_property(int, int, size_t, const unsigned char*, const Object*); ++ ++ // Merge the target-specific program properties from the current object. ++ void ++ merge_gnu_properties(const Object*); ++ ++ // Finalize the target-specific program properties and add them back to ++ // the layout. ++ void ++ do_finalize_gnu_properties(Layout*) const; ++ + // Information about this specific target which we pass to the + // general Target structure. + static const Target::Target_info x86_64_info; +@@ -1245,6 +1260,17 @@ class Target_x86_64 : public Sized_targe + std::vector tlsdesc_reloc_info_; + // True if the _TLS_MODULE_BASE_ symbol has been defined. + bool tls_base_symbol_defined_; ++ // Target-specific program properties, from .note.gnu.property section. ++ // Each bit represents a specific feature. ++ uint32_t isa_1_used_; ++ uint32_t isa_1_needed_; ++ uint32_t feature_1_; ++ // Target-specific properties from the current object. ++ // These bits get ANDed into FEATURE_1_ after all properties for the object ++ // have been processed. ++ uint32_t object_feature_1_; ++ // Whether we have seen our first object, for use in initializing FEATURE_1_. ++ bool seen_first_object_; + }; + + template<> +@@ -1431,6 +1457,93 @@ Target_x86_64::rela_irelative_sect + return this->rela_irelative_; + } + ++// Record a target-specific program property from the .note.gnu.property ++// section. ++template ++void ++Target_x86_64::record_gnu_property( ++ int, int pr_type, ++ size_t pr_datasz, const unsigned char* pr_data, ++ const Object* object) ++{ ++ uint32_t val = 0; ++ ++ switch (pr_type) ++ { ++ case elfcpp::GNU_PROPERTY_X86_ISA_1_USED: ++ case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED: ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND: ++ if (pr_datasz != 4) ++ { ++ gold_warning(_("%s: corrupt .note.gnu.property section " ++ "(pr_datasz for property %d is not 4)"), ++ object->name().c_str(), pr_type); ++ return; ++ } ++ val = elfcpp::Swap<32, false>::readval(pr_data); ++ break; ++ default: ++ gold_warning(_("%s: unknown program property type 0x%x " ++ "in .note.gnu.property section"), ++ object->name().c_str(), pr_type); ++ break; ++ } ++ ++ switch (pr_type) ++ { ++ case elfcpp::GNU_PROPERTY_X86_ISA_1_USED: ++ this->isa_1_used_ |= val; ++ break; ++ case elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED: ++ this->isa_1_needed_ |= val; ++ break; ++ case elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND: ++ // If we see multiple feature props in one object, OR them together. ++ this->object_feature_1_ |= val; ++ break; ++ } ++} ++ ++// Merge the target-specific program properties from the current object. ++template ++void ++Target_x86_64::merge_gnu_properties(const Object*) ++{ ++ if (this->seen_first_object_) ++ this->feature_1_ &= this->object_feature_1_; ++ else ++ { ++ this->feature_1_ = this->object_feature_1_; ++ this->seen_first_object_ = true; ++ } ++ this->object_feature_1_ = 0; ++} ++ ++static inline void ++add_property(Layout* layout, unsigned int pr_type, uint32_t val) ++{ ++ unsigned char buf[4]; ++ elfcpp::Swap<32, false>::writeval(buf, val); ++ layout->add_gnu_property(elfcpp::NT_GNU_PROPERTY_TYPE_0, pr_type, 4, buf); ++} ++ ++// Finalize the target-specific program properties and add them back to ++// the layout. ++template ++void ++Target_x86_64::do_finalize_gnu_properties(Layout* layout) const ++{ ++ if (this->isa_1_used_ != 0) ++ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_USED, ++ this->isa_1_used_); ++ if (this->isa_1_needed_ != 0) ++ add_property(layout, elfcpp::GNU_PROPERTY_X86_ISA_1_NEEDED, ++ this->isa_1_needed_); ++ if (this->feature_1_ != 0) ++ add_property(layout, elfcpp::GNU_PROPERTY_X86_FEATURE_1_AND, ++ this->feature_1_); ++} ++ + // Write the first three reserved words of the .got.plt section. + // The remainder of the section is written while writing the PLT + // in Output_data_plt_i386::do_write. +Only in binutils-2.30/gold: x86_64.cc.orig +--- /dev/null 2018-08-14 08:11:42.835432884 +0100 ++++ binutils-2.30/gold/testsuite/gnu_property_a.S 2018-08-14 16:23:15.813244761 +0100 +@@ -0,0 +1,46 @@ ++#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_FEATURE_1_AND 0xc0000002 ++ ++#if __SIZEOF_PTRDIFF_T__ == 8 ++# define ALIGN 3 ++#elif __SIZEOF_PTRDIFF_T__ == 4 ++# define ALIGN 2 ++#endif ++ ++ .text ++ .globl _start ++_start: ++ ret ++ ++ .section ".note.gnu.property", "a" ++ .p2align ALIGN ++ ++ .long 1f - 0f /* name length */ ++ .long 5f - 2f /* data length */ ++ .long NT_GNU_PROPERTY_TYPE_0 /* note type */ ++0: .asciz "GNU" /* vendor name */ ++1: ++ .p2align ALIGN ++2: .long GNU_PROPERTY_STACK_SIZE /* pr_type. */ ++ .long 4f - 3f /* pr_datasz. */ ++3: ++ .dc.a 0x800 /* Stack size. */ ++4: ++ .p2align ALIGN ++ .long GNU_PROPERTY_X86_ISA_1_USED ++ .long 4 ++ .byte 0x01,0x10,0x00,0x00 ++ .p2align ALIGN ++ .long GNU_PROPERTY_X86_ISA_1_NEEDED ++ .long 4 ++ .byte 0x01,0x10,0x00,0x00 ++ .p2align ALIGN ++ .long GNU_PROPERTY_X86_FEATURE_1_AND ++ .long 4 ++ .byte 0x01,0x00,0x00,0x00 ++ .p2align ALIGN ++5: +--- /dev/null 2018-08-14 08:11:42.835432884 +0100 ++++ binutils-2.30/gold/testsuite/gnu_property_b.S 2018-08-14 16:18:47.795244173 +0100 +@@ -0,0 +1,38 @@ ++#define NT_GNU_PROPERTY_TYPE_0 5 ++ ++#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_FEATURE_1_AND 0xc0000002 ++ ++#if __SIZEOF_PTRDIFF_T__ == 8 ++# define ALIGN 3 ++#elif __SIZEOF_PTRDIFF_T__ == 4 ++# define ALIGN 2 ++#endif ++ ++ .section ".note.gnu.property", "a" ++ .p2align ALIGN ++ .long 1f - 0f /* name length */ ++ .long 3f - 2f /* data length */ ++ .long NT_GNU_PROPERTY_TYPE_0 /* note type */ ++0: .asciz "GNU" /* vendor name */ ++1: ++ .p2align ALIGN ++2: .long GNU_PROPERTY_NO_COPY_ON_PROTECTED /* pr_type. */ ++ .long 0 /* pr_datasz. */ ++ .p2align ALIGN ++ .long GNU_PROPERTY_X86_ISA_1_USED ++ .long 4 ++ .byte 0x01,0x11,0x00,0x00 ++ .p2align ALIGN ++ .long GNU_PROPERTY_X86_ISA_1_NEEDED ++ .long 4 ++ .byte 0x01,0x11,0x00,0x00 ++ .p2align ALIGN ++ .long GNU_PROPERTY_X86_FEATURE_1_AND ++ .long 4 ++ .byte 0x03,0x00,0x00,0x00 ++ .p2align ALIGN ++3: +--- /dev/null 2018-08-14 08:11:42.835432884 +0100 ++++ binutils-2.30/gold/testsuite/gnu_property_c.S 2018-08-14 16:18:47.795244173 +0100 +@@ -0,0 +1,44 @@ ++#define NT_GNU_PROPERTY_TYPE_0 5 ++ ++#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_FEATURE_1_AND 0xc0000002 ++ ++#if __SIZEOF_PTRDIFF_T__ == 8 ++# define ALIGN 3 ++#elif __SIZEOF_PTRDIFF_T__ == 4 ++# define ALIGN 2 ++#endif ++ ++ .section ".note.gnu.property", "a" ++ .p2align ALIGN ++ .long 1f - 0f /* name length */ ++ .long 5f - 2f /* data length */ ++ .long NT_GNU_PROPERTY_TYPE_0 /* note type */ ++0: .asciz "GNU" /* vendor name */ ++1: ++ .p2align ALIGN ++2: .long GNU_PROPERTY_STACK_SIZE /* pr_type. */ ++ .long 4f - 3f /* pr_datasz. */ ++3: ++ .dc.a 0x111100 /* Stack size. */ ++4: ++ .p2align ALIGN ++ .long GNU_PROPERTY_NO_COPY_ON_PROTECTED /* pr_type. */ ++ .long 0 /* pr_datasz. */ ++ .p2align ALIGN ++ .long GNU_PROPERTY_X86_ISA_1_USED ++ .long 4 ++ .byte 0x11,0x10,0x00,0x00 ++ .p2align ALIGN ++ .long GNU_PROPERTY_X86_ISA_1_NEEDED ++ .long 4 ++ .byte 0x11,0x10,0x00,0x00 ++ .p2align ALIGN ++ .long GNU_PROPERTY_X86_FEATURE_1_AND ++ .long 4 ++ .byte 0x01,0x00,0x00,0x00 ++ .p2align ALIGN ++5: +--- /dev/null 2018-08-14 08:11:42.835432884 +0100 ++++ binutils-2.30/gold/testsuite/gnu_property_main.c 2018-08-14 16:18:47.795244173 +0100 +@@ -0,0 +1,5 @@ ++int ++main(void) ++{ ++ return 0; ++} +--- /dev/null 2018-08-14 08:11:42.835432884 +0100 ++++ binutils-2.30/gold/testsuite/gnu_property_test.sh 2018-08-14 16:18:47.795244173 +0100 +@@ -0,0 +1,64 @@ ++#!/bin/sh ++ ++# gnu_property_test.sh -- test .note.gnu.property section. ++ ++# Copyright (C) 2018 Free Software Foundation, Inc. ++# Written by Cary Coutant . ++ ++# This file is part of gold. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, ++# MA 02110-1301, USA. ++ ++# This script checks that after linking the three object files ++# gnu_property_[abc].S, each of which contains a .note.gnu.property ++# section, the resulting output has only a single such note section, ++# and that the properties have been correctly combined. ++ ++check() ++{ ++ if ! grep -q "$2" "$1" ++ then ++ echo "Did not find expected output in $1:" ++ echo " $2" ++ echo "" ++ echo "Actual output below:" ++ cat "$1" ++ exit 1 ++ fi ++} ++ ++check_count() ++{ ++ if test "`grep -c "$2" "$1"`" != "$3" ++ then ++ echo "Did not find correct number of note sections in $1:" ++ echo " $2" ++ echo "" ++ echo "Actual output below:" ++ cat "$1" ++ exit 1 ++ fi ++} ++ ++check_count gnu_property_test.stdout "GNU\s*0x[0-9a-f]*\s*NT_GNU_PROPERTY_TYPE_0" 1 ++ ++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 feature: IBT" ++ ++exit 0 +--- binutils.orig/elfcpp/elfcpp.h 2018-08-14 16:18:18.007466389 +0100 ++++ binutils-2.30/elfcpp/elfcpp.h 2018-08-14 16:36:27.151339505 +0100 +@@ -984,7 +984,9 @@ enum + NT_GNU_BUILD_ID = 3, + // The version of gold used to link. Th descriptor is just a + // string. +- NT_GNU_GOLD_VERSION = 4 ++ NT_GNU_GOLD_VERSION = 4, ++ // Program property note, as described in "Linux Extensions to the gABI". ++ NT_GNU_PROPERTY_TYPE_0 = 5 + }; + + // The OS values which may appear in word 0 of a NT_GNU_ABI_TAG note. +@@ -999,6 +1001,21 @@ enum + ELF_NOTE_OS_SYLLABLE = 5 + }; + ++// Program property types for NT_GNU_PROPERTY_TYPE_0. ++ ++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_HIPROC = 0xdfffffff, ++ GNU_PROPERTY_LOUSER = 0xe0000000, ++ GNU_PROPERTY_HIUSER = 0xffffffff ++}; ++ + } // End namespace elfcpp. + + // Include internal details after defining the types. +--- binutils.orig/elfcpp/x86_64.h 2018-08-14 16:18:18.006466396 +0100 ++++ binutils-2.30/elfcpp/x86_64.h 2018-08-14 16:36:55.838125405 +0100 +@@ -103,6 +103,12 @@ enum + R_X86_64_GNU_VTENTRY = 251 + }; + ++// The bit values that can appear in the GNU_PROPERTY_X86_FEATURE_1_AND ++// program property. ++ ++const uint64_t GNU_PROPERTY_X86_FEATURE_1_IBT = 1ULL << 0; ++const uint64_t GNU_PROPERTY_X86_FEATURE_1_SHSTK = 1ULL << 1; ++ + } // End namespace elfcpp. + + #endif // !defined(ELFCPP_X86_64_H) +--- binutils.orig/gold/object.cc 2018-08-14 16:43:20.553254144 +0100 ++++ binutils-2.30/gold/object.cc 2018-08-14 16:43:35.275144269 +0100 +@@ -1618,6 +1618,7 @@ Sized_relobj_file::do_ + for (unsigned int i = 1; i < shnum; ++i, pshdrs += This::shdr_size) + { + typename This::Shdr shdr(pshdrs); ++ unsigned int sh_type = shdr.get_sh_type(); + + if (shdr.get_sh_name() >= section_names_size) + { diff --git a/SOURCES/binutils-ifunc-relocs-in-notes.patch b/SOURCES/binutils-ifunc-relocs-in-notes.patch new file mode 100644 index 0000000..c31ef9f --- /dev/null +++ b/SOURCES/binutils-ifunc-relocs-in-notes.patch @@ -0,0 +1,296 @@ +diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.30/bfd/elf32-i386.c +--- binutils.orig/bfd/elf32-i386.c 2018-03-09 14:43:05.324208873 +0000 ++++ binutils-2.30/bfd/elf32-i386.c 2018-03-09 14:43:23.158000456 +0000 +@@ -2202,12 +2202,19 @@ elf_i386_relocate_section (bfd *output_b + + if ((input_section->flags & SEC_ALLOC) == 0) + { ++ /* If this is a SHT_NOTE section without SHF_ALLOC, treat ++ STT_GNU_IFUNC symbol as STT_FUNC. */ ++ if (elf_section_type (input_section) == SHT_NOTE) ++ goto skip_ifunc; + /* Dynamic relocs are not propagated for SEC_DEBUGGING + sections because such sections are not SEC_ALLOC and + thus ld.so will not process them. */ + if ((input_section->flags & SEC_DEBUGGING) != 0) + continue; +- abort (); ++ _bfd_error_handler (_("%B: error: relocation againt ifunc symbol in non-alloc section %A"), ++ input_bfd, input_section); ++ bfd_set_error (bfd_error_invalid_operation); ++ return FALSE; + } + + /* STT_GNU_IFUNC symbol must go through PLT. */ +@@ -2421,6 +2428,7 @@ do_ifunc_pointer: + } + } + ++ skip_ifunc: + resolved_to_zero = (eh != NULL + && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh)); + +diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.30/bfd/elf32-s390.c +--- binutils.orig/bfd/elf32-s390.c 2018-03-09 14:43:05.325208861 +0000 ++++ binutils-2.30/bfd/elf32-s390.c 2018-03-09 14:43:31.353904647 +0000 +@@ -2601,6 +2601,9 @@ elf_s390_relocate_section (bfd *output_b + case R_390_8: + case R_390_16: + case R_390_32: ++ if ((input_section->flags & SEC_ALLOC) == 0) ++ break; ++ + if (h != NULL + && s390_is_ifunc_symbol_p (h) + && h->def_regular) +@@ -2662,9 +2665,6 @@ elf_s390_relocate_section (bfd *output_b + } + } + +- if ((input_section->flags & SEC_ALLOC) == 0) +- break; +- + if ((bfd_link_pic (info) + && (h == NULL + || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT +Only in binutils-2.30/bfd: elf32-s390.c.orig +diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.30/bfd/elf64-s390.c +--- binutils.orig/bfd/elf64-s390.c 2018-03-09 14:43:05.341208674 +0000 ++++ binutils-2.30/bfd/elf64-s390.c 2018-03-09 14:43:31.354904635 +0000 +@@ -2559,6 +2559,9 @@ elf_s390_relocate_section (bfd *output_b + case R_390_32: + case R_390_64: + ++ if ((input_section->flags & SEC_ALLOC) == 0) ++ break; ++ + if (h != NULL + && s390_is_ifunc_symbol_p (h) + && h->def_regular) +@@ -2621,9 +2624,6 @@ elf_s390_relocate_section (bfd *output_b + } + } + +- if ((input_section->flags & SEC_ALLOC) == 0) +- break; +- + if ((bfd_link_pic (info) + && (h == NULL + || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT +Only in binutils-2.30/bfd: elf64-s390.c.orig +diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.30/bfd/elf64-x86-64.c +--- binutils.orig/bfd/elf64-x86-64.c 2018-03-09 14:43:05.344208639 +0000 ++++ binutils-2.30/bfd/elf64-x86-64.c 2018-03-09 14:43:23.161000420 +0000 +@@ -2499,12 +2499,19 @@ elf_x86_64_relocate_section (bfd *output + + if ((input_section->flags & SEC_ALLOC) == 0) + { ++ /* If this is a SHT_NOTE section without SHF_ALLOC, treat ++ STT_GNU_IFUNC symbol as STT_FUNC. */ ++ if (elf_section_type (input_section) == SHT_NOTE) ++ goto skip_ifunc; + /* Dynamic relocs are not propagated for SEC_DEBUGGING + sections because such sections are not SEC_ALLOC and + thus ld.so will not process them. */ + if ((input_section->flags & SEC_DEBUGGING) != 0) + continue; +- abort (); ++ _bfd_error_handler (_("%B: error: relocation againt ifunc symbol in non-alloc section %A"), ++ input_bfd, input_section); ++ bfd_set_error (bfd_error_invalid_operation); ++ return FALSE; + } + + switch (r_type) +@@ -2722,6 +2729,7 @@ do_ifunc_pointer: + } + } + ++ skip_ifunc: + resolved_to_zero = (eh != NULL + && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh)); + +diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.30/bfd/elfnn-aarch64.c +--- binutils.orig/bfd/elfnn-aarch64.c 2018-03-09 14:43:05.337208721 +0000 ++++ binutils-2.30/bfd/elfnn-aarch64.c 2018-03-09 14:43:31.355904624 +0000 +@@ -4987,6 +4987,11 @@ elfNN_aarch64_final_link_relocate (reloc + + if ((input_section->flags & SEC_ALLOC) == 0) + { ++ /* If this is a SHT_NOTE section without SHF_ALLOC, treat ++ STT_GNU_IFUNC symbol as STT_FUNC. */ ++ if (elf_section_type (input_section) == SHT_NOTE) ++ goto skip_ifunc; ++ + /* Dynamic relocs are not propagated for SEC_DEBUGGING + sections because such sections are not SEC_ALLOC and + thus ld.so will not process them. */ +@@ -5180,6 +5185,7 @@ bad_ifunc_reloc: + } + } + ++ skip_ifunc: + resolved_to_zero = (h != NULL + && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)); + +Only in binutils-2.30/bfd: elfnn-aarch64.c.orig +diff -rup binutils.orig/bfd/elfxx-sparc.c binutils-2.30/bfd/elfxx-sparc.c +--- binutils.orig/bfd/elfxx-sparc.c 2018-03-09 14:43:05.333208768 +0000 ++++ binutils-2.30/bfd/elfxx-sparc.c 2018-03-09 14:43:31.355904624 +0000 +@@ -3026,7 +3026,13 @@ _bfd_sparc_elf_relocate_section (bfd *ou + + if ((input_section->flags & SEC_ALLOC) == 0 + || h->plt.offset == (bfd_vma) -1) +- abort (); ++ { ++ /* If this is a SHT_NOTE section without SHF_ALLOC, treat ++ STT_GNU_IFUNC symbol as STT_FUNC. */ ++ if (elf_section_type (input_section) == SHT_NOTE) ++ goto skip_ifunc; ++ abort (); ++ } + + plt_sec = htab->elf.splt; + if (! plt_sec) +@@ -3130,6 +3136,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou + } + } + ++ skip_ifunc: + eh = (struct _bfd_sparc_elf_link_hash_entry *) h; + resolved_to_zero = (eh != NULL + && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh)); +Only in binutils-2.30/bfd: elfxx-sparc.c.orig +diff -rup binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp binutils-2.30/ld/testsuite/ld-ifunc/ifunc.exp +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2018-03-09 14:43:04.844214486 +0000 ++++ binutils-2.30/ld/testsuite/ld-ifunc/ifunc.exp 2018-03-09 14:43:31.355904624 +0000 +@@ -47,6 +47,9 @@ if ![check_shared_lib_support] { + return + } + ++# This test does not need a compiler... ++run_dump_test "ifuncmod5" ++ + # We need a working compiler. (Strictly speaking this is + # not true, we could use target specific assembler files). + if { [which $CC] == 0 } { +Only in binutils-2.30: testsuite +--- /dev/null 2018-03-09 07:59:09.608015200 +0000 ++++ binutils-2.30/ld/testsuite/ld-ifunc/ifuncmod5.s 2018-03-09 14:45:45.698334500 +0000 +@@ -0,0 +1,105 @@ ++ .file "ifuncmod5.c" ++ ++ .text ++ .type ifuncmod5.c, STT_NOTYPE ++ifuncmod5.c: ++ .size ifuncmod5.c, 0 ++ ++ .pushsection .gnu.build.attributes, "", %note ++ .balign 4 ++ .dc.l 8 ++ .dc.l 16 ++ .dc.l 0x100 ++ .asciz "GA$3p4" ++ .dc.a ifuncmod5.c ++ .dc.a ifuncmod5.c_end ++ .popsection ++ ++.Ltext0: ++#APP ++ .protected global ++ .type foo, %gnu_indirect_function ++ .type foo_hidden, %gnu_indirect_function ++ .type foo_protected, %gnu_indirect_function ++ .hidden foo_hidden ++ .protected foo_protected ++#NO_APP ++ .align 8 ++ .type one, %function ++one: ++ .dc.l 0 ++ .size one, .-one ++ .align 8 ++ ++.globl foo ++ .type foo, %function ++foo: ++ .dc.l 0 ++ .size foo, .-foo ++ ++ .pushsection .gnu.build.attributes ++ .dc.l 6 ++ .dc.l 16 ++ .dc.l 0x101 ++ .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0 ++ .dc.b 0, 0 ++ .dc.a foo ++ .dc.a foo_end ++ .popsection ++ ++foo_end: ++ .align 8 ++.globl foo_hidden ++ .type foo_hidden, %function ++foo_hidden: ++ .dc.l 0 ++ .size foo_hidden, .-foo_hidden ++ ++ .pushsection .gnu.build.attributes ++ .dc.l 6 ++ .dc.l 16 ++ .dc.l 0x101 ++ .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0 ++ .dc.b 0, 0 ++ .dc.a foo_hidden ++ .dc.a foo_hidden_end ++ .popsection ++ ++foo_hidden_end: ++ .align 8 ++ ++ .globl foo_protected ++ .type foo_protected, %function ++foo_protected: ++ .dc.l 0 ++ ++ .size foo_protected, .-foo_protected ++ ++ .pushsection .gnu.build.attributes ++ .dc.l 6 ++ .dc.l 16 ++ .dc.l 0x101 ++ .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0 ++ .dc.b 0, 0 ++ .dc.a foo_protected ++ .dc.a foo_protected_end ++ .popsection ++ ++foo_protected_end: ++ .globl global ++ ++ .data ++ .align 4 ++ .type global, %object ++ .size global, 4 ++global: ++ .long -1 ++ ++ .text ++ .Letext0: ++ ++ifuncmod5.c_end: ++ .type ifuncmod5.c_end, STT_NOTYPE ++ .size ifuncmod5.c_end, 0 ++ ++ +--- /dev/null 2018-03-09 07:59:09.608015200 +0000 ++++ binutils-2.30/ld/testsuite/ld-ifunc/ifuncmod5.d 2018-03-09 14:45:45.698334500 +0000 +@@ -0,0 +1,8 @@ ++# name: Reloc against IFUNC symbol in NOTE section ++# ld: -shared ++# nm: -p ++ ++# We do not actually care about the notes at the moment. ++# The purpose of this test is to make sure that the link completes successfully. ++#pass ++ diff --git a/SOURCES/binutils-linkonce-notes.patch b/SOURCES/binutils-linkonce-notes.patch new file mode 100644 index 0000000..3a01ec1 --- /dev/null +++ b/SOURCES/binutils-linkonce-notes.patch @@ -0,0 +1,127 @@ +--- binutils.orig/gas/write.c 2018-05-14 12:22:27.893671804 +0100 ++++ binutils-2.30/gas/write.c 2018-05-14 15:39:03.900509629 +0100 +@@ -1901,6 +1901,7 @@ maybe_generate_build_notes (void) + segT sec; + char * note; + offsetT note_size; ++ offsetT total_size; + offsetT desc_size; + offsetT desc2_offset; + int desc_reloc; +@@ -1918,7 +1919,8 @@ maybe_generate_build_notes (void) + SEC_READONLY | SEC_HAS_CONTENTS | SEC_DATA); + bfd_set_section_alignment (stdoutput, sec, 2); + +- /* Create a version note. */ ++ /* Work out the size of the notes that we will create, ++ and the relocation we should use. */ + if (bfd_arch_bits_per_address (stdoutput) <= 32) + { + note_size = 28; +@@ -1952,65 +1954,59 @@ maybe_generate_build_notes (void) + desc_reloc = BFD_RELOC_64; + } + +- frag_now_fix (); +- note = frag_more (note_size); +- memset (note, 0, note_size); ++ /* We have to create a note for *each* code section. ++ Linker garbage collection might discard some. */ ++ total_size = 0; ++ note = NULL; + +- if (target_big_endian) +- { +- note[3] = 8; /* strlen (name) + 1. */ +- note[7] = desc_size; /* Two 8-byte offsets. */ +- note[10] = NT_GNU_BUILD_ATTRIBUTE_OPEN >> 8; +- note[11] = NT_GNU_BUILD_ATTRIBUTE_OPEN & 0xff; +- } +- else +- { +- note[0] = 8; /* strlen (name) + 1. */ +- note[4] = desc_size; /* Two 8-byte offsets. */ +- note[8] = NT_GNU_BUILD_ATTRIBUTE_OPEN & 0xff; +- note[9] = NT_GNU_BUILD_ATTRIBUTE_OPEN >> 8; +- } +- +- /* The a1 version number indicates that this note was +- generated by the assembler and not the gcc annobin plugin. */ +- memcpy (note + 12, "GA$3a1", 8); +- +- /* Find the first code section symbol. */ + for (sym = symbol_rootP; sym != NULL; sym = sym->sy_next) + if (sym->bsym != NULL + && sym->bsym->flags & BSF_SECTION_SYM + && sym->bsym->section != NULL +- && sym->bsym->section->flags & SEC_CODE) ++ /* Skip linkonce sections - we cannot these section symbols as they may disappear. */ ++ && (sym->bsym->section->flags & (SEC_CODE | SEC_LINK_ONCE)) == SEC_CODE ++ /* Not all linkonce sections are flagged... */ ++ && strncmp (S_GET_NAME (sym), ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) != 0) + { +- /* Found one - now create a relocation against this symbol. */ +- create_note_reloc (sec, sym, 20, desc_reloc, 0, note); +- break; +- } ++ /* Create a version note. */ ++ frag_now_fix (); ++ note = frag_more (note_size); ++ memset (note, 0, note_size); + +- /* Find the last code section symbol. */ +- if (sym) +- { +- for (sym = symbol_lastP; sym != NULL; sym = sym->sy_previous) +- if (sym->bsym != NULL +- && sym->bsym->flags & BSF_SECTION_SYM +- && sym->bsym->section != NULL +- && sym->bsym->section->flags & SEC_CODE) ++ if (target_big_endian) + { +- /* Create a relocation against the end of this symbol. */ +- create_note_reloc (sec, sym, desc2_offset, desc_reloc, +- bfd_get_section_size (sym->bsym->section), +- note); +- break; ++ note[3] = 8; /* strlen (name) + 1. */ ++ note[7] = desc_size; /* Two 8-byte offsets. */ ++ note[10] = NT_GNU_BUILD_ATTRIBUTE_OPEN >> 8; ++ note[11] = NT_GNU_BUILD_ATTRIBUTE_OPEN & 0xff; + } +- } +- /* else - if we were unable to find any code section symbols then +- probably there is no code in the output. So leaving the start +- and end values as zero in the note is OK. */ ++ else ++ { ++ note[0] = 8; /* strlen (name) + 1. */ ++ note[4] = desc_size; /* Two 8-byte offsets. */ ++ note[8] = NT_GNU_BUILD_ATTRIBUTE_OPEN & 0xff; ++ note[9] = NT_GNU_BUILD_ATTRIBUTE_OPEN >> 8; ++ } ++ ++ /* The a1 version number indicates that this note was ++ generated by the assembler and not the gcc annobin plugin. */ ++ memcpy (note + 12, "GA$3a1", 8); + +- /* FIXME: Maybe add a note recording the assembler command line and version ? */ ++ /* Create a relocation to install the start address of the note... */ ++ create_note_reloc (sec, sym, 20, desc_reloc, 0, note); ++ ++ /* ...and another one to install the end address. */ ++ create_note_reloc (sec, sym, desc2_offset, desc_reloc, ++ bfd_get_section_size (sym->bsym->section), ++ note); ++ ++ total_size += note_size; ++ /* FIXME: Maybe add a note recording the assembler command line and version ? */ ++ } + + /* Install the note(s) into the section. */ +- bfd_set_section_contents (stdoutput, sec, (bfd_byte *) note, 0, note_size); ++ if (total_size) ++ bfd_set_section_contents (stdoutput, sec, (bfd_byte *) note, 0, total_size); + subsegs_finish_section (sec); + relax_segment (seg_info (sec)->frchainP->frch_root, sec, 0); + size_seg (stdoutput, sec, NULL); diff --git a/SOURCES/binutils-merge-attribute-sections.patch b/SOURCES/binutils-merge-attribute-sections.patch new file mode 100644 index 0000000..0b75718 --- /dev/null +++ b/SOURCES/binutils-merge-attribute-sections.patch @@ -0,0 +1,23 @@ +diff -rup binutils.orig/gold/layout.cc binutils-2.30/gold/layout.cc +--- binutils.orig/gold/layout.cc 2018-07-27 12:02:14.160444849 +0100 ++++ binutils-2.30/gold/layout.cc 2018-07-27 12:03:11.543820863 +0100 +@@ -5133,6 +5133,7 @@ const Layout::Section_name_mapping Layou + MAPPING_INIT(".gnu.linkonce.armextab.", ".ARM.extab"), + MAPPING_INIT(".ARM.exidx", ".ARM.exidx"), + MAPPING_INIT(".gnu.linkonce.armexidx.", ".ARM.exidx"), ++ MAPPING_INIT(".gnu.build.attributes.", ".gnu.build.attributes"), + }; + #undef MAPPING_INIT + #undef MAPPING_INIT_EXACT +diff -rup binutils.orig/ld/scripttempl/elf.sc binutils-2.30/ld/scripttempl/elf.sc +--- binutils.orig/ld/scripttempl/elf.sc 2018-07-27 12:02:13.992446676 +0100 ++++ binutils-2.30/ld/scripttempl/elf.sc 2018-07-27 12:02:42.292138945 +0100 +@@ -692,6 +692,8 @@ cat <bsym != NULL + && sym->bsym->flags & BSF_SECTION_SYM + && sym->bsym->section != NULL +- /* Skip linkonce sections - we cannot these section symbols as they may disappear. */ ++ /* Skip linkonce sections - we cannot use these section symbols as they may disappear. */ + && (sym->bsym->section->flags & (SEC_CODE | SEC_LINK_ONCE)) == SEC_CODE + /* Not all linkonce sections are flagged... */ + && strncmp (S_GET_NAME (sym), ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) != 0) +@@ -1993,10 +1993,10 @@ maybe_generate_build_notes (void) + memcpy (note + 12, "GA$3a1", 8); + + /* Create a relocation to install the start address of the note... */ +- create_note_reloc (sec, sym, 20, desc_reloc, 0, note); ++ create_note_reloc (sec, sym, total_size + 20, desc_reloc, 0, note); + + /* ...and another one to install the end address. */ +- create_note_reloc (sec, sym, desc2_offset, desc_reloc, ++ create_note_reloc (sec, sym, total_size + desc2_offset, desc_reloc, + bfd_get_section_size (sym->bsym->section), + note); + diff --git a/SOURCES/binutils-multiple-relocs-for-same-section.patch b/SOURCES/binutils-multiple-relocs-for-same-section.patch new file mode 100644 index 0000000..165c743 --- /dev/null +++ b/SOURCES/binutils-multiple-relocs-for-same-section.patch @@ -0,0 +1,23 @@ +--- binutils.orig/bfd/elf.c 2019-09-10 10:57:33.391081672 +0100 ++++ binutils-2.27/bfd/elf.c 2019-09-10 10:59:55.355010766 +0100 +@@ -2324,9 +2324,18 @@ bfd_section_from_shdr (bfd *abfd, unsign + else + p_hdr = &esdt->rel.hdr; + +- /* PR 17512: file: 0b4f81b7. */ ++ /* PR 17512: file: 0b4f81b7. ++ Also see PR 24456, for a file which deliberately has two reloc ++ sections. */ + if (*p_hdr != NULL) +- goto fail; ++ { ++ _bfd_error_handler ++ /* xgettext:c-format */ ++ (_("%B: warning: multiple relocation sections for section %A \ ++found - ignoring all but the first"), ++ abfd, target_sect); ++ goto success; ++ } + hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, sizeof (*hdr2)); + if (hdr2 == NULL) + goto fail; diff --git a/SOURCES/binutils-nfp.patch b/SOURCES/binutils-nfp.patch new file mode 100644 index 0000000..d8f8c93 --- /dev/null +++ b/SOURCES/binutils-nfp.patch @@ -0,0 +1,5427 @@ +# Add support for disassembling NFP binaries. (#1644391) + +diff -rup binutils.orig/bfd/archures.c binutils-2.30/bfd/archures.c +--- binutils.orig/bfd/archures.c 2019-03-07 13:21:14.246464815 +0000 ++++ binutils-2.30/bfd/archures.c 2019-03-07 14:44:05.704268413 +0000 +@@ -537,6 +537,9 @@ DESCRIPTION + .#define bfd_mach_wasm32 1 + . bfd_arch_pru, {* PRU. *} + .#define bfd_mach_pru 0 ++. bfd_arch_nfp, {* Netronome Flow Processor *} ++.#define bfd_mach_nfp3200 0x3200 ++.#define bfd_mach_nfp6000 0x6000 + . bfd_arch_last + . }; + */ +@@ -632,6 +635,7 @@ extern const bfd_arch_info_type bfd_ft32 + extern const bfd_arch_info_type bfd_msp430_arch; + extern const bfd_arch_info_type bfd_mt_arch; + extern const bfd_arch_info_type bfd_nds32_arch; ++extern const bfd_arch_info_type bfd_nfp_arch; + extern const bfd_arch_info_type bfd_nios2_arch; + extern const bfd_arch_info_type bfd_ns32k_arch; + extern const bfd_arch_info_type bfd_or1k_arch; +@@ -727,6 +731,7 @@ static const bfd_arch_info_type * const + &bfd_msp430_arch, + &bfd_mt_arch, + &bfd_nds32_arch, ++ &bfd_nfp_arch, + &bfd_nios2_arch, + &bfd_ns32k_arch, + &bfd_or1k_arch, +diff -rup binutils.orig/bfd/bfd-in2.h binutils-2.30/bfd/bfd-in2.h +--- binutils.orig/bfd/bfd-in2.h 2019-03-07 13:21:14.244464831 +0000 ++++ binutils-2.30/bfd/bfd-in2.h 2019-03-07 14:44:05.704268413 +0000 +@@ -2399,6 +2399,9 @@ enum bfd_architecture + #define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ + #define bfd_mach_pru 0 ++ bfd_arch_nfp, /* Netronome Flow Processor */ ++#define bfd_mach_nfp3200 0x3200 ++#define bfd_mach_nfp6000 0x6000 + bfd_arch_last + }; + +diff -rup binutils.orig/bfd/config.bfd binutils-2.30/bfd/config.bfd +--- binutils.orig/bfd/config.bfd 2019-03-07 13:21:14.245464823 +0000 ++++ binutils-2.30/bfd/config.bfd 2019-03-07 14:44:05.705268406 +0000 +@@ -181,6 +181,7 @@ m88*) targ_archs=bfd_m88k_arch ;; + microblaze*) targ_archs=bfd_microblaze_arch ;; + mips*) targ_archs=bfd_mips_arch ;; + nds32*) targ_archs=bfd_nds32_arch ;; ++nfp) targ_archs=bfd_nfp_arch ;; + nios2*) targ_archs=bfd_nios2_arch ;; + or1k*|or1knd*) targ_archs=bfd_or1k_arch ;; + pdp11*) targ_archs=bfd_pdp11_arch ;; +@@ -1277,6 +1278,12 @@ case "${targ}" in + targ_selvecs=nds32_elf32_le_vec + ;; + ++#ifdef BFD64 ++ nfp-*-*) ++ targ_defvec=nfp_elf64_vec ++ ;; ++#endif ++ + ns32k-pc532-mach* | ns32k-pc532-ux*) + targ_defvec=ns32k_aout_pc532mach_vec + targ_underscore=yes +diff -rup binutils.orig/bfd/configure binutils-2.30/bfd/configure +--- binutils.orig/bfd/configure 2019-03-07 13:21:14.244464831 +0000 ++++ binutils-2.30/bfd/configure 2019-03-07 14:44:05.706268397 +0000 +@@ -14526,6 +14526,7 @@ do + nds32_elf32_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + nds32_elf32_linux_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + nds32_elf32_linux_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; ++ nfp_elf64_vec) tb="$tb elf64-nfp.lo elf64.lo $elf" ;; + nios2_elf32_be_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; + nios2_elf32_le_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; + ns32k_aout_pc532mach_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; +diff -rup binutils.orig/bfd/configure.ac binutils-2.30/bfd/configure.ac +--- binutils.orig/bfd/configure.ac 2019-03-07 13:21:14.264464675 +0000 ++++ binutils-2.30/bfd/configure.ac 2019-03-07 14:44:05.706268397 +0000 +@@ -584,6 +584,7 @@ do + nds32_elf32_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + nds32_elf32_linux_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + nds32_elf32_linux_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; ++ nfp_elf64_vec) tb="$tb elf64-nfp.lo elf64.lo $elf" ;; + nios2_elf32_be_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; + nios2_elf32_le_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; + ns32k_aout_pc532mach_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; +diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.30/bfd/elf-bfd.h +--- binutils.orig/bfd/elf-bfd.h 2019-03-07 13:21:14.254464753 +0000 ++++ binutils-2.30/bfd/elf-bfd.h 2019-03-07 14:44:05.706268397 +0000 +@@ -1668,6 +1668,7 @@ struct bfd_elf_section_data + #define elf_linked_to_section(sec) (elf_section_data(sec)->linked_to) + #define elf_section_type(sec) (elf_section_data(sec)->this_hdr.sh_type) + #define elf_section_flags(sec) (elf_section_data(sec)->this_hdr.sh_flags) ++#define elf_section_info(sec) (elf_section_data(sec)->this_hdr.sh_info) + #define elf_group_name(sec) (elf_section_data(sec)->group.name) + #define elf_group_id(sec) (elf_section_data(sec)->group.id) + #define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) +diff -rup binutils.orig/bfd/Makefile.am binutils-2.30/bfd/Makefile.am +--- binutils.orig/bfd/Makefile.am 2019-03-07 13:21:14.244464831 +0000 ++++ binutils-2.30/bfd/Makefile.am 2019-03-07 14:44:05.703268422 +0000 +@@ -140,6 +140,7 @@ ALL_MACHINES = \ + cpu-msp430.lo \ + cpu-mt.lo \ + cpu-nds32.lo \ ++ cpu-nfp.lo \ + cpu-nios2.lo \ + cpu-ns32k.lo \ + cpu-or1k.lo \ +@@ -230,6 +231,7 @@ ALL_MACHINES_CFILES = \ + cpu-msp430.c \ + cpu-mt.c \ + cpu-nds32.c \ ++ cpu-nfp.c \ + cpu-ns32k.c \ + cpu-nios2.c \ + cpu-or1k.c \ +@@ -692,6 +694,7 @@ BFD64_BACKENDS = \ + elf64-mips.lo \ + elfxx-mips.lo \ + elf64-mmix.lo \ ++ elf64-nfp.lo \ + elf64-ppc.lo \ + elf32-riscv.lo \ + elf64-riscv.lo \ +@@ -731,6 +734,7 @@ BFD64_BACKENDS_CFILES = \ + elf64-ia64-vms.c \ + elf64-mips.c \ + elf64-mmix.c \ ++ elf64-nfp.c \ + elf64-ppc.c \ + elf64-s390.c \ + elf64-sh64.c \ +diff -rup binutils.orig/bfd/Makefile.in binutils-2.30/bfd/Makefile.in +--- binutils.orig/bfd/Makefile.in 2019-03-07 13:21:14.245464823 +0000 ++++ binutils-2.30/bfd/Makefile.in 2019-03-07 14:44:05.704268413 +0000 +@@ -474,6 +474,7 @@ ALL_MACHINES = \ + cpu-msp430.lo \ + cpu-mt.lo \ + cpu-nds32.lo \ ++ cpu-nfp.lo \ + cpu-nios2.lo \ + cpu-ns32k.lo \ + cpu-or1k.lo \ +@@ -564,6 +565,7 @@ ALL_MACHINES_CFILES = \ + cpu-msp430.c \ + cpu-mt.c \ + cpu-nds32.c \ ++ cpu-nfp.c \ + cpu-ns32k.c \ + cpu-nios2.c \ + cpu-or1k.c \ +@@ -1028,6 +1030,7 @@ BFD64_BACKENDS = \ + elf64-mips.lo \ + elfxx-mips.lo \ + elf64-mmix.lo \ ++ elf64-nfp.lo \ + elf64-ppc.lo \ + elf32-riscv.lo \ + elf64-riscv.lo \ +@@ -1067,6 +1070,7 @@ BFD64_BACKENDS_CFILES = \ + elf64-ia64-vms.c \ + elf64-mips.c \ + elf64-mmix.c \ ++ elf64-nfp.c \ + elf64-ppc.c \ + elf64-s390.c \ + elf64-sh64.c \ +@@ -1430,6 +1434,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-msp430.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-mt.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nds32.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nfp.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nios2.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-ns32k.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-or1k.Plo@am__quote@ +@@ -1563,6 +1568,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-ia64.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-mips.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-mmix.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-nfp.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-ppc.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-riscv.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-s390.Plo@am__quote@ +diff -rup binutils.orig/bfd/targets.c binutils-2.30/bfd/targets.c +--- binutils.orig/bfd/targets.c 2019-03-07 13:21:14.261464698 +0000 ++++ binutils-2.30/bfd/targets.c 2019-03-07 14:49:56.512460817 +0000 +@@ -788,6 +788,7 @@ extern const bfd_target nds32_elf32_be_v + extern const bfd_target nds32_elf32_le_vec; + extern const bfd_target nds32_elf32_linux_be_vec; + extern const bfd_target nds32_elf32_linux_le_vec; ++extern const bfd_target nfp_elf64_vec; + extern const bfd_target nios2_elf32_be_vec; + extern const bfd_target nios2_elf32_le_vec; + extern const bfd_target ns32k_aout_pc532mach_vec; +@@ -1274,6 +1275,10 @@ static const bfd_target * const _bfd_tar + &nds32_elf32_linux_be_vec, + &nds32_elf32_linux_le_vec, + ++#ifdef BFD64 ++ &nfp_elf64_vec, ++#endif ++ + &nios2_elf32_be_vec, + &nios2_elf32_le_vec, + +diff -rup binutils.orig/binutils/NEWS binutils-2.30/binutils/NEWS +--- binutils.orig/binutils/NEWS 2019-03-07 13:21:13.399471393 +0000 ++++ binutils-2.30/binutils/NEWS 2019-03-07 14:44:05.712268349 +0000 +@@ -1,5 +1,7 @@ + -*- text -*- + ++* Add support for disassembling netronome Flow Processor (NFP) firmware files. ++ + Changes in 2.30: + + * Add --debug-dump=links option to readelf and --dwarf=links option to objdump +diff -rup binutils.orig/binutils/readelf.c binutils-2.30/binutils/readelf.c +--- binutils.orig/binutils/readelf.c 2019-03-07 13:21:13.417471253 +0000 ++++ binutils-2.30/binutils/readelf.c 2019-03-07 14:44:05.715268325 +0000 +@@ -131,6 +131,7 @@ + #include "elf/mt.h" + #include "elf/msp430.h" + #include "elf/nds32.h" ++#include "elf/nfp.h" + #include "elf/nios2.h" + #include "elf/or1k.h" + #include "elf/pj.h" +@@ -765,6 +766,7 @@ guess_is_rela (unsigned int e_machine) + case EM_CYGNUS_M32R: + case EM_SCORE: + case EM_XGATE: ++ case EM_NFP: + return FALSE; + + /* Targets that use RELA relocations. */ +@@ -1549,6 +1551,13 @@ dump_relocations (Filedata * fi + case EM_TI_PRU: + rtype = elf_pru_reloc_type (type); + break; ++ ++ case EM_NFP: ++ if (EF_NFP_MACH (filedata->file_header.e_flags) == E_NFP_MACH_3200) ++ rtype = elf_nfp3200_reloc_type (type); ++ else ++ rtype = elf_nfp_reloc_type (type); ++ break; + } + + if (rtype == NULL) +@@ -2461,6 +2470,7 @@ get_machine_name (unsigned e_machine) + case EM_RISCV: return "RISC-V"; + case EM_LANAI: return "Lanai 32-bit processor"; + case EM_BPF: return "Linux BPF"; ++ case EM_NFP: return "Netronome Flow Processor"; + + /* Large numbers... */ + case EM_MT: return "Morpho Techologies MT processor"; +@@ -3423,6 +3433,18 @@ get_machine_flags (Filedata * filedata, + decode_NDS32_machine_flags (e_flags, buf, sizeof buf); + break; + ++ case EM_NFP: ++ switch (EF_NFP_MACH (e_flags)) ++ { ++ case E_NFP_MACH_3200: ++ strcat (buf, ", NFP-32xx"); ++ break; ++ case E_NFP_MACH_6000: ++ strcat (buf, ", NFP-6xxx"); ++ break; ++ } ++ break; ++ + case EM_RISCV: + if (e_flags & EF_RISCV_RVC) + strcat (buf, ", RVC"); +@@ -4118,6 +4140,18 @@ get_msp430x_section_type_name (unsigned + } + + static const char * ++get_nfp_section_type_name (unsigned int sh_type) ++{ ++ switch (sh_type) ++ { ++ case SHT_NFP_MECONFIG: return "NFP_MECONFIG"; ++ case SHT_NFP_INITREG: return "NFP_INITREG"; ++ case SHT_NFP_UDEBUG: return "NFP_UDEBUG"; ++ default: return NULL; ++ } ++} ++ ++static const char * + get_v850_section_type_name (unsigned int sh_type) + { + switch (sh_type) +@@ -4204,6 +4238,9 @@ get_section_type_name (Filedata * fileda + case EM_MSP430: + result = get_msp430x_section_type_name (sh_type); + break; ++ case EM_NFP: ++ result = get_nfp_section_type_name (sh_type); ++ break; + case EM_V800: + case EM_V850: + case EM_CYGNUS_V850: +diff -rup binutils.orig/config.sub binutils-2.30/config.sub +--- binutils.orig/config.sub 2019-03-07 13:21:14.229464947 +0000 ++++ binutils-2.30/config.sub 2019-03-07 14:53:14.241881286 +0000 +@@ -293,6 +293,7 @@ case $basic_machine in + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ ++ | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ +diff -rup binutils.orig/include/dis-asm.h binutils-2.30/include/dis-asm.h +--- binutils.orig/include/dis-asm.h 2019-03-07 13:21:14.298464411 +0000 ++++ binutils-2.30/include/dis-asm.h 2019-03-07 14:44:05.716268317 +0000 +@@ -255,6 +255,7 @@ extern disassembler_ftype cris_get_disas + extern void print_aarch64_disassembler_options (FILE *); + extern void print_i386_disassembler_options (FILE *); + extern void print_mips_disassembler_options (FILE *); ++extern void print_nfp_disassembler_options (FILE *); + extern void print_ppc_disassembler_options (FILE *); + extern void print_riscv_disassembler_options (FILE *); + extern void print_arm_disassembler_options (FILE *); +diff -rup binutils.orig/include/elf/common.h binutils-2.30/include/elf/common.h +--- binutils.orig/include/elf/common.h 2019-03-07 13:21:14.295464435 +0000 ++++ binutils-2.30/include/elf/common.h 2019-03-07 14:44:05.716268317 +0000 +@@ -338,6 +338,7 @@ + #define EM_RISCV 243 /* RISC-V */ + #define EM_LANAI 244 /* Lanai 32-bit processor. */ + #define EM_BPF 247 /* Linux BPF – in-kernel virtual machine. */ ++#define EM_NFP 250 /* Netronome Flow Processor. */ + + /* If it is necessary to assign new unofficial EM_* values, please pick large + random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision +diff -rup binutils.orig/opcodes/configure binutils-2.30/opcodes/configure +--- binutils.orig/opcodes/configure 2019-03-07 13:21:13.445471036 +0000 ++++ binutils-2.30/opcodes/configure 2019-03-07 14:44:05.718268301 +0000 +@@ -12700,6 +12700,7 @@ if test x${all_targets} = xfalse ; then + bfd_mt_arch) ta="$ta mt-asm.lo mt-desc.lo mt-dis.lo mt-ibld.lo mt-opc.lo" using_cgen=yes ;; + bfd_msp430_arch) ta="$ta msp430-dis.lo msp430-decode.lo" ;; + bfd_nds32_arch) ta="$ta nds32-asm.lo nds32-dis.lo" ;; ++ bfd_nfp_arch) ta="$ta nfp-dis.lo" ;; + bfd_nios2_arch) ta="$ta nios2-dis.lo nios2-opc.lo" ;; + bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;; + bfd_or1k_arch) ta="$ta or1k-asm.lo or1k-desc.lo or1k-dis.lo or1k-ibld.lo or1k-opc.lo" using_cgen=yes ;; +diff -rup binutils.orig/opcodes/configure.ac binutils-2.30/opcodes/configure.ac +--- binutils.orig/opcodes/configure.ac 2019-03-07 13:21:13.445471036 +0000 ++++ binutils-2.30/opcodes/configure.ac 2019-03-07 14:44:05.718268301 +0000 +@@ -300,6 +300,7 @@ if test x${all_targets} = xfalse ; then + bfd_mt_arch) ta="$ta mt-asm.lo mt-desc.lo mt-dis.lo mt-ibld.lo mt-opc.lo" using_cgen=yes ;; + bfd_msp430_arch) ta="$ta msp430-dis.lo msp430-decode.lo" ;; + bfd_nds32_arch) ta="$ta nds32-asm.lo nds32-dis.lo" ;; ++ bfd_nfp_arch) ta="$ta nfp-dis.lo" ;; + bfd_nios2_arch) ta="$ta nios2-dis.lo nios2-opc.lo" ;; + bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;; + bfd_or1k_arch) ta="$ta or1k-asm.lo or1k-desc.lo or1k-dis.lo or1k-ibld.lo or1k-opc.lo" using_cgen=yes ;; +diff -rup binutils.orig/opcodes/disassemble.c binutils-2.30/opcodes/disassemble.c +--- binutils.orig/opcodes/disassemble.c 2019-03-07 13:21:13.438471090 +0000 ++++ binutils-2.30/opcodes/disassemble.c 2019-03-07 14:44:05.718268301 +0000 +@@ -69,6 +69,7 @@ + #define ARCH_mt + #define ARCH_msp430 + #define ARCH_nds32 ++#define ARCH_nfp + #define ARCH_nios2 + #define ARCH_ns32k + #define ARCH_or1k +@@ -306,6 +307,11 @@ disassembler (enum bfd_architecture a, + disassemble = print_insn_nds32; + break; + #endif ++#ifdef ARCH_nfp ++ case bfd_arch_nfp: ++ disassemble = print_insn_nfp; ++ break; ++#endif + #ifdef ARCH_ns32k + case bfd_arch_ns32k: + disassemble = print_insn_ns32k; +@@ -576,6 +582,9 @@ disassembler_usage (FILE *stream ATTRIBU + #ifdef ARCH_mips + print_mips_disassembler_options (stream); + #endif ++#ifdef ARCH_nfp ++ print_nfp_disassembler_options (stream); ++#endif + #ifdef ARCH_powerpc + print_ppc_disassembler_options (stream); + #endif +diff -rup binutils.orig/opcodes/disassemble.h binutils-2.30/opcodes/disassemble.h +--- binutils.orig/opcodes/disassemble.h 2019-03-07 13:21:13.444471043 +0000 ++++ binutils-2.30/opcodes/disassemble.h 2019-03-07 14:44:05.718268301 +0000 +@@ -77,6 +77,7 @@ extern int print_insn_moxie (bfd_vma, d + extern int print_insn_msp430 (bfd_vma, disassemble_info *); + extern int print_insn_mt (bfd_vma, disassemble_info *); + extern int print_insn_nds32 (bfd_vma, disassemble_info *); ++extern int print_insn_nfp (bfd_vma, disassemble_info *); + extern int print_insn_ns32k (bfd_vma, disassemble_info *); + extern int print_insn_or1k (bfd_vma, disassemble_info *); + extern int print_insn_pdp11 (bfd_vma, disassemble_info *); +diff -rup binutils.orig/opcodes/Makefile.am binutils-2.30/opcodes/Makefile.am +--- binutils.orig/opcodes/Makefile.am 2019-03-07 13:21:13.445471036 +0000 ++++ binutils-2.30/opcodes/Makefile.am 2019-03-07 14:44:05.717268309 +0000 +@@ -209,6 +209,7 @@ TARGET_LIBOPCODES_CFILES = \ + mt-opc.c \ + nds32-asm.c \ + nds32-dis.c \ ++ nfp-dis.c \ + nios2-dis.c \ + nios2-opc.c \ + ns32k-dis.c \ +diff -rup binutils.orig/opcodes/Makefile.in binutils-2.30/opcodes/Makefile.in +--- binutils.orig/opcodes/Makefile.in 2019-03-07 13:21:13.426471183 +0000 ++++ binutils-2.30/opcodes/Makefile.in 2019-03-07 14:44:05.717268309 +0000 +@@ -511,6 +511,7 @@ TARGET_LIBOPCODES_CFILES = \ + mt-opc.c \ + nds32-asm.c \ + nds32-dis.c \ ++ nfp-dis.c \ + nios2-dis.c \ + nios2-opc.c \ + ns32k-dis.c \ +@@ -920,6 +921,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mt-opc.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nds32-asm.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nds32-dis.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfp-dis.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nios2-dis.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nios2-opc.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ns32k-dis.Plo@am__quote@ +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/bfd/cpu-nfp.c 2019-03-07 14:44:05.706268397 +0000 +@@ -0,0 +1,62 @@ ++/* BFD library support routines for the NFP. ++ Copyright (C) 2017 Free Software Foundation, Inc. ++ Contributed by Francois H. Theron ++ ++ This file is part of BFD, the Binary File Descriptor library. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, ++ MA 02110-1301, USA. */ ++ ++#include "sysdep.h" ++#include "bfd.h" ++#include "libbfd.h" ++ ++static const bfd_arch_info_type * ++bfd_nfp_compatible (const bfd_arch_info_type * a, ++ const bfd_arch_info_type * b) ++{ ++ if (a->arch != b->arch) ++ return NULL; ++ ++ if (a->mach != b->mach) ++ return NULL; ++ ++ return a; ++} ++ ++#define N(machine, print, default, next) \ ++{ \ ++ 32, \ ++ 64, \ ++ 8, \ ++ bfd_arch_nfp, \ ++ machine, \ ++ "nfp", \ ++ print, \ ++ 3, \ ++ default, \ ++ bfd_nfp_compatible, \ ++ bfd_default_scan, \ ++ bfd_arch_default_fill, \ ++ next \ ++} ++ ++static const bfd_arch_info_type arch_info_struct[] = ++{ ++ N (bfd_mach_nfp3200, "NFP-32xx", FALSE, NULL) ++}; ++ ++const bfd_arch_info_type bfd_nfp_arch = ++ N (bfd_mach_nfp6000, "NFP-6xxx", TRUE, &arch_info_struct[0]); +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/bfd/elf64-nfp.c 2019-03-07 14:44:05.706268397 +0000 +@@ -0,0 +1,276 @@ ++/* NFP-specific support for 64-bit ELF ++ Copyright (C) 2017-2018 Free Software Foundation, Inc. ++ Contributed by Francois H. Theron ++ ++ This file is part of BFD, the Binary File Descriptor library. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street - Fifth Floor, ++ Boston, MA 02110-1301, USA. */ ++ ++#include "sysdep.h" ++#include "bfd.h" ++#include "libbfd.h" ++#include "elf-bfd.h" ++#include "elf/nfp.h" ++#include "bfd_stdint.h" ++ ++ ++static bfd_reloc_status_type ++elf64_nfp_reloc (bfd * abfd ATTRIBUTE_UNUSED, ++ arelent * reloc_entry, ++ asymbol * symbol, ++ void *data ATTRIBUTE_UNUSED, ++ asection * input_section, ++ bfd * output_bfd, ++ char **error_message ATTRIBUTE_UNUSED); ++ ++/* We don't actually apply any relocations in this toolset ++ so we make them all do nothing, but at least display useful ++ names. ++ Most of these are mainly used by the NFP toolchain to resolve things ++ before the final ELF file is created. */ ++static reloc_howto_type elf_nfp_howto_table[] = ++{ ++ HOWTO (R_NFP_NOTYPE, /* Type. */ ++ 0, /* Rightshift. */ ++ 3, /* Size. */ ++ 0, /* Bitsize. */ ++ FALSE, /* PC_relative. */ ++ 0, /* Bitpos. */ ++ complain_overflow_dont,/* Complain_on_overflow. */ ++ elf64_nfp_reloc, /* Special_function. */ ++ "R_NFP_NOTYPE", /* Name. */ ++ FALSE, /* Partial_inplace. */ ++ 0, /* Src_mask. */ ++ 0, /* Dst_mask. */ ++ FALSE), /* PCrel_offset. */ ++ HOWTO (R_NFP_W32LE, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W32LE", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_SRC8_A, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_SRC8_A", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_SRC8_B, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_SRC8_B", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_IMMED8_I, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_IMMED8_I", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_SC, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_SC", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_IMMED_LO16_I_A, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_IMMED_LO16_I_A", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_IMMED_LO16_I_B, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_IMMED_LO16_I_B", ++ TRUE, 0, 0, FALSE), ++ HOWTO (R_NFP_SRC7_B, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_SRC7_B", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_SRC7_A, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_SRC7_A", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_SRC8_I_B, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_SRC8_I_B", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_SRC8_I_A, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_SRC8_I_A", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_IMMED_HI16_I_A, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_IMMED_HI16_I_A", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_IMMED_HI16_I_B, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_IMMED_HI16_I_B", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W64LE, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W64LE", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_SH_INFO, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_SH_INFO", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W32BE, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W32BE", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W64BE, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W64BE", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W32_29_24, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W32_29_24", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W32LE_AND, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W32LE_AND", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W32BE_AND, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W32BE_AND", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W32LE_OR, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W32LE_OR", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W32BE_OR, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W32BE_OR", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W64LE_AND, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W64LE_AND", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W64BE_AND, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W64BE_AND", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W64LE_OR, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W64LE_OR", ++ FALSE, 0, 0, FALSE), ++ HOWTO (R_NFP_W64BE_OR, 0, 3, 0, FALSE, 0, ++ complain_overflow_dont, elf64_nfp_reloc, ++ "R_NFP_W64BE_OR", ++ FALSE, 0, 0, FALSE) ++}; ++ ++static bfd_boolean ++elf64_nfp_object_p (bfd * abfd) ++{ ++ /* If the e_machine value is one of the unofficial ones, we convert ++ it first and set e_flags accordingly for later consistency. */ ++ if (elf_elfheader (abfd)->e_machine == E_NFP_MACH_3200) ++ { ++ elf_elfheader (abfd)->e_machine = EM_NFP; ++ elf_elfheader (abfd)->e_flags &= ~EF_NFP_SET_MACH (~0); ++ elf_elfheader (abfd)->e_flags |= EF_NFP_SET_MACH (E_NFP_MACH_3200); ++ } ++ else if (elf_elfheader (abfd)->e_machine == E_NFP_MACH_6000) ++ { ++ elf_elfheader (abfd)->e_machine = EM_NFP; ++ elf_elfheader (abfd)->e_flags &= ~EF_NFP_SET_MACH (~0); ++ elf_elfheader (abfd)->e_flags |= EF_NFP_SET_MACH (E_NFP_MACH_6000); ++ } ++ ++ if (elf_elfheader (abfd)->e_machine == EM_NFP) ++ { ++ int e_mach = EF_NFP_MACH (elf_elfheader (abfd)->e_flags); ++ ++ switch (e_mach) ++ { ++ case E_NFP_MACH_3200: ++ case E_NFP_MACH_6000: ++ if (!bfd_default_set_arch_mach (abfd, bfd_arch_nfp, e_mach)) ++ return FALSE; ++ default: ++ break; ++ } ++ } ++ ++ return TRUE; ++} ++ ++static bfd_boolean ++elf64_nfp_section_from_shdr (bfd * abfd, ++ Elf_Internal_Shdr * hdr, ++ const char *name, int shindex) ++{ ++ switch (hdr->sh_type) ++ { ++ case SHT_NFP_INITREG: ++ case SHT_NFP_MECONFIG: ++ case SHT_NFP_UDEBUG: ++ return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ default: ++ return FALSE; ++ } ++} ++ ++bfd_reloc_status_type ++elf64_nfp_reloc (bfd * abfd ATTRIBUTE_UNUSED, ++ arelent * reloc_entry ATTRIBUTE_UNUSED, ++ asymbol * symbol ATTRIBUTE_UNUSED, ++ void *data ATTRIBUTE_UNUSED, ++ asection * input_section ATTRIBUTE_UNUSED, ++ bfd * output_bfd ATTRIBUTE_UNUSED, ++ char **error_message ATTRIBUTE_UNUSED) ++{ ++ return bfd_reloc_ok; ++} ++ ++static bfd_boolean ++elf64_nfp_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED, ++ arelent * cache_ptr, Elf_Internal_Rela * dst) ++{ ++ unsigned int r_type; ++ ++ r_type = ELF64_R_TYPE (dst->r_info); ++ if (r_type >= R_NFP_MAX) ++ { ++ /* xgettext:c-format */ ++ _bfd_error_handler (_("%pB: unsupported relocation type %#x"), ++ abfd, r_type); ++ bfd_set_error (bfd_error_bad_value); ++ return FALSE; ++ } ++ cache_ptr->howto = &elf_nfp_howto_table[r_type]; ++ return TRUE; ++} ++ ++static reloc_howto_type * ++elf64_nfp_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, ++ bfd_reloc_code_real_type code ATTRIBUTE_UNUSED) ++{ ++ return NULL; ++} ++ ++static reloc_howto_type * ++elf64_nfp_reloc_name_lookup (bfd * abfd ATTRIBUTE_UNUSED, ++ const char *r_name ATTRIBUTE_UNUSED) ++{ ++ return NULL; ++} ++ ++#define ELF_ARCH bfd_arch_nfp ++#define ELF_MACHINE_CODE EM_NFP ++#define ELF_MACHINE_ALT1 E_NFP_MACH_6000 ++#define ELF_MACHINE_ALT2 E_NFP_MACH_3200 ++#define ELF_MAXPAGESIZE 1 ++#define TARGET_LITTLE_NAME "elf64-nfp" ++#define TARGET_LITTLE_SYM nfp_elf64_vec ++ ++#define elf_backend_object_p elf64_nfp_object_p ++#define elf_backend_section_from_shdr elf64_nfp_section_from_shdr ++#define elf_info_to_howto elf64_nfp_info_to_howto ++#define bfd_elf64_bfd_reloc_type_lookup elf64_nfp_reloc_type_lookup ++#define bfd_elf64_bfd_reloc_name_lookup elf64_nfp_reloc_name_lookup ++ ++#include "elf64-target.h" +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/binutils/testsuite/binutils-all/nfp/objdump.exp 2019-03-07 14:44:05.715268325 +0000 +@@ -0,0 +1,52 @@ ++# Copyright (C) 2004-2018 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. ++ ++if {![istarget nfp*-*-*]} { ++ return ++} ++ ++if {![is_remote host] && [which $OBJDUMP] == 0} then { ++ perror "$OBJDUMP does not exist" ++ return ++} ++ ++send_user "Version [binutil_version $OBJDUMP]" ++ ++set outfile "tmpdir/dump.out" ++ ++set testname "NFP dissasembler NFP-6xxx instructions" ++set dumpfile "$srcdir/$subdir/test1.d" ++remote_exec host "${OBJDUMP} -d $srcdir/$subdir/test1_nfp6000.nffw" "" "/dev/null" "$outfile" ++if { [regexp_diff "${outfile}" "${dumpfile}"] } then { ++ fail $testname ++ return ++} ++ ++set testname "NFP dissasembler options: no-pc,ctx4" ++set dumpfile "$srcdir/$subdir/test2_no-pc_ctx4.d" ++remote_exec host "${OBJDUMP} -M no-pc,ctx4 -d $srcdir/$subdir/test2_nfp6000.nffw" "" "/dev/null" "$outfile" ++if { [regexp_diff "${outfile}" "${dumpfile}"] } then { ++ fail $testname ++ return ++} ++ ++set testname "NFP dissasembler options: ctx8" ++set dumpfile "$srcdir/$subdir/test2_ctx8.d" ++remote_exec host "${OBJDUMP} -M ctx8 -d $srcdir/$subdir/test2_nfp6000.nffw" "" "/dev/null" "$outfile" ++if { [regexp_diff "${outfile}" "${dumpfile}"] } then { ++ fail $testname ++ return ++} +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/binutils/testsuite/binutils-all/nfp/test1.d 2019-03-07 14:47:35.561586781 +0000 +@@ -0,0 +1,997 @@ ++ ++.*: file format elf64-nfp ++ ++ ++Disassembly of section \.text\.i32\.me0: ++ ++0000000000000000 <\.text\.i32\.me0>: ++ 0: 000540f0012cd000 \.0 immed\[gprA_0, 0x1234\] ++ 8: 0002c0f0012cd280 \.1 immed\[n\$reg_0, 0x1234\] ++ 10: 000220f0012cd281 \.2 immed\[n\$reg_1, 0x1234\] ++ 18: 000660f0012cd200 \.3 immed\[\*l\$index0, 0x1234\] ++ 20: 0007c0f0012cd220 \.4 immed\[\*l\$index1, 0x1234\] ++ 28: 000fa0f0012cd230 \.5 immed\[\*l\$index1\+\+, 0x1234\] ++ 30: 000f40f0012cd231 \.6 immed\[\*l\$index1--, 0x1234\] ++ 38: 0008c8f0012cd200 \.7 immed\[\*l\$index2, 0x1234\] ++ 40: 0000a8f0012cd210 \.8 immed\[\*l\$index2\+\+, 0x1234\] ++ 48: 000048f0012cd211 \.9 immed\[\*l\$index2--, 0x1234\] ++ 50: 000968f0012cd220 \.10 immed\[\*l\$index3, 0x1234\] ++ 58: 0007e0f0012cd203 \.11 immed\[\*l\$index0\[3\], 0x1234\] ++ 60: 000540f0012cd225 \.12 immed\[\*l\$index1\[5\], 0x1234\] ++ 68: 000b28f0012cd207 \.13 immed\[\*l\$index2\[7\], 0x1234\] ++ 70: 000de8f0012cd229 \.14 immed\[\*l\$index3\[9\], 0x1234\] ++ 78: 000000f00ff003ff \.15 immed\[gprB_0, 0xffff\] ++ 80: 000d60f220000bff \.16 immed_b1\[gprB_2, 0xff\] ++ 88: 000f60f6200007ff \.17 immed_b3\[gprB_1, 0xff\] ++ 90: 000080f080000f00 \.18 immed\[gprB_3, 0xffffffff\] ++ 98: 000100f086600f77 \.19 immed\[gprB_3, 0xffff9988\] ++ a0: 000940f0012cd180 \.20 immed\[\$xfer_0, 0x1234\] ++ a8: 000a00f0043c8581 \.21 immed\[\$xfer_1, 0x4321\] ++ b0: 000180f0056de1ce \.22 immed\[\$xfer_30, 0x5678\] ++ b8: 0007c0f0400e8401 \.23 immed_w0\[gprA_1, 0xa1\] ++ c0: 000440f4400e8802 \.24 immed_w1\[gprA_2, 0xa2\] ++ c8: 000d00f4000e8c03 \.25 immed\[gprA_3, 0xa3, <<16\] ++ d0: 000520f001200334 \.26 immed\[gprB_0, 0x1234\] ++ d8: 000fa0f0400007b1 \.27 immed_w0\[gprB_1, 0xb1\] ++ e0: 000c20f440000bb2 \.28 immed_w1\[gprB_2, 0xb2\] ++ e8: 000560f400000fb3 \.29 immed\[gprB_3, 0xb3, <<16\] ++ f0: 000660f200000fb3 \.30 immed\[gprB_3, 0xb3, <<8\] ++ f8: 0001b0f200000fb3 \.31 immed\[gprB_3, 0xb3, <<8\], predicate_cc ++ 100: 0001c2f200000fb3 \.32 immed\[gprB_3, 0xb3, <<8\], gpr_wrboth ++ 108: 000ba0a0300c2f00 \.33 alu\[--, --, B, 0xb\] ++ 110: 0005a081f200da00 \.34 alu_shf\[--, --, B, 0x16, <<1\] ++ 118: 000be081d2018600 \.35 alu_shf\[--, --, B, 0x21, <<3\] ++ 120: 000240801201b200 \.36 alu_shf\[--, --, B, 0x2c, <<31\] ++ 128: 000fa081f800da00 \.37 alu_shf\[\$xfer_0, --, B, 0x16, <<1\] ++ 130: 0009e081f840da00 \.38 alu_shf\[\$xfer_4, --, B, 0x16, <<1\] ++ 138: 00006081fc80da00 \.39 alu_shf\[\$xfer_24, --, B, 0x16, <<1\] ++ 140: 000a2081fcf0da00 \.40 alu_shf\[\$xfer_31, --, B, 0x16, <<1\] ++ 148: 0004a0a0280c2f00 \.41 alu\[n\$reg_0, --, B, 0xb\] ++ 150: 0001e0a0281c2f00 \.42 alu\[n\$reg_1, --, B, 0xb\] ++ 158: 000880a0a00c2400 \.43 alu\[\*l\$index0, gprA_0, \+, 0x9\] ++ 160: 000100a0a43c2400 \.44 alu\[\*n\$index\+\+, gprA_0, \+, 0x9\] ++ 168: 000b208bc500a600 \.45 alu_shf\[\*l\$index0, gprA_0, OR, 0x9, <<4\] ++ 170: 000b00a0a20c2400 \.46 alu\[\*l\$index1, gprA_0, \+, 0x9\] ++ 178: 000740a0a30c2400 \.47 alu\[\*l\$index1\+\+, gprA_0, \+, 0x9\] ++ 180: 000200a0a31c2400 \.48 alu\[\*l\$index1--, gprA_0, \+, 0x9\] ++ 188: 000628a0a00c2400 \.49 alu\[\*l\$index2, gprA_0, \+, 0x9\] ++ 190: 000988aa210c2400 \.50 alu\[\*l\$index2\+\+, gprA_0, OR, 0x9\] ++ 198: 000f28a0a11c2400 \.51 alu\[\*l\$index2--, gprA_0, \+, 0x9\] ++ 1a0: 0005a8a0a20c2400 \.52 alu\[\*l\$index3, gprA_0, \+, 0x9\] ++ 1a8: 000480a0a03c2400 \.53 alu\[\*l\$index0\[3\], gprA_0, \+, 0x9\] ++ 1b0: 000800a0a25c2400 \.54 alu\[\*l\$index1\[5\], gprA_0, \+, 0x9\] ++ 1b8: 000c68a0a07c2400 \.55 alu\[\*l\$index2\[7\], gprA_0, \+, 0x9\] ++ 1c0: 000aa8a0a29c2400 \.56 alu\[\*l\$index3\[9\], gprA_0, \+, 0x9\] ++ 1c8: 000cc4b0c008a400 \.57 alu\[gprB_0, \*l\$index3\[9\], \+, gprA_0\] ++ 1d0: 000fe4b0c008c000 \.58 alu\[gprB_0, \*l\$index3\+\+, \+, gprA_0\] ++ 1d8: 000ac4b0c008c400 \.59 alu\[gprB_0, \*l\$index3--, \+, gprA_0\] ++ 1e0: 000bc4b080000229 \.60 alu\[gprB_0, \*l\$index3\[9\], \+, gprB_0\] ++ 1e8: 000724b080000230 \.61 alu\[gprB_0, \*l\$index3\+\+, \+, gprB_0\] ++ 1f0: 0007c4b080000231 \.62 alu\[gprB_0, \*l\$index3--, \+, gprB_0\] ++ 1f8: 000664b080000211 \.63 alu\[gprB_0, \*l\$index2--, \+, gprB_0\] ++ 200: 000a60b080000231 \.64 alu\[gprB_0, \*l\$index1--, \+, gprB_0\] ++ 208: 000bc0b080000211 \.65 alu\[gprB_0, \*l\$index0--, \+, gprB_0\] ++ 210: 000340b080000200 \.66 alu\[gprB_0, \*l\$index0, \+, gprB_0\] ++ 218: 000ee4b080000200 \.67 alu\[gprB_0, \*l\$index2, \+, gprB_0\] ++ 220: 000100b080000241 \.68 alu\[gprB_0, \*n\$index, \+, gprB_0\] ++ 228: 0004809bf0000241 \.69 alu_shf\[gprB_0, \*n\$index, OR, gprB_0, <<1\] ++ 230: 000f20a0001fff00 \.70 alu\[gprA_1, --, B, 0xff\] ++ 238: 0005c0b0002fff00 \.71 alu\[gprB_2, --, B, 0xff\] ++ 240: 000940a0000d6f00 \.72 alu\[gprA_0, --, B, 0x5b\] ++ 248: 000440a2000d6f00 \.73 alu\[gprA_0, --, ~B, 0x5b\] ++ 250: 000de081f032f200 \.74 alu_shf\[gprA_3, --, B, 0x5c, <<1\] ++ 258: 000de091d012f600 \.75 alu_shf\[gprB_1, --, B, 0x5d, <<3\] ++ 260: 000d60901022fa00 \.76 alu_shf\[gprB_2, --, B, 0x5e, <<31\] ++ 268: 000e40a0c0000402 \.77 alu\[gprA_0, gprB_1, \+, gprA_2\] ++ 270: 000340a2c0000402 \.78 alu\[gprA_0, gprB_1, \+16, gprA_2\] ++ 278: 000040a4c0000402 \.79 alu\[gprA_0, gprB_1, \+8, gprA_2\] ++ 280: 0007a0a8c0000402 \.80 alu\[gprA_0, gprB_1, \+carry, gprA_2\] ++ 288: 000d40a6c0000402 \.81 alu\[gprA_0, gprB_1, -carry, gprA_2\] ++ 290: 000aa0aac0000402 \.82 alu\[gprA_0, gprB_1, -, gprA_2\] ++ 298: 0009a0acc0000402 \.83 alu\[gprA_0, gprB_1, B-A, gprA_2\] ++ 2a0: 000da0aa40000402 \.84 alu\[gprA_0, gprB_1, OR, gprA_2\] ++ 2a8: 000740a440000402 \.85 alu\[gprA_0, gprB_1, AND, gprA_2\] ++ 2b0: 000a40a640000402 \.86 alu\[gprA_0, gprB_1, ~AND, gprA_2\] ++ 2b8: 0000a0a840000402 \.87 alu\[gprA_0, gprB_1, AND~, gprA_2\] ++ 2c0: 000ea0ac40000402 \.88 alu\[gprA_0, gprB_1, XOR, gprA_2\] ++ 2c8: 000321a0c0000402 \.89 alu\[gprA_0, gprB_1, \+, gprA_2\], no_cc ++ 2d0: 000990a0c0000402 \.90 alu\[gprA_0, gprB_1, \+, gprA_2\], predicate_cc ++ 2d8: 0009e2a0c0000402 \.91 alu\[gprA_0, gprB_1, \+, gprA_2\], gpr_wrboth ++ 2e0: 000353a0c0000402 \.92 alu\[gprA_0, gprB_1, \+, gprA_2\], no_cc, gpr_wrboth, predicate_cc ++ 2e8: 000d418b70080602 \.93 alu_shf\[gprA_0, gprB_1, OR, gprA_2, <<9\], no_cc ++ 2f0: 0006708a90080502 \.94 alu_shf\[gprA_0, gprB_1, OR, gprA_2, >>9\], predicate_cc ++ 2f8: 000ea28a90080402 \.95 alu_shf\[gprA_0, gprB_1, OR, gprA_2, >>rot9\], gpr_wrboth ++ 300: 000e138b70080402 \.96 alu_shf\[gprA_0, gprB_1, OR, gprA_2, >>rot23\], no_cc, gpr_wrboth, predicate_cc ++ 308: 000ba08a00080602 \.97 alu_shf\[gprA_0, gprB_1, OR, gprA_2, <>indirect\] ++ 318: 000ba0a0300c2f00 \.99 alu\[--, --, B, 0xb\] ++ 320: 000ae09d40380101 \.100 asr\[gprB_3, gprA_1, >>20\] ++ 328: 000ba0a0300c2f00 \.101 alu\[--, --, B, 0xb\] ++ 330: 000ea09d40310500 \.102 asr\[gprB_3, \*n\$index, >>20\] ++ 338: 000ba0a0300c2f00 \.103 alu\[--, --, B, 0xb\] ++ 340: 0007a09d40314100 \.104 asr\[gprB_3, \*l\$index0, >>20\] ++ 348: 000ba0a0300c2f00 \.105 alu\[--, --, B, 0xb\] ++ 350: 0000249d40316100 \.106 asr\[gprB_3, \*l\$index3, >>20\] ++ 358: 000ba0a0300c2f00 \.107 alu\[--, --, B, 0xb\] ++ 360: 000a049d40314100 \.108 asr\[gprB_3, \*l\$index2, >>20\] ++ 368: 000ba0a0300c2f00 \.109 alu\[--, --, B, 0xb\] ++ 370: 0004a08d45010d00 \.110 asr\[\*l\$index0, \*n\$index\+\+, >>20\] ++ 378: 000ba0a0300c2f00 \.111 alu\[--, --, B, 0xb\] ++ 380: 000ee08d45810d00 \.112 asr\[\*l\$index1, \*n\$index\+\+, >>20\] ++ 388: 000ba0a0300c2f00 \.113 alu\[--, --, B, 0xb\] ++ 390: 000a088d45010d00 \.114 asr\[\*l\$index2, \*n\$index\+\+, >>20\] ++ 398: 000ba0a0300c2f00 \.115 alu\[--, --, B, 0xb\] ++ 3a0: 0007819d40380101 \.116 asr\[gprB_3, gprA_1, >>20\], no_cc ++ 3a8: 000ba0a0300c2f00 \.117 alu\[--, --, B, 0xb\] ++ 3b0: 000d309d40380101 \.118 asr\[gprB_3, gprA_1, >>20\], predicate_cc ++ 3b8: 000ba0a0300c2f00 \.119 alu\[--, --, B, 0xb\] ++ 3c0: 000ba28d40380101 \.120 asr\[gprA_3, gprA_1, >>20\], gpr_wrboth ++ 3c8: 0008c0d818c08120 \.121 beq\[\.99\] ++ 3d0: 000d00d877c08120 \.122 beq\[\.479\] ++ 3d8: 000440d877e08120 \.123 beq\[\.479\], defer\[2\] ++ 3e0: 000000f0000c0300 \.124 nop ++ 3e8: 000000f0000c0300 \.125 nop ++ 3f0: 000540d877c08021 \.126 bne\[\.479\] ++ 3f8: 0004c0d877c08022 \.127 bmi\[\.479\] ++ 400: 000420d877c08023 \.128 bpl\[\.479\] ++ 408: 0007c0d877c08024 \.129 bcs\[\.479\] ++ 410: 0007c0d877c08024 \.130 bcs\[\.479\] ++ 418: 000720d877c08025 \.131 bcc\[\.479\] ++ 420: 000720d877c08025 \.132 bcc\[\.479\] ++ 428: 0006a0d877c08026 \.133 bvs\[\.479\] ++ 430: 000640d877c08027 \.134 bvc\[\.479\] ++ 438: 0001c0d877c08028 \.135 bge\[\.479\] ++ 440: 000120d877c08029 \.136 blt\[\.479\] ++ 448: 000040d877c0802b \.137 bgt\[\.479\] ++ 450: 0000a0d877c0802a \.138 ble\[\.479\] ++ 458: 000c60d818c08038 \.139 br\[\.99\] ++ 460: 000920d818d08038 \.140 br\[\.99\], defer\[1\] ++ 468: 000000f0000c0300 \.141 nop ++ 470: 000bc0d077c09000 \.142 br_bclr\[gprA_0, 3, \.479\] ++ 478: 000980d077c0e004 \.143 br_bclr\[gprA_4, 23, \.479\] ++ 480: 0002a0d077c0082c \.144 br_bclr\[gprB_2, 11, \.479\] ++ 488: 000300d077c02423 \.145 br_bclr\[gprB_9, 2, \.479\] ++ 490: 000260d077c02421 \.146 br_bclr\[gprB_9, 0, \.479\] ++ 498: 000280d077c02420 \.147 br_bclr\[gprB_9, 31, \.479\] ++ 4a0: 000f00d077f02423 \.148 br_bclr\[gprB_9, 2, \.479\], defer\[3\] ++ 4a8: 000000f0000c0300 \.149 nop ++ 4b0: 000000f0000c0300 \.150 nop ++ 4b8: 000000f0000c0300 \.151 nop ++ 4c0: 000680d077c42c2b \.152 br_bset\[gprB_11, 10, \.479\] ++ 4c8: 0006e0d077c4ac0b \.153 br_bset\[gprA_11, 10, \.479\] ++ 4d0: 0002a0c877d81020 \.154 br=byte\[gprB_4, 0, 0x0, \.479\], defer\[1\] ++ 4d8: 000000f0000c0300 \.155 nop ++ 4e0: 000a60c877c81520 \.156 br=byte\[gprB_5, 1, 0x0, \.479\] ++ 4e8: 0001e0c877c81620 \.157 br=byte\[gprB_5, 2, 0x0, \.479\] ++ 4f0: 0001a4c877c94220 \.158 br=byte\[\*l\$index2, 2, 0x0, \.479\] ++ 4f8: 000620c877c96220 \.159 br=byte\[\*l\$index1, 2, 0x0, \.479\] ++ 500: 000540c877c81b20 \.160 br=byte\[gprB_6, 3, 0x0, \.479\] ++ 508: 0000c0c877cc16ff \.161 br=byte\[gprB_5, 2, 0xff, \.479\] ++ 510: 000420c877c816a2 \.162 br=byte\[gprB_5, 2, 0x42, \.479\] ++ 518: 000380c877c416ff \.163 br!=byte\[gprB_5, 2, 0xff, \.479\] ++ 520: 0002a0c877c01620 \.164 br!=byte\[gprB_5, 2, 0x0, \.479\] ++ 528: 000c20d877c00236 \.165 br_cls_state\[cls_ring0_status, \.479\] ++ 530: 0001a0d877e20236 \.166 br_cls_state\[cls_ring8_status, \.479\], defer\[2\] ++ 538: 000000f0000c0300 \.167 nop ++ 540: 000000f0000c0300 \.168 nop ++ 548: 000be0d877c38236 \.169 br_cls_state\[cls_ring14_status, \.479\] ++ 550: 0007c0d877c3c236 \.170 br_cls_state\[cls_ring15_status, \.479\] ++ 558: 000720d877c3c237 \.171 br_!cls_state\[cls_ring15_status, \.479\] ++ 560: 000cc0d877c00237 \.172 br_!cls_state\[cls_ring0_status, \.479\] ++ 568: 000c00d877c00030 \.173 br=ctx\[0, \.479\] ++ 570: 000dc0d877c08030 \.174 br=ctx\[2, \.479\] ++ 578: 000f00d877c18030 \.175 br=ctx\[6, \.479\] ++ 580: 000a40d877d18030 \.176 br=ctx\[6, \.479\], defer\[1\] ++ 588: 000000f0000c0300 \.177 nop ++ 590: 000d40d877c00234 \.178 br_inp_state\[nn_empty, \.479\] ++ 598: 000160d877c04234 \.179 br_inp_state\[nn_full, \.479\] ++ 5a0: 000c80d877c08234 \.180 br_inp_state\[ctm_ring0_status, \.479\] ++ 5a8: 000100d877e28234 \.181 br_inp_state\[ctm_ring8_status, \.479\], defer\[2\] ++ 5b0: 000000f0000c0300 \.182 nop ++ 5b8: 000000f0000c0300 \.183 nop ++ 5c0: 000a80d877c38234 \.184 br_inp_state\[ctm_ring12_status, \.479\] ++ 5c8: 0006a0d877c3c234 \.185 br_inp_state\[ctm_ring13_status, \.479\] ++ 5d0: 000640d877c3c235 \.186 br_!inp_state\[ctm_ring13_status, \.479\] ++ 5d8: 000c60d877c08235 \.187 br_!inp_state\[ctm_ring0_status, \.479\] ++ 5e0: 000260d877c04232 \.188 br_signal\[1, \.479\] ++ 5e8: 000f80d877c08232 \.189 br_signal\[2, \.479\] ++ 5f0: 0005a0d877c3c232 \.190 br_signal\[15, \.479\] ++ 5f8: 000540d877c3c233 \.191 br_!signal\[15, \.479\] ++ 600: 000b60d877f2c232 \.192 br_signal\[11, \.479\], defer\[3\] ++ 608: 000000f0000c0300 \.193 nop ++ 610: 000000f0000c0300 \.194 nop ++ 618: 000000f0000c0300 \.195 nop ++ 620: 000e40a0c0000402 \.196 alu\[gprA_0, gprB_1, \+, gprA_2\] ++ 628: 0004408e02081200 \.197 byte_align_le\[--, gprB_4\] ++ 630: 0008c08e00981200 \.198 byte_align_le\[gprA_9, gprB_4\] ++ 638: 0004c08e00a81200 \.199 byte_align_le\[gprA_10, gprB_4\] ++ 640: 0001808e00b81200 \.200 byte_align_le\[gprA_11, gprB_4\] ++ 648: 000e40a0c0000402 \.201 alu\[gprA_0, gprB_1, \+, gprA_2\] ++ 650: 000c808e02001100 \.202 byte_align_be\[--, gprB_4\] ++ 658: 0000008e00901100 \.203 byte_align_be\[gprA_9, gprB_4\] ++ 660: 000c008e00a01100 \.204 byte_align_be\[gprA_10, gprB_4\] ++ 668: 0009408e00b01100 \.205 byte_align_be\[gprA_11, gprB_4\] ++ 670: 000d80a0300c0300 \.206 alu\[--, --, B, 0x0\] ++ 678: 000400a5b00c0000 \.207 cam_clear ++ 680: 000360bb80900007 \.208 cam_lookup\[gprB_9, gprA_7\] ++ 688: 0003a0bb80900200 \.209 cam_lookup\[gprB_9, \*l\$index0\] ++ 690: 000e04bb80900200 \.210 cam_lookup\[gprB_9, \*l\$index2\] ++ 698: 000f84bb80900203 \.211 cam_lookup\[gprB_9, \*l\$index2\[3\]\] ++ 6a0: 000bc0bb80900210 \.212 cam_lookup\[gprB_9, \*l\$index0\+\+\] ++ 6a8: 000280aba0000241 \.213 cam_lookup\[\*l\$index0, \*n\$index\] ++ 6b0: 000ec0aba1000241 \.214 cam_lookup\[\*l\$index0\+\+, \*n\$index\] ++ 6b8: 000288aba3000243 \.215 cam_lookup\[\*l\$index3\+\+, \*n\$index\+\+\] ++ 6c0: 000aa0aba0200243 \.216 cam_lookup\[\*l\$index0\[2\], \*n\$index\+\+\] ++ 6c8: 000060bb80901407 \.217 cam_lookup\[gprB_9, gprA_7\], lm_addr0\[1\] ++ 6d0: 000060bb80902807 \.218 cam_lookup\[gprB_9, gprA_7\], lm_addr1\[2\] ++ 6d8: 000660bb80907407 \.219 cam_lookup\[gprB_9, gprA_7\], lm_addr2\[3\] ++ 6e0: 000660bb80904807 \.220 cam_lookup\[gprB_9, gprA_7\], lm_addr3\[0\] ++ 6e8: 000222ab80900007 \.221 cam_lookup\[gprA_9, gprA_7\], gpr_wrboth ++ 6f0: 0004b0bb80900007 \.222 cam_lookup\[gprB_9, gprA_7\], predicate_cc ++ 6f8: 000a00a7809c0000 \.223 cam_read_tag\[gprA_9, 0x0\] ++ 700: 000da2a7809c0000 \.224 cam_read_tag\[gprA_9, 0x0\], gpr_wrboth ++ 708: 000dd0a7809c0000 \.225 cam_read_tag\[gprA_9, 0x0\], predicate_cc ++ 710: 000900a7809c2800 \.226 cam_read_tag\[gprA_9, 0xa\] ++ 718: 000a00a7809c3c00 \.227 cam_read_tag\[gprA_9, 0xf\] ++ 720: 0003e0af809c0000 \.228 cam_read_state\[gprA_9, 0x0\] ++ 728: 000442af809c0000 \.229 cam_read_state\[gprA_9, 0x0\], gpr_wrboth ++ 730: 000392af809c0000 \.230 cam_read_state\[gprA_9, 0x0\], gpr_wrboth, predicate_cc ++ 738: 0000e0af809c2800 \.231 cam_read_state\[gprA_9, 0xa\] ++ 740: 0003e0af809c3c00 \.232 cam_read_state\[gprA_9, 0xf\] ++ 748: 000920a9f0101700 \.233 cam_write\[0x0, gprB_5, 1\] ++ 750: 000da0a9f01a0300 \.234 cam_write\[0x0, n\$reg_0, 1\] ++ 758: 000e80a9f0190700 \.235 cam_write\[0x0, \*n\$index, 1\] ++ 760: 0004c4a9f0180300 \.236 cam_write\[0x0, \*l\$index2, 1\] ++ 768: 0008e4a9f0184300 \.237 cam_write\[0x0, \*l\$index2\+\+, 1\] ++ 770: 000dc4a9f0184700 \.238 cam_write\[0x0, \*l\$index2--, 1\] ++ 778: 000840a9f0b01704 \.239 cam_write\[0x4, gprB_5, 11\] ++ 780: 000be0a9f0f0170f \.240 cam_write\[0xf, gprB_5, 15\] ++ 788: 0008a0adb01c0000 \.241 cam_write_state\[0x0, 1\] ++ 790: 000d80adb0bc1000 \.242 cam_write_state\[0x4, 11\] ++ 798: 000de0adb0fc3c00 \.243 cam_write_state\[0xf, 15\] ++ 7a0: 0000c0fc142c000d \.244 local_csr_wr\[CRCRemainder, gprA_13\] ++ 7a8: 000d20a918060348 \.245 crc_le\[crc_ccitt, \$xfer_0, \$xfer_0\] ++ 7b0: 000000f0000c0300 \.246 nop ++ 7b8: 000d40a918160748 \.247 crc_le\[crc_ccitt, \$xfer_1, \$xfer_1\] ++ 7c0: 000000f0000c0300 \.248 nop ++ 7c8: 000d40a918260b48 \.249 crc_le\[crc_ccitt, \$xfer_2, \$xfer_2\] ++ 7d0: 000000f0000c0300 \.250 nop ++ 7d8: 000d20a918360f48 \.251 crc_le\[crc_ccitt, \$xfer_3, \$xfer_3\] ++ 7e0: 000000f0000c0300 \.252 nop ++ 7e8: 000000f0000c0300 \.253 nop ++ 7f0: 000000f0000c0300 \.254 nop ++ 7f8: 000000f0000c0300 \.255 nop ++ 800: 000000f0000c0300 \.256 nop ++ 808: 000f60fc140c0000 \.257 local_csr_rd\[CRCRemainder\] ++ 810: 000ce0f0000c000e \.258 immed\[gprA_14, 0x0\] ++ 818: 000940a918060340 \.259 crc_be\[crc_ccitt, \$xfer_0, \$xfer_0\] ++ 820: 000000f0000c0300 \.260 nop ++ 828: 000920a918461340 \.261 crc_be\[crc_ccitt, \$xfer_4, \$xfer_4\] ++ 830: 000000f0000c0300 \.262 nop ++ 838: 000060a900061340 \.263 crc_be\[crc_ccitt, gprA_0, \$xfer_4\] ++ 840: 000000f0000c0300 \.264 nop ++ 848: 000c60a900001340 \.265 crc_be\[crc_ccitt, gprA_0, gprB_4\] ++ 850: 000000f0000c0300 \.266 nop ++ 858: 000000f0000c0300 \.267 nop ++ 860: 000000f0000c0300 \.268 nop ++ 868: 000000f0000c0300 \.269 nop ++ 870: 000000f0000c0300 \.270 nop ++ 878: 000600a918260380 \.271 crc_be\[crc_32, \$xfer_2, \$xfer_0\] ++ 880: 000000f0000c0300 \.272 nop ++ 888: 0004c0a9183613a0 \.273 crc_be\[crc_iscsi, \$xfer_3, \$xfer_4\] ++ 890: 000000f0000c0300 \.274 nop ++ 898: 0004c0a9000613c0 \.275 crc_be\[crc_10, gprA_0, \$xfer_4\] ++ 8a0: 000000f0000c0300 \.276 nop ++ 8a8: 000960a9000013e0 \.277 crc_be\[crc_5, gprA_0, gprB_4\] ++ 8b0: 000000f0000c0300 \.278 nop ++ 8b8: 000ea0a918862700 \.279 crc_be\[--, \$xfer_8, \$xfer_9\] ++ 8c0: 000000f0000c0300 \.280 nop ++ 8c8: 000240a918760784 \.281 crc_be\[crc_32, \$xfer_7, \$xfer_1\], bytes_0_2 ++ 8d0: 000000f0000c0300 \.282 nop ++ 8d8: 0002a0a918760785 \.283 crc_be\[crc_32, \$xfer_7, \$xfer_1\], bytes_0_1 ++ 8e0: 000000f0000c0300 \.284 nop ++ 8e8: 000320a918760786 \.285 crc_be\[crc_32, \$xfer_7, \$xfer_1\], byte_0 ++ 8f0: 000000f0000c0300 \.286 nop ++ 8f8: 0000c0a918760781 \.287 crc_be\[crc_32, \$xfer_7, \$xfer_1\], bytes_1_3 ++ 900: 000000f0000c0300 \.288 nop ++ 908: 000140a918760782 \.289 crc_be\[crc_32, \$xfer_7, \$xfer_1\], bytes_2_3 ++ 910: 000000f0000c0300 \.290 nop ++ 918: 0001a0a918760783 \.291 crc_be\[crc_32, \$xfer_7, \$xfer_1\], byte_3 ++ 920: 000000f0000c0300 \.292 nop ++ 928: 000782a900160780 \.293 crc_be\[crc_32, gprA_1, \$xfer_1\], gpr_wrboth ++ 930: 000000f0000c0300 \.294 nop ++ 938: 000ae3a900160780 \.295 crc_be\[crc_32, gprA_1, \$xfer_1\], no_cc, gpr_wrboth ++ 940: 000000f0000c0300 \.296 nop ++ 948: 000b73a900560780 \.297 crc_be\[crc_32, gprA_5, \$xfer_1\], no_cc, gpr_wrboth, predicate_cc ++ 950: 000000f0000c0300 \.298 nop ++ 958: 000122a900560781 \.299 crc_be\[crc_32, gprA_5, \$xfer_1\], bytes_1_3, gpr_wrboth ++ 960: 000000f0000c0300 \.300 nop ++ 968: 000000f0000c0300 \.301 nop ++ 970: 000000f0000c0300 \.302 nop ++ 978: 000000f0000c0300 \.303 nop ++ 980: 000000f0000c0300 \.304 nop ++ 988: 000000f0000c0300 \.305 nop ++ 990: 0005a0e000080000 \.306 ctx_arb\[--\] ++ 998: 000600e000000001 \.307 ctx_arb\[voluntary\] ++ 9a0: 000220e000020000 \.308 ctx_arb\[bpt\] ++ 9a8: 000460e000000220 \.309 ctx_arb\[sig5, sig9\] ++ 9b0: 000d20e000200220 \.310 ctx_arb\[sig5, sig9\], defer\[2\] ++ 9b8: 000180a0300c0f00 \.311 alu\[--, --, B, 0x3\] ++ 9c0: 0007a0a0300c1f00 \.312 alu\[--, --, B, 0x7\] ++ 9c8: 0006a0e000010220 \.313 ctx_arb\[sig5, sig9\], any ++ 9d0: 000a60e077c40220 \.314 ctx_arb\[sig5, sig9\], br\[\.479\] ++ 9d8: 0006409010500701 \.315 dbl_shf\[gprB_5, gprA_1, gprB_1, >>1\] ++ 9e0: 000d4090a0500701 \.316 dbl_shf\[gprB_5, gprA_1, gprB_1, >>10\] ++ 9e8: 000c4091f0500701 \.317 dbl_shf\[gprB_5, gprA_1, gprB_1, >>31\] ++ 9f0: 000740a440000402 \.318 alu\[gprA_0, gprB_1, AND, gprA_2\] ++ 9f8: 0000c09000500701 \.319 dbl_shf\[gprB_5, gprA_1, gprB_1, >>indirect\] ++ a00: 000b219010500701 \.320 dbl_shf\[gprB_5, gprA_1, gprB_1, >>1\], no_cc ++ a08: 000cf19010500701 \.321 dbl_shf\[gprB_5, gprA_1, gprB_1, >>1\], no_cc, predicate_cc ++ a10: 0000d28010500701 \.322 dbl_shf\[gprA_5, gprA_1, gprB_1, >>1\], gpr_wrboth, predicate_cc ++ a18: 000200a700f03f00 \.323 ffs\[gprA_15, gprB_15\] ++ a20: 000fe0b740fc000f \.324 ffs\[gprB_15, gprA_15\] ++ a28: 000ec0b700f61300 \.325 ffs\[gprB_15, \$xfer_4\] ++ a30: 000660b700f88300 \.326 ffs\[gprB_15, \*l\$index1\] ++ a38: 0007e4b700f8c300 \.327 ffs\[gprB_15, \*l\$index3\+\+\] ++ a40: 0002c4b700f8c700 \.328 ffs\[gprB_15, \*l\$index3--\] ++ a48: 0004c4b700f8a700 \.329 ffs\[gprB_15, \*l\$index3\[9\]\] ++ a50: 000880a720000300 \.330 ffs\[\*l\$index0, gprB_0\] ++ a58: 000108a722090700 \.331 ffs\[\*l\$index3, \*n\$index\] ++ a60: 000128a723190f00 \.332 ffs\[\*l\$index3--, \*n\$index\+\+\] ++ a68: 0003c3a740fc000f \.333 ffs\[gprA_15, gprA_15\], no_cc, gpr_wrboth ++ a70: 000972a740fc000f \.334 ffs\[gprA_15, gprA_15\], gpr_wrboth, predicate_cc ++ a78: 000320f0000c0803 \.335 immed\[gprA_3, 0x2\] ++ a80: 000480e8004d4803 \.336 jump\[gprA_3, \.338\] ++ a88: 0006a0d854408038 \.337 br\[\.337\] ++ a90: 000460f000002701 \.338 immed\[gprB_9, 0x1\] ++ a98: 0006a0d854408038 \.339 br\[\.337\] ++ aa0: 0005e0f000002702 \.340 immed\[gprB_9, 0x2\] ++ aa8: 0006a0d854408038 \.341 br\[\.337\] ++ ab0: 000500f000002703 \.342 immed\[gprB_9, 0x3\] ++ ab8: 0006a0d854408038 \.343 br\[\.337\] ++ ac0: 000040c001000000 \.344 ld_field\[gprA_0, 0001, gprB_0\] ++ ac8: 0007e2c001000000 \.345 ld_field\[gprA_0, 0001, gprB_0\], gpr_wrboth ++ ad0: 000e40c401000000 \.346 ld_field\[gprA_0, 0001, gprB_0\], load_cc ++ ad8: 000790c001000000 \.347 ld_field\[gprA_0, 0001, gprB_0\], predicate_cc ++ ae0: 0005c0c005000000 \.348 ld_field\[gprA_0, 0101, gprB_0\] ++ ae8: 000080c005100000 \.349 ld_field_w_clr\[gprA_0, 0101, gprB_0\] ++ af0: 0002a2c001100000 \.350 ld_field_w_clr\[gprA_0, 0001, gprB_0\], gpr_wrboth ++ af8: 000b00c401100000 \.351 ld_field_w_clr\[gprA_0, 0001, gprB_0\], load_cc ++ b00: 0002d0c001100000 \.352 ld_field_w_clr\[gprA_0, 0001, gprB_0\], predicate_cc ++ b08: 000fc0c00f000000 \.353 ld_field\[gprA_0, 1111, gprB_0\] ++ b10: 0005e0c1fb000200 \.354 ld_field\[gprA_0, 1011, gprB_0, <<1\] ++ b18: 000460c01b000100 \.355 ld_field\[gprA_0, 1011, gprB_0, >>1\] ++ b20: 000e60c1fb000100 \.356 ld_field\[gprA_0, 1011, gprB_0, >>31\] ++ b28: 000bc0c09b000000 \.357 ld_field\[gprA_0, 1011, gprB_0, >>rot9\] ++ b30: 000e80c09b100000 \.358 ld_field_w_clr\[gprA_0, 1011, gprB_0, >>rot9\] ++ b38: 0001c0c17b000000 \.359 ld_field\[gprA_0, 1011, gprB_0, >>rot23\] ++ b40: 0002c0c41b000000 \.360 ld_field\[gprA_0, 1011, gprB_0, >>rot1\], load_cc ++ b48: 000780c41b100000 \.361 ld_field_w_clr\[gprA_0, 1011, gprB_0, >>rot1\], load_cc ++ b50: 000400f0001f7c01 \.362 immed\[gprA_1, 0x1df\] ++ b58: 000200f0001007df \.363 immed\[gprB_1, 0x1df\] ++ b60: 0005a2f0001007df \.364 immed\[gprB_1, 0x1df\], gpr_wrboth ++ b68: 0005d0f0001007df \.365 immed\[gprB_1, 0x1df\], predicate_cc ++ b70: 000020fc010c0000 \.366 local_csr_rd\[ALUOut\] ++ b78: 000e60f0000c000b \.367 immed\[gprA_11, 0x0\] ++ b80: 000ce0fc160c0000 \.368 local_csr_rd\[MiscControl\] ++ b88: 000e60f0000c000b \.369 immed\[gprA_11, 0x0\] ++ b90: 000ae0fc076c0b02 \.370 local_csr_wr\[XferIndex, 0x2\] ++ b98: 0008a0fc076c0003 \.371 local_csr_wr\[XferIndex, gprA_3\] ++ ba0: 000520fc07600f00 \.372 local_csr_wr\[XferIndex, gprB_3\] ++ ba8: 000f20fc01a00f00 \.373 local_csr_wr\[CtxEnables, gprB_3\] ++ bb0: 000480f800000c02 \.374 mul_step\[gprA_2, gprB_3\], start ++ bb8: 000880f980000c02 \.375 mul_step\[gprA_2, gprB_3\], 32x32_step1 ++ bc0: 000dc0f980100c02 \.376 mul_step\[gprA_2, gprB_3\], 32x32_step2 ++ bc8: 0001c0f980200c02 \.377 mul_step\[gprA_2, gprB_3\], 32x32_step3 ++ bd0: 000480f980300c02 \.378 mul_step\[gprA_2, gprB_3\], 32x32_step4 ++ bd8: 000940f9804c0002 \.379 mul_step\[gprA_2, --\], 32x32_last ++ be0: 000ce0f9805c0003 \.380 mul_step\[gprA_3, --\], 32x32_last2 ++ be8: 0001a0f800000802 \.381 mul_step\[gprA_2, gprB_2\], start ++ bf0: 000aa0f900000802 \.382 mul_step\[gprA_2, gprB_2\], 16x16_step1 ++ bf8: 000fe0f900100802 \.383 mul_step\[gprA_2, gprB_2\], 16x16_step2 ++ c00: 000f20f9004c0000 \.384 mul_step\[gprA_0, --\], 16x16_last ++ c08: 0001a0f800000802 \.385 mul_step\[gprA_2, gprB_2\], start ++ c10: 0006a0f880000802 \.386 mul_step\[gprA_2, gprB_2\], 24x8_step1 ++ c18: 000320f8804c0000 \.387 mul_step\[gprA_0, --\], 24x8_last ++ c20: 0001a0f800000802 \.388 mul_step\[gprA_2, gprB_2\], start ++ c28: 0006a0f880000802 \.389 mul_step\[gprA_2, gprB_2\], 24x8_step1 ++ c30: 0004f0f8804c0000 \.390 mul_step\[gprA_0, --\], 24x8_last, predicate_cc ++ c38: 0001a0f800000802 \.391 mul_step\[gprA_2, gprB_2\], start ++ c40: 0006a0f880000802 \.392 mul_step\[gprA_2, gprB_2\], 24x8_step1 ++ c48: 0009e3f8804c0000 \.393 mul_step\[gprA_0, --\], 24x8_last, no_cc, gpr_wrboth ++ c50: 000b80a330000000 \.394 pop_count1\[gprB_0\] ++ c58: 000c80a3b0000000 \.395 pop_count2\[gprB_0\] ++ c60: 000d80a180000000 \.396 pop_count3\[gprA_0, gprB_0\] ++ c68: 000b80a330000000 \.397 pop_count1\[gprB_0\] ++ c70: 000c80a3b0000000 \.398 pop_count2\[gprB_0\] ++ c78: 000743a180000000 \.399 pop_count3\[gprA_0, gprB_0\], no_cc, gpr_wrboth ++ c80: 0004a4a330088000 \.400 pop_count1\[\*l\$index3\] ++ c88: 0003a4a3b0088000 \.401 pop_count2\[\*l\$index3\] ++ c90: 0000e5a1a438c000 \.402 pop_count3\[\*n\$index\+\+, \*l\$index3\+\+\], no_cc ++ c98: 000b80a330000000 \.403 pop_count1\[gprB_0\] ++ ca0: 000c80a3b0000000 \.404 pop_count2\[gprB_0\] ++ ca8: 000731a180000000 \.405 pop_count3\[gprA_0, gprB_0\], no_cc, predicate_cc ++ cb0: 000480e8000c0000 \.406 rtn\[gprA_0\] ++ cb8: 000620e8000a0700 \.407 rtn\[n\$reg_1\] ++ cc0: 000600e800088300 \.408 rtn\[\*l\$index1\] ++ cc8: 000a64e800080300 \.409 rtn\[\*l\$index2\] ++ cd0: 000dc0e800200300 \.410 rtn\[gprB_0\], defer\[2\] ++ cd8: 0008a0a0300c0700 \.411 alu\[--, --, B, 0x1\] ++ ce0: 0004a0a0300c0b00 \.412 alu\[--, --, B, 0x2\] ++ ce8: 000000f0000c0300 \.413 nop ++ cf0: 000000f0000c0300 \.414 nop ++ cf8: 000000f0000c0300 \.415 nop ++ d00: 000000f0000c0300 \.416 nop ++ d08: 0003501842300c09 \.417 arm\[read, \$xfer_3, gprA_9, gprB_3, 2\], ctx_swap\[sig4\] ++ d10: 0005501842302403 \.418 arm\[read, \$xfer_3, gprA_3, gprB_9, 2\], ctx_swap\[sig4\] ++ d18: 0004801842300c09 \.419 arm\[read, \$xfer_3, gprA_9, <<8, gprB_3, 2\], ctx_swap\[sig4\] ++ d20: 000f241842302403 \.420 arm\[read, \$xfer_3, gprB_9, <<8, gprA_3, 2\], ctx_swap\[sig4\] ++ d28: 0004a0a0300c0b00 \.421 alu\[--, --, B, 0x2\] ++ d30: 0008861842302403 \.422 arm\[read, \$xfer_3, gprB_9, <<8, gprA_3, 2\], indirect_ref, ctx_swap\[sig4\] ++ d38: 0004a0a0300c0b00 \.423 alu\[--, --, B, 0x2\] ++ d40: 000e8618e2302703 \.424 arm\[read, \$xfer_3, gprB_9, <<8, gprA_3, 2\], indirect_ref, sig_done\[sig14\] ++ d48: 0007841842302503 \.425 arm\[read, \$xfer_3, gprB_9, <<8, gprA_3, 2\], ctx_swap\[sig4\], defer\[1\] ++ d50: 0008a0a0300c0700 \.426 alu\[--, --, B, 0x1\] ++ d58: 000f101843c00c09 \.427 arm\[read, \$xfer_28, gprA_9, gprB_3, 2\], ctx_swap\[sig4\] ++ d60: 000910184e800c09 \.428 arm\[read, \$xfer_8, gprA_9, gprB_3, 8\], ctx_swap\[sig4\] ++ d68: 000a106440800c09 \.429 cls\[add, \$xfer_8, gprA_9, gprB_3, 1\], ctx_swap\[sig4\] ++ d70: 0000f0664080a009 \.430 cls\[sub, \$xfer_8, gprA_9, 0x8, 1\], ctx_swap\[sig4\] ++ d78: 000160644284a009 \.431 cls\[add64, \$xfer_8, gprA_9, <<8, 0x8, 2\], ctx_swap\[sig4\] ++ d80: 000404664284a408 \.432 cls\[sub64, \$xfer_8, 0x9, <<8, gprA_8, 2\], ctx_swap\[sig4\] ++ d88: 0008a0a0300c0700 \.433 alu\[--, --, B, 0x1\] ++ d90: 00032c650340a708 \.434 cls\[add_imm, 0x14, 0x9, <<8, gprA_8, 2\] ++ d98: 0007506040880c09 \.435 cls\[swap/test_compare_write, \$xfer_8, gprA_9, gprB_3, 1\], ctx_swap\[sig4\] ++ da0: 00023c6500007f9a \.436 cls\[add_imm, 0x1f9a, --, 1\] ++ da8: 000038653c583f14 \.437 cls\[add_imm, 0xf14, 0xf16\] ++ db0: 000b54640013c30f \.438 cls\[add, \$xfer_1, 0xf00f, 1\] ++ db8: 0002901c10a08000 \.439 ct\[xpb_read, \$xfer_10, gprA_0, 0x0, 1\], ctx_swap\[sig1\] ++ dc0: 0007501e10a48000 \.440 ct\[reflect_read_sig_init, \$xfer_10, gprA_0, 0x0, 1\], ctx_swap\[sig1\] ++ dc8: 000a501c10a48000 \.441 ct\[ring_get, \$xfer_10, gprA_0, 0x0, 1\], ctx_swap\[sig1\] ++ dd0: 000000f0000c0300 \.442 nop ++ dd8: 000cc0474a80a009 \.443 mem\[add64, \$xfer_8, gprA_9, <<8, 0x8, 6\], ctx_swap\[sig4\] ++ de0: 000d40404280a009 \.444 mem\[read, \$xfer_8, gprA_9, <<8, 0x8, 2\], ctx_swap\[sig4\] ++ de8: 000c405c4280a009 \.445 mem\[read32, \$xfer_8, gprA_9, <<8, 0x8, 2\], ctx_swap\[sig4\] ++ df0: 000ea0554280a009 \.446 mem\[ctm\.pe_dma_to_memory_indirect/emem\.get/imem\.lb_bucket_read_local, \$xfer_8, gprA_9, <<8, 0x8, 2\], ctx_swap\[sig4\] ++ df8: 0009204c408ca309 \.447 mem\[lock128/lock384, \$xfer_8, gprA_9, <<8, 0x8, 1\], sig_done\[sig4\] ++ e00: 000f20e000000030 \.448 ctx_arb\[sig4, sig5\] ++ e08: 0000a04c488ca309 \.449 mem\[lock256/lock512, \$xfer_8, gprA_9, <<8, 0x8, 5\], sig_done\[sig4\] ++ e10: 000f20e000000030 \.450 ctx_arb\[sig4, sig5\] ++ e18: 000ae04d4084a009 \.451 mem\[microq128_pop, \$xfer_8, gprA_9, <<8, 0x8, 1\], ctx_swap\[sig4\] ++ e20: 0002204d4080a009 \.452 mem\[microq128_get, \$xfer_8, gprA_9, <<8, 0x8, 1\], ctx_swap\[sig4\] ++ e28: 000ba04d4880a009 \.453 mem\[microq256_get, \$xfer_8, gprA_9, <<8, 0x8, 5\], ctx_swap\[sig4\] ++ e30: 0003805700028309 \.454 mem\[ctm\.pe_dma_from_memory_buffer/emem\.fast_journal/imem\.lb_push_stats_local, \$xfer_0, gprA_9, <<8, 0x40, 1\] ++ e38: 0005e04e4000a309 \.455 mem\[queue128_lock, \$xfer_0, gprA_9, <<8, 0x8, 1\], sig_done\[sig4\] ++ e40: 000f20e000000030 \.456 ctx_arb\[sig4, sig5\] ++ e48: 0001a04e0004a309 \.457 mem\[queue128_unlock, \$xfer_0, gprA_9, <<8, 0x8, 1\] ++ e50: 000c604e4800a309 \.458 mem\[queue256_lock, \$xfer_0, gprA_9, <<8, 0x8, 5\], sig_done\[sig4\] ++ e58: 000f20e000000030 \.459 ctx_arb\[sig4, sig5\] ++ e60: 0008204e0804a309 \.460 mem\[queue256_unlock, \$xfer_0, gprA_9, <<8, 0x8, 5\] ++ e68: 0008a05000001309 \.461 mem\[ctm\.packet_wait_packet_status/emem\.rd_qdesc/imem\.stats_log, \$xfer_0, gprA_9, <<8, gprB_4, 1\] ++ e70: 000b840092200c02 \.462 ila\[read, \$xfer_2, gprB_3, <<8, gprA_2, 2\], ctx_swap\[sig9\] ++ e78: 0005440182240f02 \.463 ila\[write_check_error, \$xfer_2, gprB_3, <<8, gprA_2, 2\], sig_done\[sig8\] ++ e80: 000d60e000000300 \.464 ctx_arb\[sig8, sig9\] ++ e88: 0007800410600000 \.465 nbi\[read, \$xfer_6, gprA_0, <<8, gprB_0, 1\], ctx_swap\[sig1\] ++ e90: 0002600c62000000 \.466 pcie\[read, \$xfer_0, gprA_0, <<8, gprB_0, 2\], ctx_swap\[sig6\] ++ e98: 0004c40d62000000 \.467 pcie\[write, \$xfer_0, gprB_0, <<8, gprA_0, 2\], ctx_swap\[sig6\] ++ ea0: 000d601462000000 \.468 crypto\[read, \$xfer_0, gprA_0, <<8, gprB_0, 2\], ctx_swap\[sig6\] ++ ea8: 0006601562000000 \.469 crypto\[write, \$xfer_0, gprA_0, <<8, gprB_0, 2\], ctx_swap\[sig6\] ++ eb0: 0000601662000000 \.470 crypto\[write_fifo, \$xfer_0, gprA_0, <<8, gprB_0, 2\], ctx_swap\[sig6\] ++ eb8: 000d840d60000050 \.471 pcie\[write, \$xfer_0, gprB_0, <<8, \*l\$index0, 1\], ctx_swap\[sig6\] ++ ec0: 0009e40d60000058 \.472 pcie\[write, \$xfer_0, gprB_0, <<8, \*l\$index1, 1\], ctx_swap\[sig6\] ++ ec8: 0009040d60000059 \.473 pcie\[write, \$xfer_0, gprB_0, <<8, \*l\$index1\[1\], 1\], ctx_swap\[sig6\] ++ ed0: 000000f0000c0300 \.474 nop ++ ed8: 000000f0000c0300 \.475 nop ++ ee0: 000000f0000c0300 \.476 nop ++ ee8: 000000f0000c0300 \.477 nop ++ ef0: 000000f0000c0300 \.478 nop ++ ef8: 000060a900301340 \.479 crc_be\[crc_ccitt, gprA_3, gprB_4\] ++ f00: 000000f0000c0300 \.480 nop ++ f08: 000e20b9403d0004 \.481 crc_be\[crc_ccitt, gprB_3, gprA_4\] ++ f10: 000000f0000c0300 \.482 nop ++ f18: 000400a900301348 \.483 crc_le\[crc_ccitt, gprA_3, gprB_4\] ++ f20: 000000f0000c0300 \.484 nop ++ f28: 000400b9403d2004 \.485 crc_le\[crc_ccitt, gprB_3, gprA_4\] ++ f30: 000000f0000c0300 \.486 nop ++ f38: 0002e0b900301348 \.487 crc_le\[crc_ccitt, gprB_3, gprB_4\] ++ f40: 000000f0000c0300 \.488 nop ++ f48: 0002e0a9403d2004 \.489 crc_le\[crc_ccitt, gprA_3, gprA_4\] ++ f50: 000000f0000c0300 \.490 nop ++ f58: 000220e000020000 \.491 ctx_arb\[bpt\] ++ f60: 000420e000010000 \.492 ctx_arb\[kill\] ++ ++Disassembly of section \.text\.i33\.me9: ++ ++0000000000000000 <\.text\.i33\.me9>: ++ 0: 000540f0012cd000 \.0 immed\[gprA_0, 0x1234\] ++ 8: 0002c0f0012cd280 \.1 immed\[n\$reg_0, 0x1234\] ++ 10: 000220f0012cd281 \.2 immed\[n\$reg_1, 0x1234\] ++ 18: 000660f0012cd200 \.3 immed\[\*l\$index0, 0x1234\] ++ 20: 0007c0f0012cd220 \.4 immed\[\*l\$index1, 0x1234\] ++ 28: 000fa0f0012cd230 \.5 immed\[\*l\$index1\+\+, 0x1234\] ++ 30: 000f40f0012cd231 \.6 immed\[\*l\$index1--, 0x1234\] ++ 38: 0008c8f0012cd200 \.7 immed\[\*l\$index2, 0x1234\] ++ 40: 0000a8f0012cd210 \.8 immed\[\*l\$index2\+\+, 0x1234\] ++ 48: 000048f0012cd211 \.9 immed\[\*l\$index2--, 0x1234\] ++ 50: 000968f0012cd220 \.10 immed\[\*l\$index3, 0x1234\] ++ 58: 0007e0f0012cd203 \.11 immed\[\*l\$index0\[3\], 0x1234\] ++ 60: 000540f0012cd225 \.12 immed\[\*l\$index1\[5\], 0x1234\] ++ 68: 000b28f0012cd207 \.13 immed\[\*l\$index2\[7\], 0x1234\] ++ 70: 000de8f0012cd229 \.14 immed\[\*l\$index3\[9\], 0x1234\] ++ 78: 000000f00ff003ff \.15 immed\[gprB_0, 0xffff\] ++ 80: 000d60f220000bff \.16 immed_b1\[gprB_2, 0xff\] ++ 88: 000f60f6200007ff \.17 immed_b3\[gprB_1, 0xff\] ++ 90: 000080f080000f00 \.18 immed\[gprB_3, 0xffffffff\] ++ 98: 000100f086600f77 \.19 immed\[gprB_3, 0xffff9988\] ++ a0: 000940f0012cd180 \.20 immed\[\$xfer_0, 0x1234\] ++ a8: 000a00f0043c8581 \.21 immed\[\$xfer_1, 0x4321\] ++ b0: 000b40f0056de19e \.22 immed\[\$xfer_30, 0x5678\] ++ b8: 0007c0f0400e8401 \.23 immed_w0\[gprA_1, 0xa1\] ++ c0: 000440f4400e8802 \.24 immed_w1\[gprA_2, 0xa2\] ++ c8: 000d00f4000e8c03 \.25 immed\[gprA_3, 0xa3, <<16\] ++ d0: 000520f001200334 \.26 immed\[gprB_0, 0x1234\] ++ d8: 000fa0f0400007b1 \.27 immed_w0\[gprB_1, 0xb1\] ++ e0: 000c20f440000bb2 \.28 immed_w1\[gprB_2, 0xb2\] ++ e8: 000560f400000fb3 \.29 immed\[gprB_3, 0xb3, <<16\] ++ f0: 000660f200000fb3 \.30 immed\[gprB_3, 0xb3, <<8\] ++ f8: 0001b0f200000fb3 \.31 immed\[gprB_3, 0xb3, <<8\], predicate_cc ++ 100: 0001c2f200000fb3 \.32 immed\[gprB_3, 0xb3, <<8\], gpr_wrboth ++ 108: 000ba0a0300c2f00 \.33 alu\[--, --, B, 0xb\] ++ 110: 0005a081f200da00 \.34 alu_shf\[--, --, B, 0x16, <<1\] ++ 118: 000be081d2018600 \.35 alu_shf\[--, --, B, 0x21, <<3\] ++ 120: 000240801201b200 \.36 alu_shf\[--, --, B, 0x2c, <<31\] ++ 128: 000fa081f800da00 \.37 alu_shf\[\$xfer_0, --, B, 0x16, <<1\] ++ 130: 0009e081f840da00 \.38 alu_shf\[\$xfer_4, --, B, 0x16, <<1\] ++ 138: 0009a081f980da00 \.39 alu_shf\[\$xfer_24, --, B, 0x16, <<1\] ++ 140: 0003e081f9f0da00 \.40 alu_shf\[\$xfer_31, --, B, 0x16, <<1\] ++ 148: 0004a0a0280c2f00 \.41 alu\[n\$reg_0, --, B, 0xb\] ++ 150: 0001e0a0281c2f00 \.42 alu\[n\$reg_1, --, B, 0xb\] ++ 158: 000880a0a00c2400 \.43 alu\[\*l\$index0, gprA_0, \+, 0x9\] ++ 160: 000100a0a43c2400 \.44 alu\[\*n\$index\+\+, gprA_0, \+, 0x9\] ++ 168: 000b208bc500a600 \.45 alu_shf\[\*l\$index0, gprA_0, OR, 0x9, <<4\] ++ 170: 000b00a0a20c2400 \.46 alu\[\*l\$index1, gprA_0, \+, 0x9\] ++ 178: 000740a0a30c2400 \.47 alu\[\*l\$index1\+\+, gprA_0, \+, 0x9\] ++ 180: 000200a0a31c2400 \.48 alu\[\*l\$index1--, gprA_0, \+, 0x9\] ++ 188: 000628a0a00c2400 \.49 alu\[\*l\$index2, gprA_0, \+, 0x9\] ++ 190: 000988aa210c2400 \.50 alu\[\*l\$index2\+\+, gprA_0, OR, 0x9\] ++ 198: 000f28a0a11c2400 \.51 alu\[\*l\$index2--, gprA_0, \+, 0x9\] ++ 1a0: 0005a8a0a20c2400 \.52 alu\[\*l\$index3, gprA_0, \+, 0x9\] ++ 1a8: 000480a0a03c2400 \.53 alu\[\*l\$index0\[3\], gprA_0, \+, 0x9\] ++ 1b0: 000800a0a25c2400 \.54 alu\[\*l\$index1\[5\], gprA_0, \+, 0x9\] ++ 1b8: 000c68a0a07c2400 \.55 alu\[\*l\$index2\[7\], gprA_0, \+, 0x9\] ++ 1c0: 000aa8a0a29c2400 \.56 alu\[\*l\$index3\[9\], gprA_0, \+, 0x9\] ++ 1c8: 000cc4b0c008a400 \.57 alu\[gprB_0, \*l\$index3\[9\], \+, gprA_0\] ++ 1d0: 000fe4b0c008c000 \.58 alu\[gprB_0, \*l\$index3\+\+, \+, gprA_0\] ++ 1d8: 000ac4b0c008c400 \.59 alu\[gprB_0, \*l\$index3--, \+, gprA_0\] ++ 1e0: 000bc4b080000229 \.60 alu\[gprB_0, \*l\$index3\[9\], \+, gprB_0\] ++ 1e8: 000724b080000230 \.61 alu\[gprB_0, \*l\$index3\+\+, \+, gprB_0\] ++ 1f0: 0007c4b080000231 \.62 alu\[gprB_0, \*l\$index3--, \+, gprB_0\] ++ 1f8: 000664b080000211 \.63 alu\[gprB_0, \*l\$index2--, \+, gprB_0\] ++ 200: 000a60b080000231 \.64 alu\[gprB_0, \*l\$index1--, \+, gprB_0\] ++ 208: 000bc0b080000211 \.65 alu\[gprB_0, \*l\$index0--, \+, gprB_0\] ++ 210: 000340b080000200 \.66 alu\[gprB_0, \*l\$index0, \+, gprB_0\] ++ 218: 000ee4b080000200 \.67 alu\[gprB_0, \*l\$index2, \+, gprB_0\] ++ 220: 000100b080000241 \.68 alu\[gprB_0, \*n\$index, \+, gprB_0\] ++ 228: 0004809bf0000241 \.69 alu_shf\[gprB_0, \*n\$index, OR, gprB_0, <<1\] ++ 230: 000f20a0001fff00 \.70 alu\[gprA_1, --, B, 0xff\] ++ 238: 0005c0b0002fff00 \.71 alu\[gprB_2, --, B, 0xff\] ++ 240: 000940a0000d6f00 \.72 alu\[gprA_0, --, B, 0x5b\] ++ 248: 000440a2000d6f00 \.73 alu\[gprA_0, --, ~B, 0x5b\] ++ 250: 000de081f032f200 \.74 alu_shf\[gprA_3, --, B, 0x5c, <<1\] ++ 258: 000de091d012f600 \.75 alu_shf\[gprB_1, --, B, 0x5d, <<3\] ++ 260: 000d60901022fa00 \.76 alu_shf\[gprB_2, --, B, 0x5e, <<31\] ++ 268: 000e40a0c0000402 \.77 alu\[gprA_0, gprB_1, \+, gprA_2\] ++ 270: 000340a2c0000402 \.78 alu\[gprA_0, gprB_1, \+16, gprA_2\] ++ 278: 000040a4c0000402 \.79 alu\[gprA_0, gprB_1, \+8, gprA_2\] ++ 280: 0007a0a8c0000402 \.80 alu\[gprA_0, gprB_1, \+carry, gprA_2\] ++ 288: 000d40a6c0000402 \.81 alu\[gprA_0, gprB_1, -carry, gprA_2\] ++ 290: 000aa0aac0000402 \.82 alu\[gprA_0, gprB_1, -, gprA_2\] ++ 298: 0009a0acc0000402 \.83 alu\[gprA_0, gprB_1, B-A, gprA_2\] ++ 2a0: 000da0aa40000402 \.84 alu\[gprA_0, gprB_1, OR, gprA_2\] ++ 2a8: 000740a440000402 \.85 alu\[gprA_0, gprB_1, AND, gprA_2\] ++ 2b0: 000a40a640000402 \.86 alu\[gprA_0, gprB_1, ~AND, gprA_2\] ++ 2b8: 0000a0a840000402 \.87 alu\[gprA_0, gprB_1, AND~, gprA_2\] ++ 2c0: 000ea0ac40000402 \.88 alu\[gprA_0, gprB_1, XOR, gprA_2\] ++ 2c8: 000321a0c0000402 \.89 alu\[gprA_0, gprB_1, \+, gprA_2\], no_cc ++ 2d0: 000990a0c0000402 \.90 alu\[gprA_0, gprB_1, \+, gprA_2\], predicate_cc ++ 2d8: 0009e2a0c0000402 \.91 alu\[gprA_0, gprB_1, \+, gprA_2\], gpr_wrboth ++ 2e0: 000353a0c0000402 \.92 alu\[gprA_0, gprB_1, \+, gprA_2\], no_cc, gpr_wrboth, predicate_cc ++ 2e8: 000d418b70080602 \.93 alu_shf\[gprA_0, gprB_1, OR, gprA_2, <<9\], no_cc ++ 2f0: 0006708a90080502 \.94 alu_shf\[gprA_0, gprB_1, OR, gprA_2, >>9\], predicate_cc ++ 2f8: 000ea28a90080402 \.95 alu_shf\[gprA_0, gprB_1, OR, gprA_2, >>rot9\], gpr_wrboth ++ 300: 000e138b70080402 \.96 alu_shf\[gprA_0, gprB_1, OR, gprA_2, >>rot23\], no_cc, gpr_wrboth, predicate_cc ++ 308: 000ba08a00080602 \.97 alu_shf\[gprA_0, gprB_1, OR, gprA_2, <>indirect\] ++ 318: 000ba0a0300c2f00 \.99 alu\[--, --, B, 0xb\] ++ 320: 000ae09d40380101 \.100 asr\[gprB_3, gprA_1, >>20\] ++ 328: 000ba0a0300c2f00 \.101 alu\[--, --, B, 0xb\] ++ 330: 000ea09d40310500 \.102 asr\[gprB_3, \*n\$index, >>20\] ++ 338: 000ba0a0300c2f00 \.103 alu\[--, --, B, 0xb\] ++ 340: 0007a09d40314100 \.104 asr\[gprB_3, \*l\$index0, >>20\] ++ 348: 000ba0a0300c2f00 \.105 alu\[--, --, B, 0xb\] ++ 350: 0000249d40316100 \.106 asr\[gprB_3, \*l\$index3, >>20\] ++ 358: 000ba0a0300c2f00 \.107 alu\[--, --, B, 0xb\] ++ 360: 000a049d40314100 \.108 asr\[gprB_3, \*l\$index2, >>20\] ++ 368: 000ba0a0300c2f00 \.109 alu\[--, --, B, 0xb\] ++ 370: 0004a08d45010d00 \.110 asr\[\*l\$index0, \*n\$index\+\+, >>20\] ++ 378: 000ba0a0300c2f00 \.111 alu\[--, --, B, 0xb\] ++ 380: 000ee08d45810d00 \.112 asr\[\*l\$index1, \*n\$index\+\+, >>20\] ++ 388: 000ba0a0300c2f00 \.113 alu\[--, --, B, 0xb\] ++ 390: 000a088d45010d00 \.114 asr\[\*l\$index2, \*n\$index\+\+, >>20\] ++ 398: 000ba0a0300c2f00 \.115 alu\[--, --, B, 0xb\] ++ 3a0: 0007819d40380101 \.116 asr\[gprB_3, gprA_1, >>20\], no_cc ++ 3a8: 000ba0a0300c2f00 \.117 alu\[--, --, B, 0xb\] ++ 3b0: 000d309d40380101 \.118 asr\[gprB_3, gprA_1, >>20\], predicate_cc ++ 3b8: 000ba0a0300c2f00 \.119 alu\[--, --, B, 0xb\] ++ 3c0: 000ba28d40380101 \.120 asr\[gprA_3, gprA_1, >>20\], gpr_wrboth ++ 3c8: 0008c0d818c08120 \.121 beq\[\.99\] ++ 3d0: 000d00d877c08120 \.122 beq\[\.479\] ++ 3d8: 000440d877e08120 \.123 beq\[\.479\], defer\[2\] ++ 3e0: 000000f0000c0300 \.124 nop ++ 3e8: 000000f0000c0300 \.125 nop ++ 3f0: 000540d877c08021 \.126 bne\[\.479\] ++ 3f8: 0004c0d877c08022 \.127 bmi\[\.479\] ++ 400: 000420d877c08023 \.128 bpl\[\.479\] ++ 408: 0007c0d877c08024 \.129 bcs\[\.479\] ++ 410: 0007c0d877c08024 \.130 bcs\[\.479\] ++ 418: 000720d877c08025 \.131 bcc\[\.479\] ++ 420: 000720d877c08025 \.132 bcc\[\.479\] ++ 428: 0006a0d877c08026 \.133 bvs\[\.479\] ++ 430: 000640d877c08027 \.134 bvc\[\.479\] ++ 438: 0001c0d877c08028 \.135 bge\[\.479\] ++ 440: 000120d877c08029 \.136 blt\[\.479\] ++ 448: 000040d877c0802b \.137 bgt\[\.479\] ++ 450: 0000a0d877c0802a \.138 ble\[\.479\] ++ 458: 000c60d818c08038 \.139 br\[\.99\] ++ 460: 000920d818d08038 \.140 br\[\.99\], defer\[1\] ++ 468: 000000f0000c0300 \.141 nop ++ 470: 000bc0d077c09000 \.142 br_bclr\[gprA_0, 3, \.479\] ++ 478: 000980d077c0e004 \.143 br_bclr\[gprA_4, 23, \.479\] ++ 480: 0002a0d077c0082c \.144 br_bclr\[gprB_2, 11, \.479\] ++ 488: 000300d077c02423 \.145 br_bclr\[gprB_9, 2, \.479\] ++ 490: 000260d077c02421 \.146 br_bclr\[gprB_9, 0, \.479\] ++ 498: 000280d077c02420 \.147 br_bclr\[gprB_9, 31, \.479\] ++ 4a0: 000f00d077f02423 \.148 br_bclr\[gprB_9, 2, \.479\], defer\[3\] ++ 4a8: 000000f0000c0300 \.149 nop ++ 4b0: 000000f0000c0300 \.150 nop ++ 4b8: 000000f0000c0300 \.151 nop ++ 4c0: 000680d077c42c2b \.152 br_bset\[gprB_11, 10, \.479\] ++ 4c8: 0006e0d077c4ac0b \.153 br_bset\[gprA_11, 10, \.479\] ++ 4d0: 0002a0c877d81020 \.154 br=byte\[gprB_4, 0, 0x0, \.479\], defer\[1\] ++ 4d8: 000000f0000c0300 \.155 nop ++ 4e0: 000a60c877c81520 \.156 br=byte\[gprB_5, 1, 0x0, \.479\] ++ 4e8: 0001e0c877c81620 \.157 br=byte\[gprB_5, 2, 0x0, \.479\] ++ 4f0: 0001a4c877c94220 \.158 br=byte\[\*l\$index2, 2, 0x0, \.479\] ++ 4f8: 000620c877c96220 \.159 br=byte\[\*l\$index1, 2, 0x0, \.479\] ++ 500: 000540c877c81b20 \.160 br=byte\[gprB_6, 3, 0x0, \.479\] ++ 508: 0000c0c877cc16ff \.161 br=byte\[gprB_5, 2, 0xff, \.479\] ++ 510: 000420c877c816a2 \.162 br=byte\[gprB_5, 2, 0x42, \.479\] ++ 518: 000380c877c416ff \.163 br!=byte\[gprB_5, 2, 0xff, \.479\] ++ 520: 0002a0c877c01620 \.164 br!=byte\[gprB_5, 2, 0x0, \.479\] ++ 528: 000c20d877c00236 \.165 br_cls_state\[cls_ring0_status, \.479\] ++ 530: 0001a0d877e20236 \.166 br_cls_state\[cls_ring8_status, \.479\], defer\[2\] ++ 538: 000000f0000c0300 \.167 nop ++ 540: 000000f0000c0300 \.168 nop ++ 548: 000be0d877c38236 \.169 br_cls_state\[cls_ring14_status, \.479\] ++ 550: 0007c0d877c3c236 \.170 br_cls_state\[cls_ring15_status, \.479\] ++ 558: 000720d877c3c237 \.171 br_!cls_state\[cls_ring15_status, \.479\] ++ 560: 000cc0d877c00237 \.172 br_!cls_state\[cls_ring0_status, \.479\] ++ 568: 000c00d877c00030 \.173 br=ctx\[0, \.479\] ++ 570: 000dc0d877c08030 \.174 br=ctx\[2, \.479\] ++ 578: 000f00d877c18030 \.175 br=ctx\[6, \.479\] ++ 580: 000a40d877d18030 \.176 br=ctx\[6, \.479\], defer\[1\] ++ 588: 000000f0000c0300 \.177 nop ++ 590: 000d40d877c00234 \.178 br_inp_state\[nn_empty, \.479\] ++ 598: 000160d877c04234 \.179 br_inp_state\[nn_full, \.479\] ++ 5a0: 000c80d877c08234 \.180 br_inp_state\[ctm_ring0_status, \.479\] ++ 5a8: 000100d877e28234 \.181 br_inp_state\[ctm_ring8_status, \.479\], defer\[2\] ++ 5b0: 000000f0000c0300 \.182 nop ++ 5b8: 000000f0000c0300 \.183 nop ++ 5c0: 000a80d877c38234 \.184 br_inp_state\[ctm_ring12_status, \.479\] ++ 5c8: 0006a0d877c3c234 \.185 br_inp_state\[ctm_ring13_status, \.479\] ++ 5d0: 000640d877c3c235 \.186 br_!inp_state\[ctm_ring13_status, \.479\] ++ 5d8: 000c60d877c08235 \.187 br_!inp_state\[ctm_ring0_status, \.479\] ++ 5e0: 000260d877c04232 \.188 br_signal\[1, \.479\] ++ 5e8: 000f80d877c08232 \.189 br_signal\[2, \.479\] ++ 5f0: 0005a0d877c3c232 \.190 br_signal\[15, \.479\] ++ 5f8: 000540d877c3c233 \.191 br_!signal\[15, \.479\] ++ 600: 000b60d877f2c232 \.192 br_signal\[11, \.479\], defer\[3\] ++ 608: 000000f0000c0300 \.193 nop ++ 610: 000000f0000c0300 \.194 nop ++ 618: 000000f0000c0300 \.195 nop ++ 620: 000e40a0c0000402 \.196 alu\[gprA_0, gprB_1, \+, gprA_2\] ++ 628: 0004408e02081200 \.197 byte_align_le\[--, gprB_4\] ++ 630: 0008c08e00981200 \.198 byte_align_le\[gprA_9, gprB_4\] ++ 638: 0004c08e00a81200 \.199 byte_align_le\[gprA_10, gprB_4\] ++ 640: 0001808e00b81200 \.200 byte_align_le\[gprA_11, gprB_4\] ++ 648: 000e40a0c0000402 \.201 alu\[gprA_0, gprB_1, \+, gprA_2\] ++ 650: 000c808e02001100 \.202 byte_align_be\[--, gprB_4\] ++ 658: 0000008e00901100 \.203 byte_align_be\[gprA_9, gprB_4\] ++ 660: 000c008e00a01100 \.204 byte_align_be\[gprA_10, gprB_4\] ++ 668: 0009408e00b01100 \.205 byte_align_be\[gprA_11, gprB_4\] ++ 670: 000d80a0300c0300 \.206 alu\[--, --, B, 0x0\] ++ 678: 000400a5b00c0000 \.207 cam_clear ++ 680: 000360bb80900007 \.208 cam_lookup\[gprB_9, gprA_7\] ++ 688: 0003a0bb80900200 \.209 cam_lookup\[gprB_9, \*l\$index0\] ++ 690: 000e04bb80900200 \.210 cam_lookup\[gprB_9, \*l\$index2\] ++ 698: 000f84bb80900203 \.211 cam_lookup\[gprB_9, \*l\$index2\[3\]\] ++ 6a0: 000bc0bb80900210 \.212 cam_lookup\[gprB_9, \*l\$index0\+\+\] ++ 6a8: 000280aba0000241 \.213 cam_lookup\[\*l\$index0, \*n\$index\] ++ 6b0: 000ec0aba1000241 \.214 cam_lookup\[\*l\$index0\+\+, \*n\$index\] ++ 6b8: 000288aba3000243 \.215 cam_lookup\[\*l\$index3\+\+, \*n\$index\+\+\] ++ 6c0: 000aa0aba0200243 \.216 cam_lookup\[\*l\$index0\[2\], \*n\$index\+\+\] ++ 6c8: 000060bb80901407 \.217 cam_lookup\[gprB_9, gprA_7\], lm_addr0\[1\] ++ 6d0: 000060bb80902807 \.218 cam_lookup\[gprB_9, gprA_7\], lm_addr1\[2\] ++ 6d8: 000660bb80907407 \.219 cam_lookup\[gprB_9, gprA_7\], lm_addr2\[3\] ++ 6e0: 000660bb80904807 \.220 cam_lookup\[gprB_9, gprA_7\], lm_addr3\[0\] ++ 6e8: 000222ab80900007 \.221 cam_lookup\[gprA_9, gprA_7\], gpr_wrboth ++ 6f0: 0004b0bb80900007 \.222 cam_lookup\[gprB_9, gprA_7\], predicate_cc ++ 6f8: 000a00a7809c0000 \.223 cam_read_tag\[gprA_9, 0x0\] ++ 700: 000da2a7809c0000 \.224 cam_read_tag\[gprA_9, 0x0\], gpr_wrboth ++ 708: 000dd0a7809c0000 \.225 cam_read_tag\[gprA_9, 0x0\], predicate_cc ++ 710: 000900a7809c2800 \.226 cam_read_tag\[gprA_9, 0xa\] ++ 718: 000a00a7809c3c00 \.227 cam_read_tag\[gprA_9, 0xf\] ++ 720: 0003e0af809c0000 \.228 cam_read_state\[gprA_9, 0x0\] ++ 728: 000442af809c0000 \.229 cam_read_state\[gprA_9, 0x0\], gpr_wrboth ++ 730: 000392af809c0000 \.230 cam_read_state\[gprA_9, 0x0\], gpr_wrboth, predicate_cc ++ 738: 0000e0af809c2800 \.231 cam_read_state\[gprA_9, 0xa\] ++ 740: 0003e0af809c3c00 \.232 cam_read_state\[gprA_9, 0xf\] ++ 748: 000920a9f0101700 \.233 cam_write\[0x0, gprB_5, 1\] ++ 750: 000da0a9f01a0300 \.234 cam_write\[0x0, n\$reg_0, 1\] ++ 758: 000e80a9f0190700 \.235 cam_write\[0x0, \*n\$index, 1\] ++ 760: 0004c4a9f0180300 \.236 cam_write\[0x0, \*l\$index2, 1\] ++ 768: 0008e4a9f0184300 \.237 cam_write\[0x0, \*l\$index2\+\+, 1\] ++ 770: 000dc4a9f0184700 \.238 cam_write\[0x0, \*l\$index2--, 1\] ++ 778: 000840a9f0b01704 \.239 cam_write\[0x4, gprB_5, 11\] ++ 780: 000be0a9f0f0170f \.240 cam_write\[0xf, gprB_5, 15\] ++ 788: 0008a0adb01c0000 \.241 cam_write_state\[0x0, 1\] ++ 790: 000d80adb0bc1000 \.242 cam_write_state\[0x4, 11\] ++ 798: 000de0adb0fc3c00 \.243 cam_write_state\[0xf, 15\] ++ 7a0: 0000c0fc142c000d \.244 local_csr_wr\[CRCRemainder, gprA_13\] ++ 7a8: 000d20a918060348 \.245 crc_le\[crc_ccitt, \$xfer_0, \$xfer_0\] ++ 7b0: 000000f0000c0300 \.246 nop ++ 7b8: 000d40a918160748 \.247 crc_le\[crc_ccitt, \$xfer_1, \$xfer_1\] ++ 7c0: 000000f0000c0300 \.248 nop ++ 7c8: 000d40a918260b48 \.249 crc_le\[crc_ccitt, \$xfer_2, \$xfer_2\] ++ 7d0: 000000f0000c0300 \.250 nop ++ 7d8: 000d20a918360f48 \.251 crc_le\[crc_ccitt, \$xfer_3, \$xfer_3\] ++ 7e0: 000000f0000c0300 \.252 nop ++ 7e8: 000000f0000c0300 \.253 nop ++ 7f0: 000000f0000c0300 \.254 nop ++ 7f8: 000000f0000c0300 \.255 nop ++ 800: 000000f0000c0300 \.256 nop ++ 808: 000f60fc140c0000 \.257 local_csr_rd\[CRCRemainder\] ++ 810: 000ce0f0000c000e \.258 immed\[gprA_14, 0x0\] ++ 818: 000940a918060340 \.259 crc_be\[crc_ccitt, \$xfer_0, \$xfer_0\] ++ 820: 000000f0000c0300 \.260 nop ++ 828: 000920a918461340 \.261 crc_be\[crc_ccitt, \$xfer_4, \$xfer_4\] ++ 830: 000000f0000c0300 \.262 nop ++ 838: 000060a900061340 \.263 crc_be\[crc_ccitt, gprA_0, \$xfer_4\] ++ 840: 000000f0000c0300 \.264 nop ++ 848: 000c60a900001340 \.265 crc_be\[crc_ccitt, gprA_0, gprB_4\] ++ 850: 000000f0000c0300 \.266 nop ++ 858: 000000f0000c0300 \.267 nop ++ 860: 000000f0000c0300 \.268 nop ++ 868: 000000f0000c0300 \.269 nop ++ 870: 000000f0000c0300 \.270 nop ++ 878: 000600a918260380 \.271 crc_be\[crc_32, \$xfer_2, \$xfer_0\] ++ 880: 000000f0000c0300 \.272 nop ++ 888: 0004c0a9183613a0 \.273 crc_be\[crc_iscsi, \$xfer_3, \$xfer_4\] ++ 890: 000000f0000c0300 \.274 nop ++ 898: 0004c0a9000613c0 \.275 crc_be\[crc_10, gprA_0, \$xfer_4\] ++ 8a0: 000000f0000c0300 \.276 nop ++ 8a8: 000960a9000013e0 \.277 crc_be\[crc_5, gprA_0, gprB_4\] ++ 8b0: 000000f0000c0300 \.278 nop ++ 8b8: 000ea0a918862700 \.279 crc_be\[--, \$xfer_8, \$xfer_9\] ++ 8c0: 000000f0000c0300 \.280 nop ++ 8c8: 000240a918760784 \.281 crc_be\[crc_32, \$xfer_7, \$xfer_1\], bytes_0_2 ++ 8d0: 000000f0000c0300 \.282 nop ++ 8d8: 0002a0a918760785 \.283 crc_be\[crc_32, \$xfer_7, \$xfer_1\], bytes_0_1 ++ 8e0: 000000f0000c0300 \.284 nop ++ 8e8: 000320a918760786 \.285 crc_be\[crc_32, \$xfer_7, \$xfer_1\], byte_0 ++ 8f0: 000000f0000c0300 \.286 nop ++ 8f8: 0000c0a918760781 \.287 crc_be\[crc_32, \$xfer_7, \$xfer_1\], bytes_1_3 ++ 900: 000000f0000c0300 \.288 nop ++ 908: 000140a918760782 \.289 crc_be\[crc_32, \$xfer_7, \$xfer_1\], bytes_2_3 ++ 910: 000000f0000c0300 \.290 nop ++ 918: 0001a0a918760783 \.291 crc_be\[crc_32, \$xfer_7, \$xfer_1\], byte_3 ++ 920: 000000f0000c0300 \.292 nop ++ 928: 000782a900160780 \.293 crc_be\[crc_32, gprA_1, \$xfer_1\], gpr_wrboth ++ 930: 000000f0000c0300 \.294 nop ++ 938: 000ae3a900160780 \.295 crc_be\[crc_32, gprA_1, \$xfer_1\], no_cc, gpr_wrboth ++ 940: 000000f0000c0300 \.296 nop ++ 948: 000b73a900560780 \.297 crc_be\[crc_32, gprA_5, \$xfer_1\], no_cc, gpr_wrboth, predicate_cc ++ 950: 000000f0000c0300 \.298 nop ++ 958: 000122a900560781 \.299 crc_be\[crc_32, gprA_5, \$xfer_1\], bytes_1_3, gpr_wrboth ++ 960: 000000f0000c0300 \.300 nop ++ 968: 000000f0000c0300 \.301 nop ++ 970: 000000f0000c0300 \.302 nop ++ 978: 000000f0000c0300 \.303 nop ++ 980: 000000f0000c0300 \.304 nop ++ 988: 000000f0000c0300 \.305 nop ++ 990: 0005a0e000080000 \.306 ctx_arb\[--\] ++ 998: 000600e000000001 \.307 ctx_arb\[voluntary\] ++ 9a0: 000220e000020000 \.308 ctx_arb\[bpt\] ++ 9a8: 000460e000000220 \.309 ctx_arb\[sig5, sig9\] ++ 9b0: 000d20e000200220 \.310 ctx_arb\[sig5, sig9\], defer\[2\] ++ 9b8: 000180a0300c0f00 \.311 alu\[--, --, B, 0x3\] ++ 9c0: 0007a0a0300c1f00 \.312 alu\[--, --, B, 0x7\] ++ 9c8: 0006a0e000010220 \.313 ctx_arb\[sig5, sig9\], any ++ 9d0: 000a60e077c40220 \.314 ctx_arb\[sig5, sig9\], br\[\.479\] ++ 9d8: 0006409010500701 \.315 dbl_shf\[gprB_5, gprA_1, gprB_1, >>1\] ++ 9e0: 000d4090a0500701 \.316 dbl_shf\[gprB_5, gprA_1, gprB_1, >>10\] ++ 9e8: 000c4091f0500701 \.317 dbl_shf\[gprB_5, gprA_1, gprB_1, >>31\] ++ 9f0: 000740a440000402 \.318 alu\[gprA_0, gprB_1, AND, gprA_2\] ++ 9f8: 0000c09000500701 \.319 dbl_shf\[gprB_5, gprA_1, gprB_1, >>indirect\] ++ a00: 000b219010500701 \.320 dbl_shf\[gprB_5, gprA_1, gprB_1, >>1\], no_cc ++ a08: 000cf19010500701 \.321 dbl_shf\[gprB_5, gprA_1, gprB_1, >>1\], no_cc, predicate_cc ++ a10: 0000d28010500701 \.322 dbl_shf\[gprA_5, gprA_1, gprB_1, >>1\], gpr_wrboth, predicate_cc ++ a18: 000200a700f03f00 \.323 ffs\[gprA_15, gprB_15\] ++ a20: 000fe0b740fc000f \.324 ffs\[gprB_15, gprA_15\] ++ a28: 000ec0b700f61300 \.325 ffs\[gprB_15, \$xfer_4\] ++ a30: 000660b700f88300 \.326 ffs\[gprB_15, \*l\$index1\] ++ a38: 0007e4b700f8c300 \.327 ffs\[gprB_15, \*l\$index3\+\+\] ++ a40: 0002c4b700f8c700 \.328 ffs\[gprB_15, \*l\$index3--\] ++ a48: 0004c4b700f8a700 \.329 ffs\[gprB_15, \*l\$index3\[9\]\] ++ a50: 000880a720000300 \.330 ffs\[\*l\$index0, gprB_0\] ++ a58: 000108a722090700 \.331 ffs\[\*l\$index3, \*n\$index\] ++ a60: 000128a723190f00 \.332 ffs\[\*l\$index3--, \*n\$index\+\+\] ++ a68: 0003c3a740fc000f \.333 ffs\[gprA_15, gprA_15\], no_cc, gpr_wrboth ++ a70: 000972a740fc000f \.334 ffs\[gprA_15, gprA_15\], gpr_wrboth, predicate_cc ++ a78: 000320f0000c0803 \.335 immed\[gprA_3, 0x2\] ++ a80: 000480e8004d4803 \.336 jump\[gprA_3, \.338\] ++ a88: 0006a0d854408038 \.337 br\[\.337\] ++ a90: 000460f000002701 \.338 immed\[gprB_9, 0x1\] ++ a98: 0006a0d854408038 \.339 br\[\.337\] ++ aa0: 0005e0f000002702 \.340 immed\[gprB_9, 0x2\] ++ aa8: 0006a0d854408038 \.341 br\[\.337\] ++ ab0: 000500f000002703 \.342 immed\[gprB_9, 0x3\] ++ ab8: 0006a0d854408038 \.343 br\[\.337\] ++ ac0: 000040c001000000 \.344 ld_field\[gprA_0, 0001, gprB_0\] ++ ac8: 0007e2c001000000 \.345 ld_field\[gprA_0, 0001, gprB_0\], gpr_wrboth ++ ad0: 000e40c401000000 \.346 ld_field\[gprA_0, 0001, gprB_0\], load_cc ++ ad8: 000790c001000000 \.347 ld_field\[gprA_0, 0001, gprB_0\], predicate_cc ++ ae0: 0005c0c005000000 \.348 ld_field\[gprA_0, 0101, gprB_0\] ++ ae8: 000080c005100000 \.349 ld_field_w_clr\[gprA_0, 0101, gprB_0\] ++ af0: 0002a2c001100000 \.350 ld_field_w_clr\[gprA_0, 0001, gprB_0\], gpr_wrboth ++ af8: 000b00c401100000 \.351 ld_field_w_clr\[gprA_0, 0001, gprB_0\], load_cc ++ b00: 0002d0c001100000 \.352 ld_field_w_clr\[gprA_0, 0001, gprB_0\], predicate_cc ++ b08: 000fc0c00f000000 \.353 ld_field\[gprA_0, 1111, gprB_0\] ++ b10: 0005e0c1fb000200 \.354 ld_field\[gprA_0, 1011, gprB_0, <<1\] ++ b18: 000460c01b000100 \.355 ld_field\[gprA_0, 1011, gprB_0, >>1\] ++ b20: 000e60c1fb000100 \.356 ld_field\[gprA_0, 1011, gprB_0, >>31\] ++ b28: 000bc0c09b000000 \.357 ld_field\[gprA_0, 1011, gprB_0, >>rot9\] ++ b30: 000e80c09b100000 \.358 ld_field_w_clr\[gprA_0, 1011, gprB_0, >>rot9\] ++ b38: 0001c0c17b000000 \.359 ld_field\[gprA_0, 1011, gprB_0, >>rot23\] ++ b40: 0002c0c41b000000 \.360 ld_field\[gprA_0, 1011, gprB_0, >>rot1\], load_cc ++ b48: 000780c41b100000 \.361 ld_field_w_clr\[gprA_0, 1011, gprB_0, >>rot1\], load_cc ++ b50: 000400f0001f7c01 \.362 immed\[gprA_1, 0x1df\] ++ b58: 000200f0001007df \.363 immed\[gprB_1, 0x1df\] ++ b60: 0005a2f0001007df \.364 immed\[gprB_1, 0x1df\], gpr_wrboth ++ b68: 0005d0f0001007df \.365 immed\[gprB_1, 0x1df\], predicate_cc ++ b70: 000020fc010c0000 \.366 local_csr_rd\[ALUOut\] ++ b78: 000e60f0000c000b \.367 immed\[gprA_11, 0x0\] ++ b80: 000ce0fc160c0000 \.368 local_csr_rd\[MiscControl\] ++ b88: 000e60f0000c000b \.369 immed\[gprA_11, 0x0\] ++ b90: 000ae0fc076c0b02 \.370 local_csr_wr\[XferIndex, 0x2\] ++ b98: 0008a0fc076c0003 \.371 local_csr_wr\[XferIndex, gprA_3\] ++ ba0: 000520fc07600f00 \.372 local_csr_wr\[XferIndex, gprB_3\] ++ ba8: 000f20fc01a00f00 \.373 local_csr_wr\[CtxEnables, gprB_3\] ++ bb0: 000480f800000c02 \.374 mul_step\[gprA_2, gprB_3\], start ++ bb8: 000880f980000c02 \.375 mul_step\[gprA_2, gprB_3\], 32x32_step1 ++ bc0: 000dc0f980100c02 \.376 mul_step\[gprA_2, gprB_3\], 32x32_step2 ++ bc8: 0001c0f980200c02 \.377 mul_step\[gprA_2, gprB_3\], 32x32_step3 ++ bd0: 000480f980300c02 \.378 mul_step\[gprA_2, gprB_3\], 32x32_step4 ++ bd8: 000940f9804c0002 \.379 mul_step\[gprA_2, --\], 32x32_last ++ be0: 000ce0f9805c0003 \.380 mul_step\[gprA_3, --\], 32x32_last2 ++ be8: 0001a0f800000802 \.381 mul_step\[gprA_2, gprB_2\], start ++ bf0: 000aa0f900000802 \.382 mul_step\[gprA_2, gprB_2\], 16x16_step1 ++ bf8: 000fe0f900100802 \.383 mul_step\[gprA_2, gprB_2\], 16x16_step2 ++ c00: 000f20f9004c0000 \.384 mul_step\[gprA_0, --\], 16x16_last ++ c08: 0001a0f800000802 \.385 mul_step\[gprA_2, gprB_2\], start ++ c10: 0006a0f880000802 \.386 mul_step\[gprA_2, gprB_2\], 24x8_step1 ++ c18: 000320f8804c0000 \.387 mul_step\[gprA_0, --\], 24x8_last ++ c20: 0001a0f800000802 \.388 mul_step\[gprA_2, gprB_2\], start ++ c28: 0006a0f880000802 \.389 mul_step\[gprA_2, gprB_2\], 24x8_step1 ++ c30: 0004f0f8804c0000 \.390 mul_step\[gprA_0, --\], 24x8_last, predicate_cc ++ c38: 0001a0f800000802 \.391 mul_step\[gprA_2, gprB_2\], start ++ c40: 0006a0f880000802 \.392 mul_step\[gprA_2, gprB_2\], 24x8_step1 ++ c48: 0009e3f8804c0000 \.393 mul_step\[gprA_0, --\], 24x8_last, no_cc, gpr_wrboth ++ c50: 000b80a330000000 \.394 pop_count1\[gprB_0\] ++ c58: 000c80a3b0000000 \.395 pop_count2\[gprB_0\] ++ c60: 000d80a180000000 \.396 pop_count3\[gprA_0, gprB_0\] ++ c68: 000b80a330000000 \.397 pop_count1\[gprB_0\] ++ c70: 000c80a3b0000000 \.398 pop_count2\[gprB_0\] ++ c78: 000743a180000000 \.399 pop_count3\[gprA_0, gprB_0\], no_cc, gpr_wrboth ++ c80: 0004a4a330088000 \.400 pop_count1\[\*l\$index3\] ++ c88: 0003a4a3b0088000 \.401 pop_count2\[\*l\$index3\] ++ c90: 0000e5a1a438c000 \.402 pop_count3\[\*n\$index\+\+, \*l\$index3\+\+\], no_cc ++ c98: 000b80a330000000 \.403 pop_count1\[gprB_0\] ++ ca0: 000c80a3b0000000 \.404 pop_count2\[gprB_0\] ++ ca8: 000731a180000000 \.405 pop_count3\[gprA_0, gprB_0\], no_cc, predicate_cc ++ cb0: 000480e8000c0000 \.406 rtn\[gprA_0\] ++ cb8: 000620e8000a0700 \.407 rtn\[n\$reg_1\] ++ cc0: 000600e800088300 \.408 rtn\[\*l\$index1\] ++ cc8: 000a64e800080300 \.409 rtn\[\*l\$index2\] ++ cd0: 000dc0e800200300 \.410 rtn\[gprB_0\], defer\[2\] ++ cd8: 0008a0a0300c0700 \.411 alu\[--, --, B, 0x1\] ++ ce0: 0004a0a0300c0b00 \.412 alu\[--, --, B, 0x2\] ++ ce8: 000000f0000c0300 \.413 nop ++ cf0: 000000f0000c0300 \.414 nop ++ cf8: 000000f0000c0300 \.415 nop ++ d00: 000000f0000c0300 \.416 nop ++ d08: 0003501842300c09 \.417 arm\[read, \$xfer_3, gprA_9, gprB_3, 2\], ctx_swap\[sig4\] ++ d10: 0005501842302403 \.418 arm\[read, \$xfer_3, gprA_3, gprB_9, 2\], ctx_swap\[sig4\] ++ d18: 0004801842300c09 \.419 arm\[read, \$xfer_3, gprA_9, <<8, gprB_3, 2\], ctx_swap\[sig4\] ++ d20: 000f241842302403 \.420 arm\[read, \$xfer_3, gprB_9, <<8, gprA_3, 2\], ctx_swap\[sig4\] ++ d28: 0004a0a0300c0b00 \.421 alu\[--, --, B, 0x2\] ++ d30: 0008861842302403 \.422 arm\[read, \$xfer_3, gprB_9, <<8, gprA_3, 2\], indirect_ref, ctx_swap\[sig4\] ++ d38: 0004a0a0300c0b00 \.423 alu\[--, --, B, 0x2\] ++ d40: 000e8618e2302703 \.424 arm\[read, \$xfer_3, gprB_9, <<8, gprA_3, 2\], indirect_ref, sig_done\[sig14\] ++ d48: 0007841842302503 \.425 arm\[read, \$xfer_3, gprB_9, <<8, gprA_3, 2\], ctx_swap\[sig4\], defer\[1\] ++ d50: 0008a0a0300c0700 \.426 alu\[--, --, B, 0x1\] ++ d58: 000f101843c00c09 \.427 arm\[read, \$xfer_28, gprA_9, gprB_3, 2\], ctx_swap\[sig4\] ++ d60: 000910184e800c09 \.428 arm\[read, \$xfer_8, gprA_9, gprB_3, 8\], ctx_swap\[sig4\] ++ d68: 000a106440800c09 \.429 cls\[add, \$xfer_8, gprA_9, gprB_3, 1\], ctx_swap\[sig4\] ++ d70: 0000f0664080a009 \.430 cls\[sub, \$xfer_8, gprA_9, 0x8, 1\], ctx_swap\[sig4\] ++ d78: 000160644284a009 \.431 cls\[add64, \$xfer_8, gprA_9, <<8, 0x8, 2\], ctx_swap\[sig4\] ++ d80: 000404664284a408 \.432 cls\[sub64, \$xfer_8, 0x9, <<8, gprA_8, 2\], ctx_swap\[sig4\] ++ d88: 0008a0a0300c0700 \.433 alu\[--, --, B, 0x1\] ++ d90: 00032c650340a708 \.434 cls\[add_imm, 0x14, 0x9, <<8, gprA_8, 2\] ++ d98: 0007506040880c09 \.435 cls\[swap/test_compare_write, \$xfer_8, gprA_9, gprB_3, 1\], ctx_swap\[sig4\] ++ da0: 00023c6500007f9a \.436 cls\[add_imm, 0x1f9a, --, 1\] ++ da8: 000038653c583f14 \.437 cls\[add_imm, 0xf14, 0xf16\] ++ db0: 000b54640013c30f \.438 cls\[add, \$xfer_1, 0xf00f, 1\] ++ db8: 0002901c10a08000 \.439 ct\[xpb_read, \$xfer_10, gprA_0, 0x0, 1\], ctx_swap\[sig1\] ++ dc0: 0007501e10a48000 \.440 ct\[reflect_read_sig_init, \$xfer_10, gprA_0, 0x0, 1\], ctx_swap\[sig1\] ++ dc8: 000a501c10a48000 \.441 ct\[ring_get, \$xfer_10, gprA_0, 0x0, 1\], ctx_swap\[sig1\] ++ dd0: 000000f0000c0300 \.442 nop ++ dd8: 000cc0474a80a009 \.443 mem\[add64, \$xfer_8, gprA_9, <<8, 0x8, 6\], ctx_swap\[sig4\] ++ de0: 000d40404280a009 \.444 mem\[read, \$xfer_8, gprA_9, <<8, 0x8, 2\], ctx_swap\[sig4\] ++ de8: 000c405c4280a009 \.445 mem\[read32, \$xfer_8, gprA_9, <<8, 0x8, 2\], ctx_swap\[sig4\] ++ df0: 000ea0554280a009 \.446 mem\[ctm\.pe_dma_to_memory_indirect/emem\.get/imem\.lb_bucket_read_local, \$xfer_8, gprA_9, <<8, 0x8, 2\], ctx_swap\[sig4\] ++ df8: 0009204c408ca309 \.447 mem\[lock128/lock384, \$xfer_8, gprA_9, <<8, 0x8, 1\], sig_done\[sig4\] ++ e00: 000f20e000000030 \.448 ctx_arb\[sig4, sig5\] ++ e08: 0000a04c488ca309 \.449 mem\[lock256/lock512, \$xfer_8, gprA_9, <<8, 0x8, 5\], sig_done\[sig4\] ++ e10: 000f20e000000030 \.450 ctx_arb\[sig4, sig5\] ++ e18: 000ae04d4084a009 \.451 mem\[microq128_pop, \$xfer_8, gprA_9, <<8, 0x8, 1\], ctx_swap\[sig4\] ++ e20: 0002204d4080a009 \.452 mem\[microq128_get, \$xfer_8, gprA_9, <<8, 0x8, 1\], ctx_swap\[sig4\] ++ e28: 000ba04d4880a009 \.453 mem\[microq256_get, \$xfer_8, gprA_9, <<8, 0x8, 5\], ctx_swap\[sig4\] ++ e30: 0003805700028309 \.454 mem\[ctm\.pe_dma_from_memory_buffer/emem\.fast_journal/imem\.lb_push_stats_local, \$xfer_0, gprA_9, <<8, 0x40, 1\] ++ e38: 0005e04e4000a309 \.455 mem\[queue128_lock, \$xfer_0, gprA_9, <<8, 0x8, 1\], sig_done\[sig4\] ++ e40: 000f20e000000030 \.456 ctx_arb\[sig4, sig5\] ++ e48: 0001a04e0004a309 \.457 mem\[queue128_unlock, \$xfer_0, gprA_9, <<8, 0x8, 1\] ++ e50: 000c604e4800a309 \.458 mem\[queue256_lock, \$xfer_0, gprA_9, <<8, 0x8, 5\], sig_done\[sig4\] ++ e58: 000f20e000000030 \.459 ctx_arb\[sig4, sig5\] ++ e60: 0008204e0804a309 \.460 mem\[queue256_unlock, \$xfer_0, gprA_9, <<8, 0x8, 5\] ++ e68: 0008a05000001309 \.461 mem\[ctm\.packet_wait_packet_status/emem\.rd_qdesc/imem\.stats_log, \$xfer_0, gprA_9, <<8, gprB_4, 1\] ++ e70: 000b840092200c02 \.462 ila\[read, \$xfer_2, gprB_3, <<8, gprA_2, 2\], ctx_swap\[sig9\] ++ e78: 0005440182240f02 \.463 ila\[write_check_error, \$xfer_2, gprB_3, <<8, gprA_2, 2\], sig_done\[sig8\] ++ e80: 000d60e000000300 \.464 ctx_arb\[sig8, sig9\] ++ e88: 0007800410600000 \.465 nbi\[read, \$xfer_6, gprA_0, <<8, gprB_0, 1\], ctx_swap\[sig1\] ++ e90: 0002600c62000000 \.466 pcie\[read, \$xfer_0, gprA_0, <<8, gprB_0, 2\], ctx_swap\[sig6\] ++ e98: 0004c40d62000000 \.467 pcie\[write, \$xfer_0, gprB_0, <<8, gprA_0, 2\], ctx_swap\[sig6\] ++ ea0: 000d601462000000 \.468 crypto\[read, \$xfer_0, gprA_0, <<8, gprB_0, 2\], ctx_swap\[sig6\] ++ ea8: 0006601562000000 \.469 crypto\[write, \$xfer_0, gprA_0, <<8, gprB_0, 2\], ctx_swap\[sig6\] ++ eb0: 0000601662000000 \.470 crypto\[write_fifo, \$xfer_0, gprA_0, <<8, gprB_0, 2\], ctx_swap\[sig6\] ++ eb8: 000d840d60000050 \.471 pcie\[write, \$xfer_0, gprB_0, <<8, \*l\$index0, 1\], ctx_swap\[sig6\] ++ ec0: 0009e40d60000058 \.472 pcie\[write, \$xfer_0, gprB_0, <<8, \*l\$index1, 1\], ctx_swap\[sig6\] ++ ec8: 0009040d60000059 \.473 pcie\[write, \$xfer_0, gprB_0, <<8, \*l\$index1\[1\], 1\], ctx_swap\[sig6\] ++ ed0: 000000f0000c0300 \.474 nop ++ ed8: 000000f0000c0300 \.475 nop ++ ee0: 000000f0000c0300 \.476 nop ++ ee8: 000000f0000c0300 \.477 nop ++ ef0: 000000f0000c0300 \.478 nop ++ ef8: 000060a900301340 \.479 crc_be\[crc_ccitt, gprA_3, gprB_4\] ++ f00: 000000f0000c0300 \.480 nop ++ f08: 000e20b9403d0004 \.481 crc_be\[crc_ccitt, gprB_3, gprA_4\] ++ f10: 000000f0000c0300 \.482 nop ++ f18: 000400a900301348 \.483 crc_le\[crc_ccitt, gprA_3, gprB_4\] ++ f20: 000000f0000c0300 \.484 nop ++ f28: 000400b9403d2004 \.485 crc_le\[crc_ccitt, gprB_3, gprA_4\] ++ f30: 000000f0000c0300 \.486 nop ++ f38: 0002e0b900301348 \.487 crc_le\[crc_ccitt, gprB_3, gprB_4\] ++ f40: 000000f0000c0300 \.488 nop ++ f48: 0002e0a9403d2004 \.489 crc_le\[crc_ccitt, gprA_3, gprA_4\] ++ f50: 000000f0000c0300 \.490 nop ++ f58: 000220e000020000 \.491 ctx_arb\[bpt\] ++ f60: 000420e000010000 \.492 ctx_arb\[kill\] +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/binutils/testsuite/binutils-all/nfp/test2_ctx8.d 2019-03-07 14:44:05.716268317 +0000 +@@ -0,0 +1,16 @@ ++ ++.*: file format elf64-nfp ++ ++ ++Disassembly of section \.text\.i32\.me0: ++ ++0000000000000000 <\.text\.i32\.me0>: ++ 0: 000d80a0300c0300 \.0 alu\[--, --, B, 0x0\] ++ 8: 0008a0a0300c0700 \.1 alu\[--, --, B, 0x1\] ++ 10: 0004a0a0300c0b00 \.2 alu\[--, --, B, 0x2\] ++ 18: 000180a0300c0f00 \.3 alu\[--, --, B, 0x3\] ++ 20: 0004a0a018cc1300 \.4 alu\[\$xfer_12, --, B, 0x4\] ++ 28: 0001c0a019fc1700 \.5 alu\[\$xfer_15, --, B, 0x5\] ++ 30: 000400a0b00c198c \.6 alu\[--, \$xfer_12, \+, 0x6\] ++ 38: 0008c0a0b00c1d9f \.7 alu\[--, \$xfer_15, \+, 0x7\] ++ 40: 000220e000020000 \.8 ctx_arb\[bpt\] +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/binutils/testsuite/binutils-all/nfp/test2_no-pc_ctx4.d 2019-03-07 14:44:05.716268317 +0000 +@@ -0,0 +1,16 @@ ++ ++.*: file format elf64-nfp ++ ++ ++Disassembly of section \.text\.i32\.me0: ++ ++0000000000000000 <\.text\.i32\.me0>: ++ 0: 000d80a0300c0300 alu\[--, --, B, 0x0\] ++ 8: 0008a0a0300c0700 alu\[--, --, B, 0x1\] ++ 10: 0004a0a0300c0b00 alu\[--, --, B, 0x2\] ++ 18: 000180a0300c0f00 alu\[--, --, B, 0x3\] ++ 20: 0004a0a018cc1300 alu\[\$xfer_12, --, B, 0x4\] ++ 28: 0001c0a019fc1700 alu\[\$xfer_31, --, B, 0x5\] ++ 30: 000400a0b00c198c alu\[--, \$xfer_12, \+, 0x6\] ++ 38: 0008c0a0b00c1d9f alu\[--, \$xfer_31, \+, 0x7\] ++ 40: 000220e000020000 ctx_arb\[bpt\] +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/include/elf/nfp.h 2019-03-07 14:44:05.716268317 +0000 +@@ -0,0 +1,292 @@ ++/* NFP ELF support for BFD. ++ Copyright (C) 2017-2018 Free Software Foundation, Inc. ++ Contributed by Francois H. Theron ++ ++ This file is part of BFD, the Binary File Descriptor library. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software Foundation, ++ Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++#ifndef _ELF_NFP_H ++#define _ELF_NFP_H ++ ++#include "bfd.h" ++#include "elf/common.h" ++#include "elf/reloc-macros.h" ++#include "bfd_stdint.h" ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++#define ET_NFP_PARTIAL_REL (ET_LOPROC + ET_REL) ++#define ET_NFP_PARTIAL_EXEC (ET_LOPROC + ET_EXEC) ++ ++/* NFP e_flags - chip family ++ Valid values for FAMILY are: ++ 0x3200 - NFP-32xx ++ 0x6000 - NFP-6xxx/NFP-4xxx. */ ++#define EF_NFP_MACH(ef_nfp) (((ef_nfp) >> 8) & 0xFFFF) ++#define EF_NFP_SET_MACH(nfp_fam) (((nfp_fam) & 0xFFFF) << 8) ++ ++#define E_NFP_MACH_3200 0x3200 ++#define E_NFP_MACH_6000 0x6000 ++ ++#define NFP_3200_CPPTGT_MSF0 1 ++#define NFP_3200_CPPTGT_QDR 2 ++#define NFP_3200_CPPTGT_MSF1 3 ++#define NFP_3200_CPPTGT_HASH 4 ++#define NFP_3200_CPPTGT_MU 7 ++#define NFP_3200_CPPTGT_GS 8 ++#define NFP_3200_CPPTGT_PCIE 9 ++#define NFP_3200_CPPTGT_ARM 10 ++#define NFP_3200_CPPTGT_CRYPTO 12 ++#define NFP_3200_CPPTGT_CAP 13 ++#define NFP_3200_CPPTGT_CT 14 ++#define NFP_3200_CPPTGT_CLS 15 ++ ++#define NFP_6000_CPPTGT_NBI 1 ++#define NFP_6000_CPPTGT_VQDR 2 ++#define NFP_6000_CPPTGT_ILA 6 ++#define NFP_6000_CPPTGT_MU 7 ++#define NFP_6000_CPPTGT_PCIE 9 ++#define NFP_6000_CPPTGT_ARM 10 ++#define NFP_6000_CPPTGT_CRYPTO 12 ++#define NFP_6000_CPPTGT_CTXPB 14 ++#define NFP_6000_CPPTGT_CLS 15 ++ ++/* NFP Section types ++ MECONFIG - NFP-32xx only, ME CSR configurations ++ INITREG - A generic register initialisation section (chip or ME CSRs/GPRs) ++ UDEBUG - Legacy-style debug data section. */ ++#define SHT_NFP_MECONFIG (SHT_LOPROC + 1) ++#define SHT_NFP_INITREG (SHT_LOPROC + 2) ++#define SHT_NFP_UDEBUG SHT_LOUSER ++ ++/* NFP SECTION flags ++ ELF-64 sh_flags is 64-bit, but there is no info on what the upper 32 bits ++ are expected to be used for, it is not marked reserved either. ++ We'll use them for NFP-specific flags since we don't use ELF-32. ++ ++ INIT - Sections that are loaded and executed before the final text ++ microcode. Non-code INIT sections are loaded first, then other ++ memory secions, then INIT2 sections, then INIT-code sections. ++ INIT2 - Sections that are loaded before INIT-code sections, used for ++ transient configuration before executing INIT-code section ++ microcode. ++ SCS - The number of additional ME codestores being shared with the group's ++ base ME of the section, e.g. 0 for no SCS, 1 for dual and 3 for ++ quad. If this is 0 it is possible that stagger-style SCS codestore ++ sections are being used. For stagger-style each section is simply ++ loaded directly to the ME it is assigned to. If these flags are ++ used, virtual address space loading will be used - one large section ++ loaded to the group's base ME will be packed across shared MEs by ++ hardware. This is not available on all ME versions. ++ ++ NFP_ELF_SHF_GET_SCS (val) returns the number of additional codestores ++ being shared with the group's base ME, e.g. 0 for no SCS, ++ 1 for dual SCS, 3 for quad SCS. */ ++ ++#define SHF_NFP_INIT 0x80000000 ++#define SHF_NFP_INIT2 0x40000000 ++#define SHF_NFP_SCS(shf) (((shf) >> 32) & 0xFF) ++#define SHF_NFP_SET_SCS(v) (((BFD_HOST_U_64_BIT)((v) & 0xFF)) << 32) ++ ++/* NFP Section Info ++ For PROGBITS and NOBITS sections: ++ MEMTYPE - the memory type ++ DOMAIN - The island ID and ME number where the data will be loaded. ++ For NFP-32xx, this is an island number or linear ME number. ++ For NFP-6xxx, DOMAIN<15:8> == island ID, DOMAIN<7:0> is 0 based ++ ME number (if applicable). ++ For INITREG sections: ++ ISLAND - island ID (if it's a ME target, ME numbers are in the ++ section data) ++ CPPTGT - CPP Target ID ++ CPPACTRD - CPP Read Action ++ CPPTOKRD - CPP Read Token ++ CPPACTWR - CPP Write Action ++ CPPTOKWR - CPP Write Token ++ ORDER - Controls the order in which the loader processes sections with ++ the same info fields. */ ++ ++#define SHI_NFP_DOMAIN(shi) (((shi) >> 16) & 0xFFFF) ++#define SHI_NFP_MEMTYPE(shi) ( (shi) & 0xFFFF) ++#define SHI_NFP_SET_DOMAIN(v) (((v) & 0xFFFF) << 16) ++#define SHI_NFP_SET_MEMTYPE(v) ( (v) & 0xFFFF) ++ ++#define SHI_NFP_IREG_ISLAND(shi) (((shi) >> 26) & 0x3F) ++#define SHI_NFP_IREG_CPPTGT(shi) (((shi) >> 22) & 0xF) ++#define SHI_NFP_IREG_CPPACTRD(shi) (((shi) >> 17) & 0x1F) ++#define SHI_NFP_IREG_CPPTOKRD(shi) (((shi) >> 15) & 0x3) ++#define SHI_NFP_IREG_CPPACTWR(shi) (((shi) >> 10) & 0x1F) ++#define SHI_NFP_IREG_CPPTOKWR(shi) (((shi) >> 8) & 0x3) ++#define SHI_NFP_IREG_ORDER(shi) ( (shi) & 0xFF) ++#define SHI_NFP_SET_IREG_ISLAND(v) (((v) & 0x3F) << 26) ++#define SHI_NFP_SET_IREG_CPPTGT(v) (((v) & 0xF) << 22) ++#define SHI_NFP_SET_IREG_CPPACTRD(v) (((v) & 0x1F) << 17) ++#define SHI_NFP_SET_IREG_CPPTOKRD(v) (((v) & 0x3) << 15) ++#define SHI_NFP_SET_IREG_CPPACTWR(v) (((v) & 0x1F) << 10) ++#define SHI_NFP_SET_IREG_CPPTOKWR(v) (((v) & 0x3) << 8) ++#define SHI_NFP_SET_IREG_ORDER(v) ( (v) & 0xFF) ++ ++/* CtXpb/reflect_read_sig_init/reflect_write_sig_init ++ identifies Init-CSR sections for ME CSRs. */ ++#define SHI_NFP_6000_IS_IREG_MECSR(shi) ( \ ++ SHI_NFP_IREG_CPPTGT (shi) == NFP_6000_CPPTGT_CTXPB \ ++ && SHI_NFP_IREG_CPPACTRD (shi) == 2 \ ++ && SHI_NFP_IREG_CPPTOKRD (shi) == 1 \ ++ && SHI_NFP_IREG_CPPACTWR (shi) == 3 \ ++ && SHI_NFP_IREG_CPPTOKWR (shi) == 1 \ ++) ++ ++/* Transient INITREG sections will be validated against the target ++ but will not be kept - validate, write or read and discard. ++ They will still be handled last (in order). */ ++#define SHI_NFP_IREG_ORDER_TRANSIENT 0xFF ++ ++/* Below are some extra macros to translate SHI fields in more specific ++ contexts. ++ ++ For NFP-32xx, DOMAIN is set to a global linear ME number (0 to 39). ++ An NFP-32xx has 8 MEs per island and up to 5 islands. */ ++ ++#define SHI_NFP_3200_ISLAND(shi) ((SHI_NFP_DOMAIN (shi) >> 3) & 0x7) ++#define SHI_NFP_3200_MENUM(shi) ( SHI_NFP_DOMAIN (shi) & 0x7) ++#define SHI_NFP_SET_3200_ISLAND(v) SHI_NFP_SET_DOMAIN (((v) & 0x7) << 3) ++#define SHI_NFP_SET_3200_MENUM(v) SHI_NFP_SET_DOMAIN ( (v) & 0x7) ++ ++#define SHI_NFP_ISLAND(shi) ((SHI_NFP_DOMAIN (shi) >> 8) & 0xFF) ++#define SHI_NFP_MENUM(shi) ( SHI_NFP_DOMAIN (shi) & 0xFF) ++#define SHI_NFP_SET_ISLAND(shi) SHI_NFP_SET_DOMAIN (((shi) & 0xFF) << 8) ++#define SHI_NFP_SET_MENUM(shi) SHI_NFP_SET_DOMAIN ( (shi) & 0xFF) ++ ++#define SHI_NFP_MEMTYPE_NONE 0 ++#define SHI_NFP_MEMTYPE_USTORE 1 ++#define SHI_NFP_MEMTYPE_LMEM 2 ++#define SHI_NFP_MEMTYPE_CLS 3 ++#define SHI_NFP_MEMTYPE_DRAM 4 ++#define SHI_NFP_MEMTYPE_MU 4 ++#define SHI_NFP_MEMTYPE_SRAM 5 ++#define SHI_NFP_MEMTYPE_GS 6 ++#define SHI_NFP_MEMTYPE_PPC_LMEM 7 ++#define SHI_NFP_MEMTYPE_PPC_SMEM 8 ++#define SHI_NFP_MEMTYPE_EMU_CACHE 9 ++ ++/* VTP_FORCE is for use by the NFP Linker+Loader only. */ ++#define NFP_IREG_VTP_FORCE 0 ++#define NFP_IREG_VTP_CONST 1 ++#define NFP_IREG_VTP_REQUIRED 2 ++#define NFP_IREG_VTP_VOLATILE_INIT 3 ++#define NFP_IREG_VTP_VOLATILE_NOINIT 4 ++#define NFP_IREG_VTP_INVALID 5 ++ ++/* Init-CSR entry w0 fields: ++ NLW - Not Last Word ++ CTX - ME context number (if applicable) ++ VTP - Value type ++ COH - CPP Offset High 8 bits. */ ++#define NFP_IREG_ENTRY_WO_NLW(w0) (((w0) >> 31) & 0x1) ++#define NFP_IREG_ENTRY_WO_CTX(w0) (((w0) >> 28) & 0x7) ++#define NFP_IREG_ENTRY_WO_VTP(w0) (((w0) >> 25) & 0x7) ++#define NFP_IREG_ENTRY_WO_COH(w0) (((w0) >> 0) & 0xFF) ++ ++typedef struct ++{ ++ uint32_t w0; ++ uint32_t cpp_offset_lo; ++ uint32_t val; ++ uint32_t mask; ++} Elf_Nfp_InitRegEntry; ++ ++typedef struct ++{ ++ uint32_t ctx_enables; ++ uint32_t entry; ++ uint32_t misc_control; ++ uint32_t reserved; ++} Elf_Nfp_MeConfig; ++ ++/* Relocations. */ ++START_RELOC_NUMBERS (elf_nfp3200_reloc_type) ++ RELOC_NUMBER (R_NFP3200_NOTYPE, 0) ++ RELOC_NUMBER (R_NFP3200_W32LE, 1) ++ RELOC_NUMBER (R_NFP3200_SRC8_A, 2) ++ RELOC_NUMBER (R_NFP3200_SRC8_B, 3) ++ RELOC_NUMBER (R_NFP3200_IMMED8_I, 4) ++ RELOC_NUMBER (R_NFP3200_SC, 5) ++ RELOC_NUMBER (R_NFP3200_IMMED_LO16_I_A, 6) ++ RELOC_NUMBER (R_NFP3200_IMMED_LO16_I_B, 7) ++ RELOC_NUMBER (R_NFP3200_SRC7_B, 8) ++ RELOC_NUMBER (R_NFP3200_SRC7_A, 9) ++ RELOC_NUMBER (R_NFP3200_SRC8_I_B, 10) ++ RELOC_NUMBER (R_NFP3200_SRC8_I_A, 11) ++ RELOC_NUMBER (R_NFP3200_IMMED_HI16_I_A, 12) ++ RELOC_NUMBER (R_NFP3200_IMMED_HI16_I_B, 13) ++ RELOC_NUMBER (R_NFP3200_RSVD_0, 14) ++ RELOC_NUMBER (R_NFP3200_RSVD_1, 15) ++ RELOC_NUMBER (R_NFP3200_RSVD_2, 16) ++ RELOC_NUMBER (R_NFP3200_RSVD_3, 17) ++ RELOC_NUMBER (R_NFP3200_RSVD_4, 18) ++ RELOC_NUMBER (R_NFP3200_RSVD_5, 19) ++ RELOC_NUMBER (R_NFP3200_RSVD_6, 20) ++ RELOC_NUMBER (R_NFP3200_W64LE, 21) ++ RELOC_NUMBER (R_NFP3200_W32BE, 22) ++ RELOC_NUMBER (R_NFP3200_W64BE, 23) ++ RELOC_NUMBER (R_NFP3200_W32LE_AND, 24) ++ RELOC_NUMBER (R_NFP3200_W32BE_AND, 25) ++ RELOC_NUMBER (R_NFP3200_W32LE_OR, 26) ++ RELOC_NUMBER (R_NFP3200_W32BE_OR, 27) ++ RELOC_NUMBER (R_NFP3200_W64LE_AND, 28) ++ RELOC_NUMBER (R_NFP3200_W64BE_AND, 29) ++ RELOC_NUMBER (R_NFP3200_W64LE_OR, 30) ++ RELOC_NUMBER (R_NFP3200_W64BE_OR, 31) ++END_RELOC_NUMBERS (R_NFP3200_MAX) ++ ++START_RELOC_NUMBERS (elf_nfp_reloc_type) ++ RELOC_NUMBER (R_NFP_NOTYPE, 0) ++ RELOC_NUMBER (R_NFP_W32LE, 1) ++ RELOC_NUMBER (R_NFP_SRC8_A, 2) ++ RELOC_NUMBER (R_NFP_SRC8_B, 3) ++ RELOC_NUMBER (R_NFP_IMMED8_I, 4) ++ RELOC_NUMBER (R_NFP_SC, 5) ++ RELOC_NUMBER (R_NFP_IMMED_LO16_I_A, 6) ++ RELOC_NUMBER (R_NFP_IMMED_LO16_I_B, 7) ++ RELOC_NUMBER (R_NFP_SRC7_B, 8) ++ RELOC_NUMBER (R_NFP_SRC7_A, 9) ++ RELOC_NUMBER (R_NFP_SRC8_I_B, 10) ++ RELOC_NUMBER (R_NFP_SRC8_I_A, 11) ++ RELOC_NUMBER (R_NFP_IMMED_HI16_I_A, 12) ++ RELOC_NUMBER (R_NFP_IMMED_HI16_I_B, 13) ++ RELOC_NUMBER (R_NFP_W64LE, 14) ++ RELOC_NUMBER (R_NFP_SH_INFO, 15) ++ RELOC_NUMBER (R_NFP_W32BE, 16) ++ RELOC_NUMBER (R_NFP_W64BE, 17) ++ RELOC_NUMBER (R_NFP_W32_29_24, 18) ++ RELOC_NUMBER (R_NFP_W32LE_AND, 19) ++ RELOC_NUMBER (R_NFP_W32BE_AND, 20) ++ RELOC_NUMBER (R_NFP_W32LE_OR, 21) ++ RELOC_NUMBER (R_NFP_W32BE_OR, 22) ++ RELOC_NUMBER (R_NFP_W64LE_AND, 23) ++ RELOC_NUMBER (R_NFP_W64BE_AND, 24) ++ RELOC_NUMBER (R_NFP_W64LE_OR, 25) ++ RELOC_NUMBER (R_NFP_W64BE_OR, 26) ++END_RELOC_NUMBERS (R_NFP_MAX) ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _ELF_NFP_H */ +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/include/opcode/nfp.h 2019-03-07 14:50:55.251991587 +0000 +@@ -0,0 +1,175 @@ ++/* nfp.h. NFP opcode list. ++ Copyright (C) 2017-2019 Free Software Foundation, Inc. ++ Contributed by Francois H. Theron ++ ++ This file is part of the GNU opcodes library. ++ ++ GDB, GAS, and the GNU binutils are free software; you can redistribute ++ them and/or modify them under the terms of the GNU General Public ++ License as published by the Free Software Foundation; either version 3, ++ or (at your option) any later version. ++ ++ GDB, GAS, and the GNU binutils are distributed in the hope that they ++ will be useful, but WITHOUT ANY WARRANTY; without even the implied ++ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ the GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this file; see the file COPYING3. If not, write to the Free ++ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, ++ MA 02110-1301, USA. */ ++ ++#ifndef _NFP_H_ ++#define _NFP_H_ ++ ++#include "bfd.h" ++#include "bfd_stdint.h" ++#include "elf/nfp.h" ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/* We use ME versions for most of this rather than NFP family and revision ++ numbers. The version numbers are currently 2.7 and 2.8 and to avoid long ++ names with many underscores we'll just use 27 and 28 until some feature ++ number makes it necessary to do something different. */ ++ ++#define NFP_ME27_INSTR_MASK_CMD ((uint64_t) 0x008000000000) ++#define NFP_ME27_INSTR_CMD ((uint64_t) 0x000000000000) ++#define NFP_ME27_INSTR_IS_CMD(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_CMD) == NFP_ME27_INSTR_CMD) ++ ++#define NFP_ME27_INSTR_MASK_ALU_SHF ((uint64_t) 0x1ee000000000) ++#define NFP_ME27_INSTR_ALU_SHF ((uint64_t) 0x008000000000) ++#define NFP_ME27_INSTR_IS_ALU_SHF(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_ALU_SHF) == NFP_ME27_INSTR_ALU_SHF) ++ ++#define NFP_ME27_INSTR_MASK_ALU ((uint64_t) 0x1ee000000000) ++#define NFP_ME27_INSTR_ALU ((uint64_t) 0x00a000000000) ++#define NFP_ME27_INSTR_IS_ALU(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_ALU) == NFP_ME27_INSTR_ALU) ++ ++#define NFP_ME27_INSTR_MASK_IMMED ((uint64_t) 0x1ff900000000) ++#define NFP_ME27_INSTR_IMMED ((uint64_t) 0x00f000000000) ++#define NFP_ME27_INSTR_IS_IMMED(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_IMMED) == NFP_ME27_INSTR_IMMED) ++ ++#define NFP_ME27_INSTR_MASK_LD_FIELD ((uint64_t) 0x1ffa00e00000) ++#define NFP_ME27_INSTR_LD_FIELD ((uint64_t) 0x00c000000000) ++#define NFP_ME27_INSTR_IS_LD_FIELD(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_LD_FIELD) == NFP_ME27_INSTR_LD_FIELD) ++ ++#define NFP_ME27_INSTR_MASK_CTX_ARB ((uint64_t) 0x00f800000000) ++#define NFP_ME27_INSTR_CTX_ARB ((uint64_t) 0x00e000000000) ++#define NFP_ME27_INSTR_IS_CTX_ARB(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_CTX_ARB) == NFP_ME27_INSTR_CTX_ARB) ++ ++#define NFP_ME27_INSTR_MASK_LOCAL_CSR ((uint64_t) 0x1ffe00100000) ++#define NFP_ME27_INSTR_LOCAL_CSR ((uint64_t) 0x00fc00000000) ++#define NFP_ME27_INSTR_IS_LOCAL_CSR(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_LOCAL_CSR) == NFP_ME27_INSTR_LOCAL_CSR) ++ ++#define NFP_ME27_INSTR_MASK_BRANCH ((uint64_t) 0x00f8000c3ce0) ++#define NFP_ME27_INSTR_BRANCH ((uint64_t) 0x00d800000020) ++#define NFP_ME27_INSTR_IS_BRANCH(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_BRANCH) == NFP_ME27_INSTR_BRANCH) ++ ++#define NFP_ME27_INSTR_MASK_BR_BYTE ((uint64_t) 0x00f800000000) ++#define NFP_ME27_INSTR_BR_BYTE ((uint64_t) 0x00c800000000) ++#define NFP_ME27_INSTR_IS_BR_BYTE(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_BR_BYTE) == NFP_ME27_INSTR_BR_BYTE) ++ ++#define NFP_ME27_INSTR_MASK_BR_BIT ((uint64_t) 0x00f800080300) ++#define NFP_ME27_INSTR_BR_BIT ((uint64_t) 0x00d000000000) ++#define NFP_ME27_INSTR_IS_BR_BIT(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_BR_BIT) == NFP_ME27_INSTR_BR_BIT) ++ ++#define NFP_ME27_INSTR_MASK_BR_ALU ((uint64_t) 0x1fff80000000) ++#define NFP_ME27_INSTR_BR_ALU ((uint64_t) 0x00e800000000) ++#define NFP_ME27_INSTR_IS_BR_ALU(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_BR_ALU) == NFP_ME27_INSTR_BR_ALU) ++ ++#define NFP_ME27_INSTR_MASK_MULT ((uint64_t) 0x1efe3f000000) ++#define NFP_ME27_INSTR_MULT ((uint64_t) 0x00f800000000) ++#define NFP_ME27_INSTR_IS_MULT(instr) \ ++ ((instr & NFP_ME27_INSTR_MASK_MULT) == NFP_ME27_INSTR_MULT) ++ ++ ++#define NFP_ME28_INSTR_MASK_CMD ((uint64_t) 0x008000000000) ++#define NFP_ME28_INSTR_CMD ((uint64_t) 0x000000000000) ++#define NFP_ME28_INSTR_IS_CMD(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_CMD) == NFP_ME28_INSTR_CMD) ++ ++#define NFP_ME28_INSTR_MASK_ALU_SHF ((uint64_t) 0x00e000000000) ++#define NFP_ME28_INSTR_ALU_SHF ((uint64_t) 0x008000000000) ++#define NFP_ME28_INSTR_IS_ALU_SHF(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_ALU_SHF) == NFP_ME28_INSTR_ALU_SHF) ++ ++#define NFP_ME28_INSTR_MASK_ALU ((uint64_t) 0x00e000000000) ++#define NFP_ME28_INSTR_ALU ((uint64_t) 0x00a000000000) ++#define NFP_ME28_INSTR_IS_ALU(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_ALU) == NFP_ME28_INSTR_ALU) ++ ++#define NFP_ME28_INSTR_MASK_IMMED ((uint64_t) 0x01f900000000) ++#define NFP_ME28_INSTR_IMMED ((uint64_t) 0x00f000000000) ++#define NFP_ME28_INSTR_IS_IMMED(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_IMMED) == NFP_ME28_INSTR_IMMED) ++ ++#define NFP_ME28_INSTR_MASK_LD_FIELD ((uint64_t) 0x01fa00e00000) ++#define NFP_ME28_INSTR_LD_FIELD ((uint64_t) 0x00c000000000) ++#define NFP_ME28_INSTR_IS_LD_FIELD(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_LD_FIELD) == NFP_ME28_INSTR_LD_FIELD) ++ ++#define NFP_ME28_INSTR_MASK_CTX_ARB ((uint64_t) 0x00f800000000) ++#define NFP_ME28_INSTR_CTX_ARB ((uint64_t) 0x00e000000000) ++#define NFP_ME28_INSTR_IS_CTX_ARB(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_CTX_ARB) == NFP_ME28_INSTR_CTX_ARB) ++ ++#define NFP_ME28_INSTR_MASK_LOCAL_CSR ((uint64_t) 0x01fe00100000) ++#define NFP_ME28_INSTR_LOCAL_CSR ((uint64_t) 0x00fc00000000) ++#define NFP_ME28_INSTR_IS_LOCAL_CSR(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_LOCAL_CSR) == NFP_ME28_INSTR_LOCAL_CSR) ++ ++#define NFP_ME28_INSTR_MASK_BRANCH ((uint64_t) 0x00f8000c3ce0) ++#define NFP_ME28_INSTR_BRANCH ((uint64_t) 0x00d800000020) ++#define NFP_ME28_INSTR_IS_BRANCH(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_BRANCH) == NFP_ME28_INSTR_BRANCH) ++ ++#define NFP_ME28_INSTR_MASK_BR_BYTE ((uint64_t) 0x00f800000000) ++#define NFP_ME28_INSTR_BR_BYTE ((uint64_t) 0x00c800000000) ++#define NFP_ME28_INSTR_IS_BR_BYTE(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_BR_BYTE) == NFP_ME28_INSTR_BR_BYTE) ++ ++#define NFP_ME28_INSTR_MASK_BR_BIT ((uint64_t) 0x00f800080300) ++#define NFP_ME28_INSTR_BR_BIT ((uint64_t) 0x00d000000000) ++#define NFP_ME28_INSTR_IS_BR_BIT(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_BR_BIT) == NFP_ME28_INSTR_BR_BIT) ++ ++#define NFP_ME28_INSTR_MASK_BR_ALU ((uint64_t) 0x00ff80000000) ++#define NFP_ME28_INSTR_BR_ALU ((uint64_t) 0x00e800000000) ++#define NFP_ME28_INSTR_IS_BR_ALU(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_BR_ALU) == NFP_ME28_INSTR_BR_ALU) ++ ++#define NFP_ME28_INSTR_MASK_MULT ((uint64_t) 0x00fe3f000000) ++#define NFP_ME28_INSTR_MULT ((uint64_t) 0x00f800000000) ++#define NFP_ME28_INSTR_IS_MULT(instr) \ ++ ((instr & NFP_ME28_INSTR_MASK_MULT) == NFP_ME28_INSTR_MULT) ++ ++typedef struct ++{ ++ int cpp_target; ++ int cpp_action; ++ int cpp_token; ++ unsigned int len_fixed; ++ unsigned int len_mask; ++ const char *mnemonic; ++} ++nfp_cmd_mnemonic; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _NFP_H_ */ +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/opcodes/nfp-dis.c 2019-03-07 15:04:02.282705484 +0000 +@@ -0,0 +1,2982 @@ ++/* Print NFP instructions for objdump. ++ Copyright (C) 2017-2019 Free Software Foundation, Inc. ++ Contributed by Francois H. Theron ++ ++ This file is part of the GNU opcodes library. ++ ++ This library is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3, or (at your option) ++ any later version. ++ ++ It is distributed in the hope that it will be useful, but WITHOUT ++ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ++ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public ++ License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, ++ MA 02110-1301, USA. */ ++ ++/* There will be many magic numbers here that are based on hardware. ++ Making #define macros for each encoded bit field will probably reduce ++ readability far more than the simple numbers will, so we make sure that ++ the context of the magic numbers make it clear what they are used for. */ ++ ++#include "sysdep.h" ++#include ++#include "disassemble.h" ++#include "libiberty.h" ++#include "elf/nfp.h" ++#include "opcode/nfp.h" ++#include "opintl.h" ++#include "elf-bfd.h" ++#include "bfd.h" ++#include "bfd_stdint.h" ++ ++#define _NFP_ERR_STOP -1 ++#define _NFP_ERR_CONT -8 ++ ++#define _BTST(v, b) (((v) >> b) & 1) ++#define _BF(v, msb, lsb) (((v) >> (lsb)) & \ ++ ((1U << ((msb) - (lsb) + 1)) - 1)) ++#define _BFS(v, msb, lsb, lshift) (_BF(v, msb, lsb) << (lshift)) ++ ++#define _NFP_ME27_28_CSR_CTX_ENABLES 0x18 ++#define _NFP_ME27_28_CSR_MISC_CONTROL 0x160 ++ ++typedef struct ++{ ++ unsigned char ctx4_mode:1; ++ unsigned char addr_3rdparty32:1; ++ unsigned char scs_cnt:2; ++ unsigned char _future:4; ++} ++nfp_priv_mecfg; ++ ++typedef struct ++{ ++ unsigned char show_pc; ++ unsigned char ctx_mode; ++} ++nfp_opts; ++ ++/* mecfgs[island][menum][is-text] */ ++typedef struct ++{ ++ nfp_priv_mecfg mecfgs[64][12][2]; ++} ++nfp_priv_data; ++ ++static const char *nfp_mealu_shf_op[8] = ++{ ++ /* 0b000 (0) */ "B", ++ /* 0b001 (1) */ "~B", ++ /* 0b010 (2) */ "AND", ++ /* 0b011 (3) */ "~AND", ++ /* 0b100 (4) */ "AND~", ++ /* 0b101 (5) */ "OR", ++ /* 0b110 (6) */ "asr", ++ /* 0b111 (7) */ "byte_align" ++}; ++ ++static const char *nfp_me27_28_alu_op[32] = ++{ ++ /* 0b00000 (0) */ "B", ++ /* 0b00001 (1) */ "+", ++ NULL, ++ /* 0b00011 (3) */ "pop_count3", ++ /* 0b00100 (4) */ "~B", ++ /* 0b00101 (5) */ "+16", ++ /* 0b00110 (6) */ "pop_count1", ++ /* 0b00111 (7) */ "pop_count2", ++ /* 0b01000 (8) */ "AND", ++ /* 0b01001 (9) */ "+8", ++ NULL, ++ /* 0b01011 (11) */ "cam_clear", ++ /* 0b01100 (12) */ "~AND", ++ /* 0b01101 (13) */ "-carry", ++ /* 0b01110 (14) */ "ffs", ++ /* 0b01111 (15) */ "cam_read_tag", ++ /* 0b10000 (16) */ "AND~", ++ /* 0b10001 (17) */ "+carry", ++ /* 0b10010 (18) */ "CRC", ++ /* 0b10011 (19) */ "cam_write", ++ /* 0b10100 (20) */ "OR", ++ /* 0b10101 (21) */ "-", ++ NULL, ++ /* 0b10111 (23) */ "cam_lookup", ++ /* 0b11000 (24) */ "XOR", ++ /* 0b11001 (25) */ "B-A", ++ NULL, ++ /* 0b11011 (27) */ "cam_write_state", ++ NULL, ++ NULL, ++ NULL, ++ /* 0b11111 (31) */ "cam_read_state" ++}; ++ ++static const char *nfp_me27_28_crc_op[8] = ++{ ++ /* 0b000 (0) */ "--", ++ NULL, ++ /* 0b010 (2) */ "crc_ccitt", ++ NULL, ++ /* 0b100 (4) */ "crc_32", ++ /* 0b101 (5) */ "crc_iscsi", ++ /* 0b110 (6) */ "crc_10", ++ /* 0b111 (7) */ "crc_5" ++}; ++ ++static const char *nfp_me27_28_crc_bytes[8] = ++{ ++ /* 0b000 (0) */ "bytes_0_3", ++ /* 0b001 (1) */ "bytes_1_3", ++ /* 0b010 (2) */ "bytes_2_3", ++ /* 0b011 (3) */ "byte_3", ++ /* 0b100 (4) */ "bytes_0_2", ++ /* 0b101 (5) */ "bytes_0_1", ++ /* 0b110 (6) */ "byte_0" ++}; ++ ++static const char *nfp_me27_28_mecsrs[] = ++{ ++ /* 0x000 (0) */ "UstorAddr", ++ /* 0x004 (1) */ "UstorDataLwr", ++ /* 0x008 (2) */ "UstorDataUpr", ++ /* 0x00c (3) */ "UstorErrStat", ++ /* 0x010 (4) */ "ALUOut", ++ /* 0x014 (5) */ "CtxArbCtrl", ++ /* 0x018 (6) */ "CtxEnables", ++ /* 0x01c (7) */ "CondCodeEn", ++ /* 0x020 (8) */ "CSRCtxPtr", ++ /* 0x024 (9) */ "PcBreakpoint0", ++ /* 0x028 (10) */ "PcBreakpoint1", ++ /* 0x02c (11) */ "PcBreakpointStatus", ++ /* 0x030 (12) */ "RegErrStatus", ++ /* 0x034 (13) */ "LMErrStatus", ++ /* 0x038 (14) */ "LMeccErrorMask", ++ NULL, ++ /* 0x040 (16) */ "IndCtxStatus", ++ /* 0x044 (17) */ "ActCtxStatus", ++ /* 0x048 (18) */ "IndCtxSglEvt", ++ /* 0x04c (19) */ "ActCtxSglEvt", ++ /* 0x050 (20) */ "IndCtxWkpEvt", ++ /* 0x054 (21) */ "ActCtxWkpEvt", ++ /* 0x058 (22) */ "IndCtxFtrCnt", ++ /* 0x05c (23) */ "ActCtxFtrCnt", ++ /* 0x060 (24) */ "IndLMAddr0", ++ /* 0x064 (25) */ "ActLMAddr0", ++ /* 0x068 (26) */ "IndLMAddr1", ++ /* 0x06c (27) */ "ActLMAddr1", ++ /* 0x070 (28) */ "ByteIndex", ++ /* 0x074 (29) */ "XferIndex", ++ /* 0x078 (30) */ "IndFtrCntSgl", ++ /* 0x07c (31) */ "ActFtrCntSgl", ++ /* 0x080 (32) */ "NNPut", ++ /* 0x084 (33) */ "NNGet", ++ NULL, ++ NULL, ++ /* 0x090 (36) */ "IndLMAddr2", ++ /* 0x094 (37) */ "ActLMAddr2", ++ /* 0x098 (38) */ "IndLMAddr3", ++ /* 0x09c (39) */ "ActLMAddr3", ++ /* 0x0a0 (40) */ "IndLMAddr2BytIdx", ++ /* 0x0a4 (41) */ "ActLMAddr2BytIdx", ++ /* 0x0a8 (42) */ "IndLMAddr3BytIdx", ++ /* 0x0ac (43) */ "ActLMAddr3BytIdx", ++ /* 0x0b0 (44) */ "IndPredCC", ++ NULL, ++ NULL, ++ NULL, ++ /* 0x0c0 (48) */ "TimestampLow", ++ /* 0x0c4 (49) */ "TimestampHgh", ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ /* 0x0e0 (56) */ "IndLMAddr0BytIdx", ++ /* 0x0e4 (57) */ "ActLMAddr0BytIdx", ++ /* 0x0e8 (58) */ "IndLMAddr1BytIdx", ++ /* 0x0ec (59) */ "ActLMAddr1BytIdx", ++ NULL, ++ /* 0x0f4 (61) */ "XfrAndBytIdx", ++ NULL, ++ NULL, ++ /* 0x100 (64) */ "NxtNghbrSgl", ++ /* 0x104 (65) */ "PrvNghbrSgl", ++ /* 0x108 (66) */ "SameMESignal", ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ /* 0x140 (80) */ "CRCRemainder", ++ /* 0x144 (81) */ "ProfileCnt", ++ /* 0x148 (82) */ "PseudoRndNum", ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ /* 0x160 (88) */ "MiscControl", ++ /* 0x164 (89) */ "PcBreakpoint0Mask", ++ /* 0x168 (90) */ "PcBreakpoint1Mask", ++ NULL, ++ /* 0x170 (92) */ "Mailbox0", ++ /* 0x174 (93) */ "Mailbox1", ++ /* 0x178 (94) */ "Mailbox2", ++ /* 0x17c (95) */ "Mailbox3", ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ /* 0x190 (100) */ "CmdIndirectRef0" ++}; ++ ++const char *nfp_me27_28_br_ops[32] = ++{ ++ /* 0b00000 (0) */ "beq", ++ /* 0b00001 (1) */ "bne", ++ /* 0b00010 (2) */ "bmi", ++ /* 0b00011 (3) */ "bpl", ++ /* 0b00100 (4) */ "bcs", ++ /* 0b00101 (5) */ "bcc", ++ /* 0b00110 (6) */ "bvs", ++ /* 0b00111 (7) */ "bvc", ++ /* 0b01000 (8) */ "bge", ++ /* 0b01001 (9) */ "blt", ++ /* 0b01010 (10) */ "ble", ++ /* 0b01011 (11) */ "bgt", ++ /* (12) */ NULL, ++ /* (13) */ NULL, ++ /* (14) */ NULL, ++ /* (15) */ NULL, ++ /* 0b10000 (16) */ "br=ctx", ++ /* 0b10001 (17) */ "br!=ctx", ++ /* 0b10010 (18) */ "br_signal", ++ /* 0b10011 (19) */ "br_!signal", ++ /* 0b10100 (20) */ "br_inp_state", ++ /* 0b10101 (21) */ "br_!inp_state", ++ /* 0b10110 (22) */ "br_cls_state", ++ /* 0b10111 (23) */ "br_!cls_state", ++ /* 0b11000 (24) */ "br", ++ /* (25) */ NULL, ++ /* (26) */ NULL, ++ /* (27) */ NULL, ++ /* (28) */ NULL, ++ /* (29) */ NULL, ++ /* (30) */ NULL, ++ /* (31) */ NULL ++}; ++ ++static const char *nfp_me27_br_inpstates[16] = ++{ ++ /* 0 */ "nn_empty", ++ /* 1 */ "nn_full", ++ /* 2 */ "scr_ring0_status", ++ /* 3 */ "scr_ring1_status", ++ /* 4 */ "scr_ring2_status", ++ /* 5 */ "scr_ring3_status", ++ /* 6 */ "scr_ring4_status", ++ /* 7 */ "scr_ring5_status", ++ /* 8 */ "scr_ring6_status", ++ /* 9 */ "scr_ring7_status", ++ /* 10 */ "scr_ring8_status", ++ /* 11 */ "scr_ring9_status", ++ /* 12 */ "scr_ring10_status", ++ /* 13 */ "scr_ring11_status", ++ /* 14 */ "fci_not_empty", ++ /* 15 */ "fci_full" ++}; ++ ++static const char *nfp_me28_br_inpstates[16] = ++{ ++ /* 0 */ "nn_empty", ++ /* 1 */ "nn_full", ++ /* 2 */ "ctm_ring0_status", ++ /* 3 */ "ctm_ring1_status", ++ /* 4 */ "ctm_ring2_status", ++ /* 5 */ "ctm_ring3_status", ++ /* 6 */ "ctm_ring4_status", ++ /* 7 */ "ctm_ring5_status", ++ /* 8 */ "ctm_ring6_status", ++ /* 9 */ "ctm_ring7_status", ++ /* 10 */ "ctm_ring8_status", ++ /* 11 */ "ctm_ring9_status", ++ /* 12 */ "ctm_ring10_status", ++ /* 13 */ "ctm_ring11_status", ++ /* 14 */ "ctm_ring12_status", ++ /* 15 */ "ctm_ring13_status" ++}; ++ ++static const char *nfp_me27_28_mult_steps[8] = ++{ ++ /* 0 */ "step1", ++ /* 1 */ "step2", ++ /* 2 */ "step3", ++ /* 3 */ "step4", ++ /* 4 */ "last", ++ /* 5 */ "last2", ++ NULL, ++ NULL ++}; ++ ++static const char *nfp_me27_28_mult_types[4] = ++{ ++ "start", ++ "24x8", ++ "16x16", ++ "32x32" ++}; ++ ++/* The cmd_mnemonics arrays are sorted here in its definition so that we can ++ use bsearch () on the first three fields. There can be multiple matches ++ and we assume that bsearch can return any of them, so we manually step ++ back to the first one. */ ++ ++static const nfp_cmd_mnemonic nfp_me27_mnemonics[] = ++{ ++ {NFP_3200_CPPTGT_MSF0, 0, 0, 0, 0, "read"}, ++ {NFP_3200_CPPTGT_MSF0, 0, 2, 0, 0, "read64"}, ++ {NFP_3200_CPPTGT_MSF0, 1, 0, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_MSF0, 1, 1, 0, 0, "fast_wr"}, ++ {NFP_3200_CPPTGT_MSF0, 1, 2, 0, 0, "write64"}, ++ {NFP_3200_CPPTGT_QDR, 0, 0, 0, 0, "read"}, ++ {NFP_3200_CPPTGT_QDR, 1, 0, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_QDR, 2, 0, 0, 0, "write_atomic"}, ++ {NFP_3200_CPPTGT_QDR, 2, 1, 0, 0, "swap"}, ++ {NFP_3200_CPPTGT_QDR, 3, 0, 0, 0, "set"}, ++ {NFP_3200_CPPTGT_QDR, 3, 1, 0, 0, "test_and_set"}, ++ {NFP_3200_CPPTGT_QDR, 4, 0, 0, 0, "clr"}, ++ {NFP_3200_CPPTGT_QDR, 4, 1, 0, 0, "test_and_clr"}, ++ {NFP_3200_CPPTGT_QDR, 5, 0, 0, 0, "add"}, ++ {NFP_3200_CPPTGT_QDR, 5, 1, 0, 0, "test_and_add"}, ++ {NFP_3200_CPPTGT_QDR, 6, 0, 0, 0, "read_queue"}, ++ {NFP_3200_CPPTGT_QDR, 6, 1, 0, 0, "read_queue_ring"}, ++ {NFP_3200_CPPTGT_QDR, 6, 2, 0, 0, "write_queue"}, ++ {NFP_3200_CPPTGT_QDR, 6, 3, 0, 0, "write_queue_ring"}, ++ {NFP_3200_CPPTGT_QDR, 7, 0, 0, 0, "incr"}, ++ {NFP_3200_CPPTGT_QDR, 7, 1, 0, 0, "test_and_incr"}, ++ {NFP_3200_CPPTGT_QDR, 8, 0, 0, 0, "decr"}, ++ {NFP_3200_CPPTGT_QDR, 8, 1, 0, 0, "test_and_decr"}, ++ {NFP_3200_CPPTGT_QDR, 9, 0, 0, 0, "put"}, ++ {NFP_3200_CPPTGT_QDR, 9, 1, 0, 0, "get"}, ++ {NFP_3200_CPPTGT_QDR, 9, 2, 0, 0, "put_imm"}, ++ {NFP_3200_CPPTGT_QDR, 9, 3, 0, 0, "pop"}, ++ {NFP_3200_CPPTGT_QDR, 10, 0, 0, 0, "journal"}, ++ {NFP_3200_CPPTGT_QDR, 10, 1, 0, 0, "fast_journal"}, ++ {NFP_3200_CPPTGT_QDR, 11, 0, 0, 0, "dequeue"}, ++ {NFP_3200_CPPTGT_QDR, 12, 0, 0, 0, "enqueue"}, ++ {NFP_3200_CPPTGT_QDR, 12, 1, 0, 0, "enueue_tail"}, ++ {NFP_3200_CPPTGT_QDR, 12, 2, 0, 0, "nfp_enqueue"}, ++ {NFP_3200_CPPTGT_QDR, 12, 3, 0, 0, "nfp_enueue_tail"}, ++ {NFP_3200_CPPTGT_QDR, 13, 0, 0, 0, "csr_wr"}, ++ {NFP_3200_CPPTGT_QDR, 13, 1, 0, 0, "csr_rd"}, ++ {NFP_3200_CPPTGT_QDR, 14, 0, 0, 0, "wr_qdesc"}, ++ {NFP_3200_CPPTGT_QDR, 14, 1, 0, 0, "nfp_wr_qdesc"}, ++ {NFP_3200_CPPTGT_QDR, 14, 2, 0, 0, "wr_qdesc_count"}, ++ {NFP_3200_CPPTGT_QDR, 14, 3, 0, 0, "push_qdesc"}, ++ {NFP_3200_CPPTGT_QDR, 15, 0, 0, 0, "rd_qdesc_other"}, ++ {NFP_3200_CPPTGT_QDR, 15, 1, 0, 0, "rd_qdesc_tail"}, ++ {NFP_3200_CPPTGT_QDR, 15, 2, 0, 0, "rd_qdesc_head"}, ++ {NFP_3200_CPPTGT_QDR, 15, 3, 0, 0, "nfp_rd_qdesc"}, ++ {NFP_3200_CPPTGT_MSF1, 0, 0, 0, 0, "read"}, ++ {NFP_3200_CPPTGT_MSF1, 0, 2, 0, 0, "read64"}, ++ {NFP_3200_CPPTGT_MSF1, 1, 0, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_MSF1, 1, 1, 0, 0, "fast_wr"}, ++ {NFP_3200_CPPTGT_MSF1, 1, 2, 0, 0, "write64"}, ++ {NFP_3200_CPPTGT_HASH, 0, 0, 0, 0, "hash_48"}, ++ {NFP_3200_CPPTGT_HASH, 0, 1, 0, 0, "hash_64"}, ++ {NFP_3200_CPPTGT_HASH, 0, 2, 0, 0, "hash_128"}, ++ {NFP_3200_CPPTGT_MU, 0, 0, 0, 0, "read"}, ++ {NFP_3200_CPPTGT_MU, 0, 1, 0, 0, "read_le"}, ++ {NFP_3200_CPPTGT_MU, 0, 2, 0, 0, "read_swap"}, ++ {NFP_3200_CPPTGT_MU, 0, 3, 0, 0, "read_swap_le"}, ++ {NFP_3200_CPPTGT_MU, 1, 0, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_MU, 1, 1, 0, 0, "write_le"}, ++ {NFP_3200_CPPTGT_MU, 1, 2, 0, 0, "write_swap"}, ++ {NFP_3200_CPPTGT_MU, 1, 3, 0, 0, "write_swap_le"}, ++ {NFP_3200_CPPTGT_MU, 2, 0, 0, 0, "write8"}, ++ {NFP_3200_CPPTGT_MU, 2, 1, 0, 0, "write8_le"}, ++ {NFP_3200_CPPTGT_MU, 2, 2, 0, 0, "write8_swap"}, ++ {NFP_3200_CPPTGT_MU, 2, 3, 0, 0, "write8_swap_le"}, ++ {NFP_3200_CPPTGT_MU, 3, 0, 0, 0, "read_atomic"}, ++ {NFP_3200_CPPTGT_MU, 3, 1, 0, 0, "read8"}, ++ {NFP_3200_CPPTGT_MU, 3, 2, 0, 0, "compare_write"}, ++ {NFP_3200_CPPTGT_MU, 3, 3, 0, 0, "test_and_compare_write"}, ++ {NFP_3200_CPPTGT_MU, 4, 0, 0, 0, "write_atomic"}, ++ {NFP_3200_CPPTGT_MU, 4, 1, 0, 0, "swap"}, ++ {NFP_3200_CPPTGT_MU, 4, 2, 0, 0, "write_atomic_imm"}, ++ {NFP_3200_CPPTGT_MU, 4, 3, 0, 0, "swap_imm"}, ++ {NFP_3200_CPPTGT_MU, 5, 0, 0, 0, "set"}, ++ {NFP_3200_CPPTGT_MU, 5, 1, 0, 0, "test_and_set"}, ++ {NFP_3200_CPPTGT_MU, 5, 2, 0, 0, "set_imm"}, ++ {NFP_3200_CPPTGT_MU, 5, 3, 0, 0, "test_and_set_imm"}, ++ {NFP_3200_CPPTGT_MU, 6, 0, 0, 0, "clr"}, ++ {NFP_3200_CPPTGT_MU, 6, 1, 0, 0, "test_and_clr"}, ++ {NFP_3200_CPPTGT_MU, 6, 2, 0, 0, "clr_imm"}, ++ {NFP_3200_CPPTGT_MU, 6, 3, 0, 0, "test_and_clr_imm"}, ++ {NFP_3200_CPPTGT_MU, 7, 0, 0, 4, "add"}, ++ {NFP_3200_CPPTGT_MU, 7, 0, 4, 4, "add64"}, ++ {NFP_3200_CPPTGT_MU, 7, 1, 0, 4, "test_and_add"}, ++ {NFP_3200_CPPTGT_MU, 7, 1, 4, 4, "test_and_add64"}, ++ {NFP_3200_CPPTGT_MU, 7, 2, 0, 4, "add_imm"}, ++ {NFP_3200_CPPTGT_MU, 7, 2, 4, 4, "add64_imm"}, ++ {NFP_3200_CPPTGT_MU, 7, 3, 0, 4, "test_and_add_imm"}, ++ {NFP_3200_CPPTGT_MU, 7, 3, 4, 4, "test_and_add64_imm"}, ++ {NFP_3200_CPPTGT_MU, 8, 0, 0, 4, "add_sat"}, ++ {NFP_3200_CPPTGT_MU, 8, 0, 4, 4, "add64_sat"}, ++ {NFP_3200_CPPTGT_MU, 8, 1, 0, 4, "test_and_add_sat"}, ++ {NFP_3200_CPPTGT_MU, 8, 1, 4, 4, "test_and_add64_sat"}, ++ {NFP_3200_CPPTGT_MU, 8, 2, 0, 4, "add_imm_sat"}, ++ {NFP_3200_CPPTGT_MU, 8, 2, 4, 4, "add_imm_sat"}, ++ {NFP_3200_CPPTGT_MU, 8, 3, 0, 0, "test_and_add_sat_imm"}, ++ {NFP_3200_CPPTGT_MU, 9, 0, 0, 4, "sub"}, ++ {NFP_3200_CPPTGT_MU, 9, 0, 4, 4, "sub64"}, ++ {NFP_3200_CPPTGT_MU, 9, 1, 0, 4, "test_and_sub"}, ++ {NFP_3200_CPPTGT_MU, 9, 1, 4, 4, "test_and_sub64"}, ++ {NFP_3200_CPPTGT_MU, 9, 2, 0, 4, "sub_imm"}, ++ {NFP_3200_CPPTGT_MU, 9, 2, 4, 4, "sub64_imm"}, ++ {NFP_3200_CPPTGT_MU, 9, 3, 0, 0, "tes_and_sub_imm"}, ++ {NFP_3200_CPPTGT_MU, 10, 0, 0, 4, "sub_sat"}, ++ {NFP_3200_CPPTGT_MU, 10, 0, 4, 4, "sub64_sat"}, ++ {NFP_3200_CPPTGT_MU, 10, 1, 0, 4, "test_and_sub_sat"}, ++ {NFP_3200_CPPTGT_MU, 10, 1, 4, 4, "test_and_sub64_sat"}, ++ {NFP_3200_CPPTGT_MU, 10, 2, 0, 4, "sub_imm_sat"}, ++ {NFP_3200_CPPTGT_MU, 10, 2, 4, 4, "sub64_imm_sat"}, ++ {NFP_3200_CPPTGT_MU, 10, 3, 0, 0, "test_and_sub_sat_imm"}, ++ {NFP_3200_CPPTGT_MU, 11, 0, 0, 0, "release_ticket"}, ++ {NFP_3200_CPPTGT_MU, 11, 1, 0, 0, "release_ticket_ind"}, ++ {NFP_3200_CPPTGT_MU, 12, 0, 0, 0, "cam_lookup"}, ++ {NFP_3200_CPPTGT_MU, 12, 1, 0, 0, "cam_lookup_add"}, ++ {NFP_3200_CPPTGT_MU, 12, 2, 0, 0, "tcam_lookup"}, ++ {NFP_3200_CPPTGT_MU, 12, 3, 0, 3, "lock"}, ++ {NFP_3200_CPPTGT_MU, 12, 3, 2, 3, "cam_lookup_add_inc"}, ++ {NFP_3200_CPPTGT_MU, 13, 0, 0, 4, "microq128_get"}, ++ {NFP_3200_CPPTGT_MU, 13, 0, 4, 4, "microq256_get"}, ++ {NFP_3200_CPPTGT_MU, 13, 1, 0, 4, "microq128_pop"}, ++ {NFP_3200_CPPTGT_MU, 13, 1, 4, 4, "microq256_pop"}, ++ {NFP_3200_CPPTGT_MU, 13, 2, 0, 4, "microq128_put"}, ++ {NFP_3200_CPPTGT_MU, 13, 2, 4, 4, "microq256_put"}, ++ {NFP_3200_CPPTGT_MU, 14, 0, 0, 4, "queue128_lock"}, ++ {NFP_3200_CPPTGT_MU, 14, 0, 4, 4, "queue256_lock"}, ++ {NFP_3200_CPPTGT_MU, 14, 1, 0, 4, "queue128_unlock"}, ++ {NFP_3200_CPPTGT_MU, 14, 1, 4, 4, "queue256_unlock"}, ++ {NFP_3200_CPPTGT_MU, 15, 0, 0, 0, "xor"}, ++ {NFP_3200_CPPTGT_MU, 15, 1, 0, 0, "test_and_xor"}, ++ {NFP_3200_CPPTGT_MU, 15, 2, 0, 0, "xor_imm"}, ++ {NFP_3200_CPPTGT_MU, 15, 3, 0, 0, "test_and_xor_imm"}, ++ {NFP_3200_CPPTGT_MU, 16, 0, 0, 0, "rd_qdesc"}, ++ {NFP_3200_CPPTGT_MU, 16, 1, 0, 0, "wr_qdesc"}, ++ {NFP_3200_CPPTGT_MU, 16, 2, 0, 0, "push_qdesc"}, ++ {NFP_3200_CPPTGT_MU, 16, 3, 0, 0, "tag_writeback"}, ++ {NFP_3200_CPPTGT_MU, 17, 0, 0, 0, "enqueue"}, ++ {NFP_3200_CPPTGT_MU, 17, 1, 0, 0, "enqueue_tail"}, ++ {NFP_3200_CPPTGT_MU, 17, 2, 0, 0, "dequeue"}, ++ {NFP_3200_CPPTGT_MU, 18, 0, 0, 0, "read_queue"}, ++ {NFP_3200_CPPTGT_MU, 18, 1, 0, 0, "read_queue_ring"}, ++ {NFP_3200_CPPTGT_MU, 18, 2, 0, 0, "write_queue"}, ++ {NFP_3200_CPPTGT_MU, 18, 3, 0, 0, "write_queue_ring"}, ++ {NFP_3200_CPPTGT_MU, 19, 0, 0, 0, "add_tail"}, ++ {NFP_3200_CPPTGT_MU, 19, 1, 0, 0, "qadd_thread"}, ++ {NFP_3200_CPPTGT_MU, 19, 2, 0, 0, "qadd_work"}, ++ {NFP_3200_CPPTGT_MU, 19, 3, 0, 0, "qadd_work_imm"}, ++ {NFP_3200_CPPTGT_MU, 20, 0, 0, 0, "put"}, ++ {NFP_3200_CPPTGT_MU, 20, 1, 0, 0, "put_tag"}, ++ {NFP_3200_CPPTGT_MU, 20, 2, 0, 0, "journal"}, ++ {NFP_3200_CPPTGT_MU, 20, 3, 0, 0, "journal_tag"}, ++ {NFP_3200_CPPTGT_MU, 21, 0, 0, 0, "get"}, ++ {NFP_3200_CPPTGT_MU, 21, 1, 0, 0, "get_eop"}, ++ {NFP_3200_CPPTGT_MU, 21, 2, 0, 0, "get_safe"}, ++ {NFP_3200_CPPTGT_MU, 21, 3, 0, 0, "get_tag_safe"}, ++ {NFP_3200_CPPTGT_MU, 22, 0, 0, 0, "pop"}, ++ {NFP_3200_CPPTGT_MU, 22, 1, 0, 0, "pop_eop"}, ++ {NFP_3200_CPPTGT_MU, 22, 2, 0, 0, "pop_safe"}, ++ {NFP_3200_CPPTGT_MU, 22, 3, 0, 0, "pop_tag_safe"}, ++ {NFP_3200_CPPTGT_MU, 23, 0, 0, 0, "fast_journal"}, ++ {NFP_3200_CPPTGT_MU, 23, 1, 0, 0, "fast_journal_sig"}, ++ {NFP_3200_CPPTGT_GS, 0, 0, 0, 0, "read"}, ++ {NFP_3200_CPPTGT_GS, 1, 0, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_GS, 2, 0, 0, 0, "write_atomic"}, ++ {NFP_3200_CPPTGT_GS, 2, 1, 0, 0, "swap"}, ++ {NFP_3200_CPPTGT_GS, 3, 0, 0, 0, "set"}, ++ {NFP_3200_CPPTGT_GS, 3, 1, 0, 0, "test_and_set"}, ++ {NFP_3200_CPPTGT_GS, 4, 0, 0, 0, "clr"}, ++ {NFP_3200_CPPTGT_GS, 4, 1, 0, 0, "test_and_clr"}, ++ {NFP_3200_CPPTGT_GS, 5, 0, 0, 0, "add"}, ++ {NFP_3200_CPPTGT_GS, 5, 1, 0, 0, "test_and_add"}, ++ {NFP_3200_CPPTGT_GS, 6, 0, 0, 0, "sub"}, ++ {NFP_3200_CPPTGT_GS, 6, 1, 0, 0, "test_and_sub"}, ++ {NFP_3200_CPPTGT_GS, 7, 0, 0, 0, "inc"}, ++ {NFP_3200_CPPTGT_GS, 7, 1, 0, 0, "test_and_inc"}, ++ {NFP_3200_CPPTGT_GS, 8, 0, 0, 0, "dec"}, ++ {NFP_3200_CPPTGT_GS, 8, 1, 0, 0, "test_and_dec"}, ++ {NFP_3200_CPPTGT_GS, 9, 0, 0, 0, "get"}, ++ {NFP_3200_CPPTGT_GS, 10, 0, 0, 0, "put"}, ++ {NFP_3200_CPPTGT_PCIE, 0, 0, 0, 0, "read"}, ++ {NFP_3200_CPPTGT_PCIE, 1, 0, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_PCIE, 2, 0, 0, 0, "read_internal"}, ++ {NFP_3200_CPPTGT_PCIE, 3, 0, 0, 0, "write_internal"}, ++ {NFP_3200_CPPTGT_ARM, 0, 0, 0, 0, "read"}, ++ {NFP_3200_CPPTGT_ARM, 1, 0, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_CRYPTO, 0, 0, 0, 0, "read"}, ++ {NFP_3200_CPPTGT_CRYPTO, 1, 0, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_CRYPTO, 2, 0, 0, 0, "write_fifo"}, ++ {NFP_3200_CPPTGT_CAP, 0, 0, 0, 0, "read_enum"}, ++ {NFP_3200_CPPTGT_CAP, 0, 1, 0, 0, "read"}, ++ {NFP_3200_CPPTGT_CAP, 0, 2, 0, 0, "read_reflect"}, ++ {NFP_3200_CPPTGT_CAP, 1, 0, 0, 0, "write_enum"}, ++ {NFP_3200_CPPTGT_CAP, 1, 1, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_CAP, 1, 2, 0, 0, "write_reflect"}, ++ {NFP_3200_CPPTGT_CAP, 2, 0, 0, 0, "fast_wr_alu"}, ++ {NFP_3200_CPPTGT_CAP, 3, 0, 0, 0, "fast_wr"}, ++ {NFP_3200_CPPTGT_CT, 1, 0, 0, 0, "write"}, ++ {NFP_3200_CPPTGT_CLS, 0, 0, 0, 0, "read_be"}, ++ {NFP_3200_CPPTGT_CLS, 0, 1, 0, 0, "read_le"}, ++ {NFP_3200_CPPTGT_CLS, 0, 2, 0, 0, "test_and_compare_write"}, ++ {NFP_3200_CPPTGT_CLS, 0, 3, 0, 0, "xor"}, ++ {NFP_3200_CPPTGT_CLS, 1, 0, 0, 0, "write_be"}, ++ {NFP_3200_CPPTGT_CLS, 1, 1, 0, 0, "write_le"}, ++ {NFP_3200_CPPTGT_CLS, 1, 2, 0, 0, "write8_be"}, ++ {NFP_3200_CPPTGT_CLS, 1, 3, 0, 0, "write8_le"}, ++ {NFP_3200_CPPTGT_CLS, 2, 0, 0, 0, "set"}, ++ {NFP_3200_CPPTGT_CLS, 2, 1, 0, 0, "clr"}, ++ {NFP_3200_CPPTGT_CLS, 2, 2, 0, 0, "test_and_set"}, ++ {NFP_3200_CPPTGT_CLS, 2, 3, 0, 0, "test_and_clr"}, ++ {NFP_3200_CPPTGT_CLS, 3, 0, 0, 0, "set_imm"}, ++ {NFP_3200_CPPTGT_CLS, 3, 1, 0, 0, "clr_imm"}, ++ {NFP_3200_CPPTGT_CLS, 3, 2, 0, 0, "test_and_set_imm"}, ++ {NFP_3200_CPPTGT_CLS, 3, 3, 0, 0, "test_and_clr_imm"}, ++ {NFP_3200_CPPTGT_CLS, 4, 0, 0, 0, "add"}, ++ {NFP_3200_CPPTGT_CLS, 4, 1, 0, 0, "add64"}, ++ {NFP_3200_CPPTGT_CLS, 4, 2, 0, 0, "add_sat"}, ++ {NFP_3200_CPPTGT_CLS, 4, 3, 0, 0, "test_and_add_sat"}, ++ {NFP_3200_CPPTGT_CLS, 5, 0, 0, 0, "add_imm"}, ++ {NFP_3200_CPPTGT_CLS, 5, 1, 0, 0, "add64_imm"}, ++ {NFP_3200_CPPTGT_CLS, 5, 2, 0, 0, "add_imm_sat"}, ++ {NFP_3200_CPPTGT_CLS, 5, 3, 0, 0, "test_and_add_imm_sat"}, ++ {NFP_3200_CPPTGT_CLS, 6, 0, 0, 0, "sub"}, ++ {NFP_3200_CPPTGT_CLS, 6, 1, 0, 0, "sub64"}, ++ {NFP_3200_CPPTGT_CLS, 6, 2, 0, 0, "sub_sat"}, ++ {NFP_3200_CPPTGT_CLS, 6, 3, 0, 0, "test_and_sub_sat"}, ++ {NFP_3200_CPPTGT_CLS, 7, 0, 0, 0, "sub_imm"}, ++ {NFP_3200_CPPTGT_CLS, 7, 1, 0, 0, "sub64_imm"}, ++ {NFP_3200_CPPTGT_CLS, 7, 2, 0, 0, "sub_imm_sat"}, ++ {NFP_3200_CPPTGT_CLS, 7, 3, 0, 0, "test_and_sub_imm_sat"}, ++ {NFP_3200_CPPTGT_CLS, 8, 0, 0, 0, "queue_lock"}, ++ {NFP_3200_CPPTGT_CLS, 8, 1, 0, 0, "queue_unlock"}, ++ {NFP_3200_CPPTGT_CLS, 8, 2, 0, 0, "hash_mask"}, ++ {NFP_3200_CPPTGT_CLS, 8, 3, 0, 0, "hash_mask_clear"}, ++ {NFP_3200_CPPTGT_CLS, 9, 0, 0, 0, "get"}, ++ {NFP_3200_CPPTGT_CLS, 9, 1, 0, 0, "pop"}, ++ {NFP_3200_CPPTGT_CLS, 9, 2, 0, 0, "get_safe"}, ++ {NFP_3200_CPPTGT_CLS, 9, 3, 0, 0, "pop_safe"}, ++ {NFP_3200_CPPTGT_CLS, 10, 0, 0, 0, "put"}, ++ {NFP_3200_CPPTGT_CLS, 10, 1, 0, 0, "put_offset"}, ++ {NFP_3200_CPPTGT_CLS, 10, 2, 0, 0, "journal"}, ++ {NFP_3200_CPPTGT_CLS, 10, 3, 0, 0, "add_tail"}, ++ {NFP_3200_CPPTGT_CLS, 11, 0, 0, 0, "cam_lookup32"}, ++ {NFP_3200_CPPTGT_CLS, 11, 1, 0, 0, "cam_lookup32_add"}, ++ {NFP_3200_CPPTGT_CLS, 11, 2, 0, 0, "cam_lookup24"}, ++ {NFP_3200_CPPTGT_CLS, 11, 3, 0, 0, "cam_lookup24_add"}, ++ {NFP_3200_CPPTGT_CLS, 12, 0, 0, 0, "cam_lookup8"}, ++ {NFP_3200_CPPTGT_CLS, 12, 1, 0, 0, "cam_lookup8_add"}, ++ {NFP_3200_CPPTGT_CLS, 12, 2, 0, 0, "cam_lookup16"}, ++ {NFP_3200_CPPTGT_CLS, 12, 3, 0, 0, "cam_lookup16_add"}, ++ {NFP_3200_CPPTGT_CLS, 13, 0, 0, 0, "tcam_lookup32"}, ++ {NFP_3200_CPPTGT_CLS, 13, 1, 0, 0, "tcam_lookup24"}, ++ {NFP_3200_CPPTGT_CLS, 13, 2, 0, 0, "tcam_lookup16"}, ++ {NFP_3200_CPPTGT_CLS, 13, 3, 0, 0, "tcam_lookup8"}, ++ {NFP_3200_CPPTGT_CLS, 14, 0, 0, 0, "reflect_from_sig_src"}, ++ {NFP_3200_CPPTGT_CLS, 14, 1, 0, 0, "reflect_from_sig_dst"}, ++ {NFP_3200_CPPTGT_CLS, 14, 2, 0, 0, "reflect_from_sig_both"}, ++ {NFP_3200_CPPTGT_CLS, 15, 0, 0, 0, "reflect_to_sig_src"}, ++ {NFP_3200_CPPTGT_CLS, 15, 1, 0, 0, "reflect_to_sig_dst"}, ++ {NFP_3200_CPPTGT_CLS, 15, 2, 0, 0, "reflect_to_sig_both"} ++}; ++ ++static const nfp_cmd_mnemonic nfp_me28_mnemonics[] = ++{ ++ {NFP_6000_CPPTGT_NBI, 0, 0, 0, 0, "read"}, ++ {NFP_6000_CPPTGT_NBI, 1, 0, 0, 0, "write"}, ++ {NFP_6000_CPPTGT_NBI, 3, 0, 0, 0, "packet_ready_drop"}, ++ {NFP_6000_CPPTGT_NBI, 3, 1, 0, 0, "packet_ready_unicast"}, ++ {NFP_6000_CPPTGT_NBI, 3, 2, 0, 0, "packet_ready_multicast_dont_free"}, ++ {NFP_6000_CPPTGT_NBI, 3, 3, 0, 0, "packet_ready_multicast_free_on_last"}, ++ {NFP_6000_CPPTGT_ILA, 0, 0, 0, 0, "read"}, ++ {NFP_6000_CPPTGT_ILA, 0, 1, 0, 0, "read_check_error"}, ++ {NFP_6000_CPPTGT_ILA, 1, 0, 0, 0, "write"}, ++ {NFP_6000_CPPTGT_ILA, 1, 1, 0, 0, "write_check_error"}, ++ {NFP_6000_CPPTGT_ILA, 2, 0, 0, 0, "read_int"}, ++ {NFP_6000_CPPTGT_ILA, 3, 0, 0, 7, "write_int"}, ++ {NFP_6000_CPPTGT_ILA, 3, 0, 3, 7, "write_dma"}, ++ {NFP_6000_CPPTGT_MU, 0, 0, 0, 0, "read"}, ++ {NFP_6000_CPPTGT_MU, 0, 1, 0, 0, "read_le"}, ++ {NFP_6000_CPPTGT_MU, 0, 2, 0, 0, "read_swap"}, ++ {NFP_6000_CPPTGT_MU, 0, 3, 0, 0, "read_swap_le"}, ++ {NFP_6000_CPPTGT_MU, 1, 0, 0, 0, "write"}, ++ {NFP_6000_CPPTGT_MU, 1, 1, 0, 0, "write_le"}, ++ {NFP_6000_CPPTGT_MU, 1, 2, 0, 0, "write_swap"}, ++ {NFP_6000_CPPTGT_MU, 1, 3, 0, 0, "write_swap_le"}, ++ {NFP_6000_CPPTGT_MU, 2, 0, 0, 0, "write8"}, ++ {NFP_6000_CPPTGT_MU, 2, 1, 0, 0, "write8_le"}, ++ {NFP_6000_CPPTGT_MU, 2, 2, 0, 0, "write8_swap"}, ++ {NFP_6000_CPPTGT_MU, 2, 3, 0, 0, "write8_swap_le"}, ++ {NFP_6000_CPPTGT_MU, 3, 0, 0, 0, "atomic_read"}, ++ {NFP_6000_CPPTGT_MU, 3, 1, 0, 0, "read8"}, ++ {NFP_6000_CPPTGT_MU, 3, 2, 0, 0, ++ "compare_write_or_incr/mask_compare_write"}, ++ {NFP_6000_CPPTGT_MU, 3, 3, 0, 0, ++ "test_compare_write_or_incr/test_mask_compare_write"}, ++ {NFP_6000_CPPTGT_MU, 4, 0, 0, 0, "atomic_write"}, ++ {NFP_6000_CPPTGT_MU, 4, 1, 0, 0, "swap"}, ++ {NFP_6000_CPPTGT_MU, 4, 2, 0, 0, "atomic_write_imm"}, ++ {NFP_6000_CPPTGT_MU, 4, 3, 0, 0, "swap_imm"}, ++ {NFP_6000_CPPTGT_MU, 5, 0, 0, 0, "set"}, ++ {NFP_6000_CPPTGT_MU, 5, 1, 0, 0, "test_set"}, ++ {NFP_6000_CPPTGT_MU, 5, 2, 0, 0, "set_imm"}, ++ {NFP_6000_CPPTGT_MU, 5, 3, 0, 0, "test_set_imm"}, ++ {NFP_6000_CPPTGT_MU, 6, 0, 0, 0, "clr"}, ++ {NFP_6000_CPPTGT_MU, 6, 1, 0, 0, "test_clr"}, ++ {NFP_6000_CPPTGT_MU, 6, 2, 0, 0, "clr_imm"}, ++ {NFP_6000_CPPTGT_MU, 6, 3, 0, 0, "test_clr_imm"}, ++ {NFP_6000_CPPTGT_MU, 7, 0, 0, 4, "add"}, ++ {NFP_6000_CPPTGT_MU, 7, 0, 4, 4, "add64"}, ++ {NFP_6000_CPPTGT_MU, 7, 1, 0, 4, "test_add"}, ++ {NFP_6000_CPPTGT_MU, 7, 1, 4, 4, "test_add64"}, ++ {NFP_6000_CPPTGT_MU, 7, 2, 0, 4, "add_imm"}, ++ {NFP_6000_CPPTGT_MU, 7, 2, 4, 4, "add64_imm"}, ++ {NFP_6000_CPPTGT_MU, 7, 3, 0, 4, "test_add_imm"}, ++ {NFP_6000_CPPTGT_MU, 7, 3, 4, 4, "test_add64_imm"}, ++ {NFP_6000_CPPTGT_MU, 8, 0, 0, 4, "addsat"}, ++ {NFP_6000_CPPTGT_MU, 8, 0, 4, 4, "addsat64"}, ++ {NFP_6000_CPPTGT_MU, 8, 1, 0, 4, "test_addsat"}, ++ {NFP_6000_CPPTGT_MU, 8, 1, 4, 4, "test_addsat64"}, ++ {NFP_6000_CPPTGT_MU, 8, 2, 0, 4, "addsat_imm"}, ++ {NFP_6000_CPPTGT_MU, 8, 2, 4, 4, "addsat64_imm"}, ++ {NFP_6000_CPPTGT_MU, 8, 3, 0, 4, "test_addsat_imm"}, ++ {NFP_6000_CPPTGT_MU, 8, 3, 4, 4, "test_addsat64_imm"}, ++ {NFP_6000_CPPTGT_MU, 9, 0, 0, 4, "sub"}, ++ {NFP_6000_CPPTGT_MU, 9, 0, 4, 4, "sub64"}, ++ {NFP_6000_CPPTGT_MU, 9, 1, 0, 4, "test_sub"}, ++ {NFP_6000_CPPTGT_MU, 9, 1, 4, 4, "test_sub64"}, ++ {NFP_6000_CPPTGT_MU, 9, 2, 0, 4, "sub_imm"}, ++ {NFP_6000_CPPTGT_MU, 9, 2, 4, 4, "sub64_imm"}, ++ {NFP_6000_CPPTGT_MU, 9, 3, 0, 4, "test_sub_imm"}, ++ {NFP_6000_CPPTGT_MU, 9, 3, 4, 4, "test_sub64_imm"}, ++ {NFP_6000_CPPTGT_MU, 10, 0, 0, 4, "subsat"}, ++ {NFP_6000_CPPTGT_MU, 10, 0, 4, 4, "subsat64"}, ++ {NFP_6000_CPPTGT_MU, 10, 1, 0, 4, "test_subsat"}, ++ {NFP_6000_CPPTGT_MU, 10, 1, 4, 4, "test_subsat64"}, ++ {NFP_6000_CPPTGT_MU, 10, 2, 0, 4, "subsat_imm"}, ++ {NFP_6000_CPPTGT_MU, 10, 2, 4, 4, "subsat64_imm"}, ++ {NFP_6000_CPPTGT_MU, 10, 3, 0, 4, "test_subsat_imm"}, ++ {NFP_6000_CPPTGT_MU, 10, 3, 4, 4, "test_subsat64_imm"}, ++ {NFP_6000_CPPTGT_MU, 11, 0, 0, 0, "ticket_release"}, ++ {NFP_6000_CPPTGT_MU, 11, 1, 0, 0, "ticket_release_ind"}, ++ {NFP_6000_CPPTGT_MU, 12, 0, 0, 7, "cam128_lookup8/cam384_lookup8"}, ++ {NFP_6000_CPPTGT_MU, 12, 0, 1, 7, "cam128_lookup16/cam384_lookup16"}, ++ {NFP_6000_CPPTGT_MU, 12, 0, 2, 7, "cam128_lookup24/cam384_lookup24"}, ++ {NFP_6000_CPPTGT_MU, 12, 0, 3, 7, "cam128_lookup32/cam384_lookup32"}, ++ {NFP_6000_CPPTGT_MU, 12, 0, 4, 7, "cam256_lookup8/cam512_lookup8"}, ++ {NFP_6000_CPPTGT_MU, 12, 0, 5, 7, "cam256_lookup16/cam512_lookup16"}, ++ {NFP_6000_CPPTGT_MU, 12, 0, 6, 7, "cam256_lookup24/cam512_lookup24"}, ++ {NFP_6000_CPPTGT_MU, 12, 0, 7, 7, "cam256_lookup32/cam512_lookup32"}, ++ {NFP_6000_CPPTGT_MU, 12, 1, 0, 7, ++ "cam128_lookup8_add/cam384_lookup8_add"}, ++ {NFP_6000_CPPTGT_MU, 12, 1, 1, 7, ++ "cam128_lookup16_add/cam384_lookup16_add"}, ++ {NFP_6000_CPPTGT_MU, 12, 1, 2, 7, ++ "cam128_lookup24_add/cam384_lookup24_add"}, ++ {NFP_6000_CPPTGT_MU, 12, 1, 3, 7, ++ "cam128_lookup32_add/cam384_lookup32_add"}, ++ {NFP_6000_CPPTGT_MU, 12, 1, 4, 7, ++ "cam256_lookup8_add/cam512_lookup8_add"}, ++ {NFP_6000_CPPTGT_MU, 12, 1, 5, 7, ++ "cam256_lookup16_add/cam512_lookup16_add"}, ++ {NFP_6000_CPPTGT_MU, 12, 1, 6, 7, ++ "cam256_lookup24_add/cam512_lookup24_add"}, ++ {NFP_6000_CPPTGT_MU, 12, 1, 7, 7, ++ "cam256_lookup32_add/cam512_lookup32_add"}, ++ {NFP_6000_CPPTGT_MU, 12, 2, 0, 7, "tcam128_lookup8/tcam384_lookup8"}, ++ {NFP_6000_CPPTGT_MU, 12, 2, 1, 7, "tcam128_lookup16/tcam384_lookup16"}, ++ {NFP_6000_CPPTGT_MU, 12, 2, 2, 7, "tcam128_lookup24/tcam384_lookup24"}, ++ {NFP_6000_CPPTGT_MU, 12, 2, 3, 7, "tcam128_lookup32/tcam384_lookup32"}, ++ {NFP_6000_CPPTGT_MU, 12, 2, 4, 7, "tcam256_lookup8/tcam512_lookup8"}, ++ {NFP_6000_CPPTGT_MU, 12, 2, 5, 7, "tcam256_lookup16/tcam512_lookup16"}, ++ {NFP_6000_CPPTGT_MU, 12, 2, 6, 7, "tcam256_lookup24/tcam512_lookup24"}, ++ {NFP_6000_CPPTGT_MU, 12, 2, 7, 7, "tcam256_lookup32/tcam512_lookup32"}, ++ {NFP_6000_CPPTGT_MU, 12, 3, 0, 7, "lock128/lock384"}, ++ {NFP_6000_CPPTGT_MU, 12, 3, 2, 7, ++ "cam128_lookup24_add_inc/cam384_lookup24_add_inc"}, ++ {NFP_6000_CPPTGT_MU, 12, 3, 4, 7, "lock256/lock512"}, ++ {NFP_6000_CPPTGT_MU, 12, 3, 6, 7, ++ "cam256_lookup24_add_inc/cam512_lookup24_add_inc"}, ++ {NFP_6000_CPPTGT_MU, 13, 0, 0, 7, "microq128_get"}, ++ {NFP_6000_CPPTGT_MU, 13, 0, 4, 7, "microq256_get"}, ++ {NFP_6000_CPPTGT_MU, 13, 1, 0, 7, "microq128_pop"}, ++ {NFP_6000_CPPTGT_MU, 13, 1, 4, 7, "microq256_pop"}, ++ {NFP_6000_CPPTGT_MU, 13, 2, 0, 7, "microq128_put"}, ++ {NFP_6000_CPPTGT_MU, 13, 2, 4, 7, "microq256_put"}, ++ {NFP_6000_CPPTGT_MU, 14, 0, 0, 7, "queue128_lock"}, ++ {NFP_6000_CPPTGT_MU, 14, 0, 4, 7, "queue256_lock"}, ++ {NFP_6000_CPPTGT_MU, 14, 1, 0, 7, "queue128_unlock"}, ++ {NFP_6000_CPPTGT_MU, 14, 1, 4, 7, "queue256_unlock"}, ++ {NFP_6000_CPPTGT_MU, 15, 0, 0, 0, "xor"}, ++ {NFP_6000_CPPTGT_MU, 15, 1, 0, 0, "test_xor"}, ++ {NFP_6000_CPPTGT_MU, 15, 2, 0, 0, "xor_imm"}, ++ {NFP_6000_CPPTGT_MU, 15, 3, 0, 0, "test_xor_imm"}, ++ {NFP_6000_CPPTGT_MU, 16, 0, 0, 0, ++ "ctm.packet_wait_packet_status/emem.rd_qdesc/imem.stats_log"}, ++ {NFP_6000_CPPTGT_MU, 16, 1, 0, 0, ++ "ctm.packet_read_packet_status/emem.wr_qdesc/imem.stats_log_sat"}, ++ {NFP_6000_CPPTGT_MU, 16, 2, 0, 0, ++ "emem.push_qdesc/imem.stats_log_event"}, ++ {NFP_6000_CPPTGT_MU, 16, 3, 0, 0, "imem.stats_log_sat_event"}, ++ {NFP_6000_CPPTGT_MU, 17, 0, 0, 0, ++ "ctm.packet_alloc/emem.enqueue/imem.stats_push"}, ++ {NFP_6000_CPPTGT_MU, 17, 1, 0, 0, ++ "ctm.packet_credit_get/emem.enqueue_tail/imem.stats_push_clear"}, ++ {NFP_6000_CPPTGT_MU, 17, 2, 0, 0, "ctm.packet_alloc_poll/emem.dequeue"}, ++ {NFP_6000_CPPTGT_MU, 17, 3, 0, 0, "ctm.packet_add_thread"}, ++ {NFP_6000_CPPTGT_MU, 18, 0, 0, 0, ++ "ctm.packet_free/emem.read_queue/imem.lb_write_desc"}, ++ {NFP_6000_CPPTGT_MU, 18, 1, 0, 0, ++ "ctm.packet_free_and_signal/emem.read_queue_ring/imem.lb_read_desc"}, ++ {NFP_6000_CPPTGT_MU, 18, 2, 0, 0, ++ "ctm.packet_free_and_return_pointer/emem.write_queue"}, ++ {NFP_6000_CPPTGT_MU, 18, 3, 0, 0, ++ "ctm.packet_return_pointer/emem.write_queue_ring"}, ++ {NFP_6000_CPPTGT_MU, 19, 0, 0, 0, ++ "ctm.packet_complete_drop/emem.add_tail/imem.lb_write_idtable"}, ++ {NFP_6000_CPPTGT_MU, 19, 1, 0, 0, ++ "ctm.packet_complete_unicast/emem.qadd_thread/imem.lb_read_idtable"}, ++ {NFP_6000_CPPTGT_MU, 19, 2, 0, 0, ++ "ctm.packet_complete_multicast/emem.qadd_work"}, ++ {NFP_6000_CPPTGT_MU, 19, 3, 0, 0, ++ "ctm.packet_complete_multicast_free/emem.qadd_work_imm"}, ++ {NFP_6000_CPPTGT_MU, 20, 0, 0, 0, ++ "ctm.pe_dma_to_memory_packet/emem.put/imem.lb_bucket_write_local"}, ++ {NFP_6000_CPPTGT_MU, 20, 1, 0, 0, ++ "ctm.pe_dma_to_memory_packet_swap/imem.lb_bucket_write_dcache"}, ++ {NFP_6000_CPPTGT_MU, 20, 2, 0, 0, ++ "ctm.pe_dma_to_memory_packet_free/emem.journal"}, ++ {NFP_6000_CPPTGT_MU, 20, 3, 0, 0, ++ "ctm.pe_dma_to_memory_packet_free_swap"}, ++ {NFP_6000_CPPTGT_MU, 21, 0, 0, 0, ++ "ctm.pe_dma_to_memory_indirect/emem.get/imem.lb_bucket_read_local"}, ++ {NFP_6000_CPPTGT_MU, 21, 1, 0, 0, ++ "ctm.pe_dma_to_memory_indirect_swap/emem.get_eop/" ++ "imem.lb_bucket_read_dcache"}, ++ {NFP_6000_CPPTGT_MU, 21, 2, 0, 0, ++ "ctm.pe_dma_to_memory_indirect_free/emem.get_freely"}, ++ {NFP_6000_CPPTGT_MU, 21, 3, 0, 0, ++ "ctm.pe_dma_to_memory_indirect_free_swap"}, ++ {NFP_6000_CPPTGT_MU, 22, 0, 0, 0, ++ "ctm.pe_dma_to_memory_buffer/emem.pop/imem.lb_lookup_bundleid"}, ++ {NFP_6000_CPPTGT_MU, 22, 1, 0, 0, ++ "ctm.pe_dma_to_memory_buffer_le/emem.pop_eop/imem.lb_lookup_dcache"}, ++ {NFP_6000_CPPTGT_MU, 22, 2, 0, 0, ++ "ctm.pe_dma_to_memory_buffer_swap/emem.pop_freely/imem.lb_lookup_idtable"}, ++ {NFP_6000_CPPTGT_MU, 22, 3, 0, 0, "ctm.pe_dma_to_memory_buffer_le_swap"}, ++ {NFP_6000_CPPTGT_MU, 23, 0, 0, 0, ++ "ctm.pe_dma_from_memory_buffer/emem.fast_journal/imem.lb_push_stats_local"}, ++ {NFP_6000_CPPTGT_MU, 23, 1, 0, 0, ++ "ctm.pe_dma_from_memory_buffer_le/emem.fast_journal_sig/" ++ "imem.lb_push_stats_dcache"}, ++ {NFP_6000_CPPTGT_MU, 23, 2, 0, 0, ++ "ctm.pe_dma_from_memory_buffer_swap/imem.lb_push_stats_local_clr"}, ++ {NFP_6000_CPPTGT_MU, 23, 3, 0, 0, ++ "ctm.pe_dma_from_memory_buffer_le_swap/imem.lb_push_stats_dcache_clr"}, ++ {NFP_6000_CPPTGT_MU, 26, 0, 0, 0, "emem.lookup/imem.lookup"}, ++ {NFP_6000_CPPTGT_MU, 28, 0, 0, 0, "read32"}, ++ {NFP_6000_CPPTGT_MU, 28, 1, 0, 0, "read32_le"}, ++ {NFP_6000_CPPTGT_MU, 28, 2, 0, 0, "read32_swap"}, ++ {NFP_6000_CPPTGT_MU, 28, 3, 0, 0, "read32_swap_le"}, ++ {NFP_6000_CPPTGT_MU, 29, 1, 0, 0, "cam_lookup_add_lock"}, ++ {NFP_6000_CPPTGT_MU, 29, 2, 0, 0, "cam_lookup_add_extend"}, ++ {NFP_6000_CPPTGT_MU, 29, 3, 0, 0, "cam_lookup_add_inc"}, ++ {NFP_6000_CPPTGT_MU, 30, 2, 0, 0, "meter"}, ++ {NFP_6000_CPPTGT_MU, 31, 0, 0, 0, "write32"}, ++ {NFP_6000_CPPTGT_MU, 31, 1, 0, 0, "write32_le"}, ++ {NFP_6000_CPPTGT_MU, 31, 2, 0, 0, "write32_swap"}, ++ {NFP_6000_CPPTGT_MU, 31, 3, 0, 0, "write32_swap_le"}, ++ {NFP_6000_CPPTGT_PCIE, 0, 0, 0, 0, "read"}, ++ {NFP_6000_CPPTGT_PCIE, 0, 1, 0, 0, "read_rid"}, ++ {NFP_6000_CPPTGT_PCIE, 1, 0, 0, 0, "write"}, ++ {NFP_6000_CPPTGT_PCIE, 1, 1, 0, 0, "write_rid"}, ++ {NFP_6000_CPPTGT_PCIE, 1, 2, 0, 0, "write_vdm"}, ++ {NFP_6000_CPPTGT_PCIE, 2, 0, 0, 0, "read_int"}, ++ {NFP_6000_CPPTGT_PCIE, 3, 0, 0, 0, "write_int"}, ++ {NFP_6000_CPPTGT_ARM, 0, 0, 0, 0, "read"}, ++ {NFP_6000_CPPTGT_ARM, 1, 0, 0, 0, "write"}, ++ {NFP_6000_CPPTGT_CRYPTO, 0, 0, 0, 0, "read"}, ++ {NFP_6000_CPPTGT_CRYPTO, 1, 0, 0, 0, "write"}, ++ {NFP_6000_CPPTGT_CRYPTO, 2, 0, 0, 0, "write_fifo"}, ++ {NFP_6000_CPPTGT_CTXPB, 0, 0, 0, 0, "xpb_read"}, ++ {NFP_6000_CPPTGT_CTXPB, 0, 1, 0, 0, "ring_get"}, ++ {NFP_6000_CPPTGT_CTXPB, 0, 2, 0, 0, "interthread_signal"}, ++ {NFP_6000_CPPTGT_CTXPB, 1, 0, 0, 0, "xpb_write"}, ++ {NFP_6000_CPPTGT_CTXPB, 1, 1, 0, 0, "ring_put"}, ++ {NFP_6000_CPPTGT_CTXPB, 1, 2, 0, 0, "ctnn_write"}, ++ {NFP_6000_CPPTGT_CTXPB, 2, 0, 0, 0, "reflect_read_none"}, ++ {NFP_6000_CPPTGT_CTXPB, 2, 1, 0, 0, "reflect_read_sig_init"}, ++ {NFP_6000_CPPTGT_CTXPB, 2, 2, 0, 0, "reflect_read_sig_remote"}, ++ {NFP_6000_CPPTGT_CTXPB, 2, 3, 0, 0, "reflect_read_sig_both"}, ++ {NFP_6000_CPPTGT_CTXPB, 3, 0, 0, 0, "reflect_write_none"}, ++ {NFP_6000_CPPTGT_CTXPB, 3, 1, 0, 0, "reflect_write_sig_init"}, ++ {NFP_6000_CPPTGT_CTXPB, 3, 2, 0, 0, "reflect_write_sig_remote"}, ++ {NFP_6000_CPPTGT_CTXPB, 3, 3, 0, 0, "reflect_write_sig_both"}, ++ {NFP_6000_CPPTGT_CLS, 0, 0, 0, 0, "read"}, ++ {NFP_6000_CPPTGT_CLS, 0, 1, 0, 0, "read_le"}, ++ {NFP_6000_CPPTGT_CLS, 0, 2, 0, 0, "swap/test_compare_write"}, ++ {NFP_6000_CPPTGT_CLS, 0, 3, 0, 0, "xor"}, ++ {NFP_6000_CPPTGT_CLS, 1, 0, 0, 0, "write"}, ++ {NFP_6000_CPPTGT_CLS, 1, 1, 0, 0, "write_le"}, ++ {NFP_6000_CPPTGT_CLS, 1, 2, 0, 0, "write8_be"}, ++ {NFP_6000_CPPTGT_CLS, 1, 3, 0, 0, "write8_le"}, ++ {NFP_6000_CPPTGT_CLS, 2, 0, 0, 0, "set"}, ++ {NFP_6000_CPPTGT_CLS, 2, 1, 0, 0, "clr"}, ++ {NFP_6000_CPPTGT_CLS, 2, 2, 0, 0, "test_set"}, ++ {NFP_6000_CPPTGT_CLS, 2, 3, 0, 0, "test_clr"}, ++ {NFP_6000_CPPTGT_CLS, 3, 0, 0, 0, "set_imm"}, ++ {NFP_6000_CPPTGT_CLS, 3, 1, 0, 0, "clr_imm"}, ++ {NFP_6000_CPPTGT_CLS, 3, 2, 0, 0, "test_set_imm"}, ++ {NFP_6000_CPPTGT_CLS, 3, 3, 0, 0, "test_clr_imm"}, ++ {NFP_6000_CPPTGT_CLS, 4, 0, 0, 0, "add"}, ++ {NFP_6000_CPPTGT_CLS, 4, 1, 0, 0, "add64"}, ++ {NFP_6000_CPPTGT_CLS, 4, 2, 0, 0, "addsat"}, ++ {NFP_6000_CPPTGT_CLS, 5, 0, 0, 0, "add_imm"}, ++ {NFP_6000_CPPTGT_CLS, 5, 1, 0, 0, "add64_imm"}, ++ {NFP_6000_CPPTGT_CLS, 5, 2, 0, 0, "addsat_imm"}, ++ {NFP_6000_CPPTGT_CLS, 6, 0, 0, 0, "sub"}, ++ {NFP_6000_CPPTGT_CLS, 6, 1, 0, 0, "sub64"}, ++ {NFP_6000_CPPTGT_CLS, 6, 2, 0, 0, "subsat"}, ++ {NFP_6000_CPPTGT_CLS, 7, 0, 0, 0, "sub_imm"}, ++ {NFP_6000_CPPTGT_CLS, 7, 1, 0, 0, "sub64_imm"}, ++ {NFP_6000_CPPTGT_CLS, 7, 2, 0, 0, "subsat_imm"}, ++ {NFP_6000_CPPTGT_CLS, 8, 0, 0, 0, "queue_lock"}, ++ {NFP_6000_CPPTGT_CLS, 8, 1, 0, 0, "queue_unlock"}, ++ {NFP_6000_CPPTGT_CLS, 8, 2, 0, 0, "hash_mask"}, ++ {NFP_6000_CPPTGT_CLS, 8, 3, 0, 0, "hash_mask_clear"}, ++ {NFP_6000_CPPTGT_CLS, 9, 0, 0, 0, "get"}, ++ {NFP_6000_CPPTGT_CLS, 9, 1, 0, 0, "pop"}, ++ {NFP_6000_CPPTGT_CLS, 9, 2, 0, 0, "get_safe"}, ++ {NFP_6000_CPPTGT_CLS, 9, 3, 0, 0, "pop_safe"}, ++ {NFP_6000_CPPTGT_CLS, 10, 0, 0, 0, "ring_put"}, ++ {NFP_6000_CPPTGT_CLS, 10, 2, 0, 0, "ring_journal"}, ++ {NFP_6000_CPPTGT_CLS, 11, 0, 0, 0, "cam_lookup32"}, ++ {NFP_6000_CPPTGT_CLS, 11, 1, 0, 0, "cam_lookup32_add"}, ++ {NFP_6000_CPPTGT_CLS, 11, 2, 0, 0, "cam_lookup24"}, ++ {NFP_6000_CPPTGT_CLS, 11, 3, 0, 0, "cam_lookup24_add"}, ++ {NFP_6000_CPPTGT_CLS, 12, 0, 0, 0, "cam_lookup8"}, ++ {NFP_6000_CPPTGT_CLS, 12, 1, 0, 0, "cam_lookup8_add"}, ++ {NFP_6000_CPPTGT_CLS, 12, 2, 0, 0, "cam_lookup16"}, ++ {NFP_6000_CPPTGT_CLS, 12, 3, 0, 0, "cam_lookup16_add"}, ++ {NFP_6000_CPPTGT_CLS, 13, 0, 0, 0, "tcam_lookup32"}, ++ {NFP_6000_CPPTGT_CLS, 13, 1, 0, 0, "tcam_lookup24"}, ++ {NFP_6000_CPPTGT_CLS, 13, 2, 0, 0, "tcam_lookup16"}, ++ {NFP_6000_CPPTGT_CLS, 13, 3, 0, 0, "tcam_lookup8"}, ++ {NFP_6000_CPPTGT_CLS, 14, 0, 0, 0, "reflect_write_sig_local"}, ++ {NFP_6000_CPPTGT_CLS, 14, 1, 0, 0, "reflect_write_sig_remote"}, ++ {NFP_6000_CPPTGT_CLS, 14, 2, 0, 0, "reflect_write_sig_both"}, ++ {NFP_6000_CPPTGT_CLS, 15, 0, 0, 0, "reflect_read_sig_remote"}, ++ {NFP_6000_CPPTGT_CLS, 15, 1, 0, 0, "reflect_read_sig_local"}, ++ {NFP_6000_CPPTGT_CLS, 15, 2, 0, 0, "reflect_read_sig_both"}, ++ {NFP_6000_CPPTGT_CLS, 16, 1, 0, 0, "cam_lookup32_add_lock"}, ++ {NFP_6000_CPPTGT_CLS, 16, 2, 0, 0, "cam_lookup24_add_inc"}, ++ {NFP_6000_CPPTGT_CLS, 16, 3, 0, 0, "cam_lookup32_add_extend"}, ++ {NFP_6000_CPPTGT_CLS, 17, 0, 0, 0, "meter"}, ++ {NFP_6000_CPPTGT_CLS, 17, 2, 0, 0, "statistic"}, ++ {NFP_6000_CPPTGT_CLS, 17, 3, 0, 0, "statistic_imm"}, ++ {NFP_6000_CPPTGT_CLS, 20, 0, 0, 0, "test_add"}, ++ {NFP_6000_CPPTGT_CLS, 20, 1, 0, 0, "test_add64"}, ++ {NFP_6000_CPPTGT_CLS, 20, 2, 0, 0, "test_addsat"}, ++ {NFP_6000_CPPTGT_CLS, 21, 0, 0, 0, "test_add_imm"}, ++ {NFP_6000_CPPTGT_CLS, 21, 1, 0, 0, "test_add64_imm"}, ++ {NFP_6000_CPPTGT_CLS, 21, 2, 0, 0, "test_addsat_imm"}, ++ {NFP_6000_CPPTGT_CLS, 22, 0, 0, 0, "test_sub"}, ++ {NFP_6000_CPPTGT_CLS, 22, 1, 0, 0, "test_sub64"}, ++ {NFP_6000_CPPTGT_CLS, 22, 2, 0, 0, "test_subsat"}, ++ {NFP_6000_CPPTGT_CLS, 23, 0, 0, 0, "test_sub_imm"}, ++ {NFP_6000_CPPTGT_CLS, 23, 1, 0, 0, "test_sub64_imm"}, ++ {NFP_6000_CPPTGT_CLS, 23, 2, 0, 0, "test_subsat_imm"}, ++ {NFP_6000_CPPTGT_CLS, 24, 0, 0, 0, "ring_read"}, ++ {NFP_6000_CPPTGT_CLS, 24, 1, 0, 0, "ring_write"}, ++ {NFP_6000_CPPTGT_CLS, 24, 2, 0, 0, "ring_ordered_lock"}, ++ {NFP_6000_CPPTGT_CLS, 24, 3, 0, 0, "ring_ordered_unlock"}, ++ {NFP_6000_CPPTGT_CLS, 25, 0, 0, 0, "ring_workq_add_thread"}, ++ {NFP_6000_CPPTGT_CLS, 25, 1, 0, 0, "ring_workq_add_work"} ++}; ++ ++static int ++nfp_me_print_invalid (uint64_t instr, struct disassemble_info *dinfo) ++{ ++ const char * err_msg = N_(":"); ++ dinfo->fprintf_func (dinfo->stream, "%s 0x%llx", err_msg, (long long) instr); ++ return _NFP_ERR_CONT; ++} ++ ++static bfd_boolean ++nfp_me_is_imm_opnd10 (unsigned int opnd) ++{ ++ return _BF (opnd, 9, 8) == 0x3; ++} ++ ++static bfd_boolean ++nfp_me_is_imm_opnd8 (unsigned int opnd) ++{ ++ return _BTST (opnd, 5); ++} ++ ++static unsigned int ++nfp_me_imm_opnd10 (unsigned int opnd) ++{ ++ return nfp_me_is_imm_opnd10 (opnd) ? (opnd & 0xff) : ~0U; ++} ++ ++static unsigned int ++nfp_me_imm_opnd8 (unsigned int opnd, unsigned int imm8_msb) ++{ ++ unsigned int v = (imm8_msb << 7) | _BFS (opnd, 7, 6, 5) | _BF (opnd, 4, 0); ++ ++ return nfp_me_is_imm_opnd8 (opnd) ? v : ~0U; ++} ++ ++/* Print an unrestricted/10-bit operand. ++ This can mostly be generic across NFP families at the moment. */ ++static bfd_boolean ++nfp_me_print_opnd10 (unsigned int opnd, char bank, int num_ctx, int lmem_ext, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int n = _BF (opnd, (num_ctx == 8) ? 3 : 4, 0); ++ ++ /* Absolute GPR. */ ++ if (_BF (opnd, 9, 7) == 0x1) ++ dinfo->fprintf_func (dinfo->stream, "@gpr%c_%d", bank, _BF (opnd, 6, 0)); ++ ++ /* Relative GPR. */ ++ else if (_BF (opnd, 9, 6) == 0x0) ++ dinfo->fprintf_func (dinfo->stream, "gpr%c_%d", bank, n); ++ ++ /* Indexed Xfer. */ ++ else if (_BF (opnd, 9, 7) == 0x2) ++ { ++ dinfo->fprintf_func (dinfo->stream, "*$index"); ++ if (_BF (opnd, 2, 1) == 0x1) ++ dinfo->fprintf_func (dinfo->stream, "++"); ++ else if (_BF (opnd, 2, 1) == 0x2) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ } ++ ++ /* Relative Xfer. */ ++ else if (_BF (opnd, 9, 7) == 0x3) ++ { ++ if (_BTST (opnd, 6)) ++ n += (num_ctx == 8 ? 16 : 32); ++ dinfo->fprintf_func (dinfo->stream, "$xfer_%d", n); ++ } ++ ++ /* Indexed Next Neighbour. */ ++ else if (_BF (opnd, 9, 6) == 0x9) ++ { ++ dinfo->fprintf_func (dinfo->stream, "*n$index"); ++ if (_BTST (opnd, 1)) ++ dinfo->fprintf_func (dinfo->stream, "++"); ++ } ++ ++ /* Relative Next Neighbour. */ ++ else if (_BF (opnd, 9, 6) == 0xa) ++ { ++ dinfo->fprintf_func (dinfo->stream, "n$reg_%d", n); ++ } ++ ++ /* Indexed LMEM. */ ++ else if (_BF (opnd, 9, 6) == 0x8) ++ { ++ n = _BF (opnd, 5, 5) + (lmem_ext * 2); ++ dinfo->fprintf_func (dinfo->stream, "*l$index%d", n); ++ if (_BTST (opnd, 4)) ++ dinfo->fprintf_func (dinfo->stream, _BTST (opnd, 0) ? "--" : "++"); ++ else if (_BF (opnd, 3, 0)) ++ dinfo->fprintf_func (dinfo->stream, "[%d]", _BF (opnd, 3, 0)); ++ } ++ ++ /* 8-bit Constant value. */ ++ else if (_BF (opnd, 9, 8) == 0x3) ++ dinfo->fprintf_func (dinfo->stream, "0x%x", _BF (opnd, 7, 0)); ++ ++ else ++ { ++ dinfo->fprintf_func (dinfo->stream, "", opnd); ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++/* Print a restricted/8-bit operand. ++ This can mostly be generic across NFP families at the moment. */ ++ ++static bfd_boolean ++nfp_me_print_opnd8 (unsigned int opnd, char bank, int num_ctx, int lmem_ext, ++ unsigned int imm8_msb, struct disassemble_info *dinfo) ++{ ++ unsigned int n = _BF (opnd, (num_ctx == 8) ? 3 : 4, 0); ++ ++ /* Relative GPR. */ ++ if (_BF (opnd, 7, 5) == 0x0) ++ dinfo->fprintf_func (dinfo->stream, "gpr%c_%d", bank, n); ++ ++ /* Relative Xfer. */ ++ else if (_BF (opnd, 7, 5) == 0x4) ++ dinfo->fprintf_func (dinfo->stream, "$xfer_%d", n); ++ ++ /* Relative Xfer. */ ++ else if (_BF (opnd, 7, 5) == 0x6) ++ { ++ n += (num_ctx == 8 ? 16 : 32); ++ dinfo->fprintf_func (dinfo->stream, "$xfer_%d", n); ++ } ++ ++ /* Indexed Xfer. */ ++ else if ((_BF (opnd, 7, 4) == 0x4) && (!_BTST (opnd, 0))) ++ { ++ dinfo->fprintf_func (dinfo->stream, "*$index"); ++ if (_BF (opnd, 2, 1) == 0x1) ++ dinfo->fprintf_func (dinfo->stream, "++"); ++ else if (_BF (opnd, 2, 1) == 0x2) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ } ++ ++ /* Indexed NN. */ ++ else if ((_BF (opnd, 7, 4) == 0x4) && (_BTST (opnd, 0))) ++ { ++ dinfo->fprintf_func (dinfo->stream, "*n$index"); ++ if (_BTST (opnd, 1)) ++ dinfo->fprintf_func (dinfo->stream, "++"); ++ } ++ ++ /* Indexed LMEM. */ ++ else if (_BF (opnd, 7, 4) == 0x5) ++ { ++ n = _BF (opnd, 3, 3) + (lmem_ext * 2); ++ dinfo->fprintf_func (dinfo->stream, "*l$index%d", n); ++ if (_BF (opnd, 2, 0)) ++ dinfo->fprintf_func (dinfo->stream, "[%d]", _BF (opnd, 2, 0)); ++ } ++ ++ /* 7+1-bit Constant value. */ ++ else if (_BTST (opnd, 5)) ++ { ++ n = (imm8_msb << 7) | _BFS (opnd, 7, 6, 5) | _BF (opnd, 4, 0); ++ dinfo->fprintf_func (dinfo->stream, "0x%x", n); ++ } ++ ++ else ++ { ++ dinfo->fprintf_func (dinfo->stream, "", opnd); ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++static int ++nfp_me27_28_print_alu_shf (uint64_t instr, unsigned int pred_cc, ++ unsigned int dst_lmext, unsigned int src_lmext, ++ unsigned int gpr_wrboth, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int op = _BF (instr, 35, 33); ++ unsigned int srcA = _BF (instr, 7, 0); ++ unsigned int srcB = _BF (instr, 17, 10); ++ unsigned int dst = _BF (instr, 27, 20); ++ unsigned int sc = _BF (instr, 9, 8); ++ unsigned int imm_msb = _BTST (instr, 18); ++ unsigned int swap = _BTST (instr, 19); ++ unsigned int shift = _BF (instr, 32, 28); ++ char dst_bank = 'A' + _BTST (instr, 36); ++ unsigned int nocc = _BTST (instr, 40); ++ bfd_boolean err = FALSE; ++ ++ if (swap) ++ { ++ unsigned int tmp = srcA; ++ srcA = srcB; ++ srcB = tmp; ++ } ++ ++ /* alu_shf, dbl_shf, asr. */ ++ if (op < 7) ++ { ++ if (sc == 3) ++ dinfo->fprintf_func (dinfo->stream, "dbl_shf["); ++ else if (op == 6) ++ dinfo->fprintf_func (dinfo->stream, "asr["); ++ else ++ dinfo->fprintf_func (dinfo->stream, "alu_shf["); ++ ++ /* dest operand */ ++ if (nfp_me_is_imm_opnd8 (dst)) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ else ++ err = err || !nfp_me_print_opnd8 (dst, dst_bank, num_ctx, ++ dst_lmext, imm_msb, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ ++ /* A operand. */ ++ if (op != 6) ++ { ++ if ((op < 2) && (sc != 3)) /* Not dbl_shf. */ ++ dinfo->fprintf_func (dinfo->stream, "--"); /* B or ~B operator. */ ++ else ++ err = err || !nfp_me_print_opnd8 (srcA, (swap) ? 'B' : 'A', ++ num_ctx, src_lmext, imm_msb, ++ dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ ++ /* Operator (not for dbl_shf). */ ++ if (sc != 3) ++ { ++ dinfo->fprintf_func (dinfo->stream, "%s, ", ++ nfp_mealu_shf_op[op]); ++ } ++ } ++ ++ /* B operand. */ ++ err = err || !nfp_me_print_opnd8 (srcB, (swap) ? 'A' : 'B', ++ num_ctx, src_lmext, imm_msb, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ ++ /* Shift */ ++ if (sc == 0) ++ dinfo->fprintf_func (dinfo->stream, ">>rot%d", shift); ++ else if (sc == 2) ++ { ++ if (shift) ++ dinfo->fprintf_func (dinfo->stream, "<<%d", (32 - shift)); ++ else ++ dinfo->fprintf_func (dinfo->stream, "<fprintf_func (dinfo->stream, ">>%d", shift); ++ else ++ dinfo->fprintf_func (dinfo->stream, ">>indirect"); ++ } ++ } ++ /* Byte Align. */ ++ else if (op == 7) ++ { ++ dinfo->fprintf_func (dinfo->stream, "byte_align_%s[", ++ ((sc == 2) ? "le" : "be")); ++ ++ /* Dest operand. */ ++ if (nfp_me_is_imm_opnd8 (dst)) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ else ++ err = err || !nfp_me_print_opnd8 (dst, dst_bank, num_ctx, ++ dst_lmext, imm_msb, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ ++ if (sc == 2) ++ err = err || !nfp_me_print_opnd8 (srcA, (swap) ? 'B' : 'A', num_ctx, ++ 0, imm_msb, dinfo); ++ else ++ err = err || !nfp_me_print_opnd8 (srcB, (swap) ? 'A' : 'B', num_ctx, ++ 0, imm_msb, dinfo); ++ } ++ ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ if (nocc) ++ dinfo->fprintf_func (dinfo->stream, ", no_cc"); ++ if (gpr_wrboth) ++ dinfo->fprintf_func (dinfo->stream, ", gpr_wrboth"); ++ if (pred_cc) ++ dinfo->fprintf_func (dinfo->stream, ", predicate_cc"); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me27_28_print_alu (uint64_t instr, unsigned int pred_cc, ++ unsigned int dst_lmext, unsigned int src_lmext, ++ unsigned int gpr_wrboth, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int op = _BF (instr, 35, 31); ++ unsigned int srcA = _BF (instr, 9, 0); ++ unsigned int srcB = _BF (instr, 19, 10); ++ unsigned int dst = _BF (instr, 29, 20); ++ unsigned int swap = _BTST (instr, 30); ++ char dst_bank = 'A' + _BTST (instr, 36); ++ unsigned int nocc = _BTST (instr, 40); ++ int do_close_bracket = 1; ++ bfd_boolean err = FALSE; ++ ++ if (swap) ++ { ++ unsigned int tmp = srcA; ++ srcA = srcB; ++ srcB = tmp; ++ } ++ ++ switch (op) ++ { ++ case 3: /* pop_count3[dst, srcB] */ ++ case 6: /* pop_count1[srcB] */ ++ case 7: /* pop_count2[srcB] */ ++ case 14: /* ffs[dst, srcB] */ ++ case 15: /* cam_read_tag[dst, srcB] */ ++ case 31: /* cam_read_state[dst, srcB] */ ++ dinfo->fprintf_func (dinfo->stream, "%s[", nfp_me27_28_alu_op[op]); ++ ++ /* No dest for pop_count1/2. */ ++ if ((op != 6) && (op != 7)) ++ { ++ /* dest operand */ ++ if (nfp_me_is_imm_opnd10 (dst)) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ else ++ err = err || !nfp_me_print_opnd10 (dst, dst_bank, num_ctx, ++ dst_lmext, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ } ++ ++ /* B operand. */ ++ err = err || !nfp_me_print_opnd10 (srcB, (swap) ? 'A' : 'B', ++ num_ctx, src_lmext, dinfo); ++ break; ++ ++ /* cam_clear. */ ++ case 11: ++ do_close_bracket = 0; ++ dinfo->fprintf_func (dinfo->stream, "cam_clear"); ++ break; ++ ++ /* cam_lookup. */ ++ case 23: ++ do_close_bracket = 0; ++ dinfo->fprintf_func (dinfo->stream, "%s[", nfp_me27_28_alu_op[op]); ++ ++ /* Dest operand. */ ++ if (nfp_me_is_imm_opnd10 (dst)) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ else ++ err = err || !nfp_me_print_opnd10 (dst, dst_bank, num_ctx, ++ dst_lmext, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ ++ /* A operand. */ ++ err = err || !nfp_me_print_opnd10 (srcA, (swap) ? 'B' : 'A', ++ num_ctx, src_lmext, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ ++ if (_BF (srcB, 1, 0)) ++ { ++ unsigned int n = _BTST (srcB, 1); ++ if (_BTST (srcB, 4)) /* Only for MEv28. */ ++ n += 2; ++ dinfo->fprintf_func (dinfo->stream, ", lm_addr%d[%d]", n, ++ _BF (srcB, 3, 2)); ++ } ++ ++ break; ++ ++ case 19: /* cam_write. */ ++ case 27: /* cam_write_state. */ ++ dinfo->fprintf_func (dinfo->stream, "%s[", nfp_me27_28_alu_op[op]); ++ err = err || !nfp_me_print_opnd10 (srcB, (swap) ? 'A' : 'B', ++ num_ctx, src_lmext, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ if (op == 19) ++ { ++ err = err || !nfp_me_print_opnd10 (srcA, (swap) ? 'B' : 'A', ++ num_ctx, src_lmext, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ } ++ dinfo->fprintf_func (dinfo->stream, "%d", (dst & 0xf)); ++ break; ++ ++ /* CRC. */ ++ case 18: ++ do_close_bracket = 0; ++ dinfo->fprintf_func (dinfo->stream, "crc_%s[", ++ _BTST (srcA, 3) ? "le" : "be"); ++ if (!nfp_me27_28_crc_op[_BF (srcA, 7, 5)]) ++ { ++ dinfo->fprintf_func (dinfo->stream, _(", , ")); ++ err = TRUE; ++ } ++ else ++ { ++ dinfo->fprintf_func (dinfo->stream, "%s, ", ++ nfp_me27_28_crc_op[_BF (srcA, 7, 5)]); ++ } ++ ++ /* Dest operand. */ ++ if (nfp_me_is_imm_opnd10 (dst)) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ else ++ err = err || !nfp_me_print_opnd10 (dst, dst_bank, num_ctx, ++ dst_lmext, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ ++ /* B operand. */ ++ err = err || !nfp_me_print_opnd10 (srcB, (swap) ? 'A' : 'B', ++ num_ctx, src_lmext, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ if (_BF (srcA, 2, 0)) ++ dinfo->fprintf_func (dinfo->stream, ", %s", ++ nfp_me27_28_crc_bytes[_BF (srcA, 2, 0)]); ++ if (_BTST (srcA, 4)) ++ dinfo->fprintf_func (dinfo->stream, ", bit_swap"); ++ break; ++ ++ default: ++ /* s += 'alu[%s, %s, %s, %s]' % (dst, srcAs, op, srcBs). */ ++ dinfo->fprintf_func (dinfo->stream, "alu["); ++ ++ /* Dest operand. */ ++ if (nfp_me_is_imm_opnd10 (dst)) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ else ++ err = err || !nfp_me_print_opnd10 (dst, dst_bank, num_ctx, ++ dst_lmext, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ ++ /* A operand. */ ++ if ((op == 0) || (op == 4)) /* B only operators. */ ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ else ++ err = err || !nfp_me_print_opnd10 (srcA, (swap) ? 'B' : 'A', ++ num_ctx, src_lmext, dinfo); ++ ++ if (!nfp_me27_28_alu_op[op]) ++ { ++ dinfo->fprintf_func (dinfo->stream, ", , ", op); ++ err = TRUE; ++ } ++ else ++ { ++ dinfo->fprintf_func (dinfo->stream, ", %s, ", ++ nfp_me27_28_alu_op[op]); ++ } ++ ++ /* B operand. */ ++ err = err || !nfp_me_print_opnd10 (srcB, (swap) ? 'A' : 'B', ++ num_ctx, src_lmext, dinfo); ++ break; ++ } ++ ++ if (do_close_bracket) ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ ++ if (nocc) ++ dinfo->fprintf_func (dinfo->stream, ", no_cc"); ++ if (gpr_wrboth) ++ dinfo->fprintf_func (dinfo->stream, ", gpr_wrboth"); ++ if (pred_cc) ++ dinfo->fprintf_func (dinfo->stream, ", predicate_cc"); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me27_28_print_immed (uint64_t instr, unsigned int pred_cc, ++ unsigned int dst_lmext, ++ unsigned int gpr_wrboth, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int srcA = _BF (instr, 9, 0); ++ unsigned int srcB = _BF (instr, 19, 10); ++ unsigned int imm = _BF (instr, 27, 20); ++ unsigned int by = _BTST (instr, 29); ++ unsigned int wd = _BTST (instr, 30); ++ unsigned int inv = _BTST (instr, 31); ++ unsigned int byte_shift = _BF (instr, 34, 33); ++ bfd_boolean err = FALSE; ++ ++ if (nfp_me_is_imm_opnd10 (srcB)) ++ { ++ imm = (imm << 8) | nfp_me_imm_opnd10 (srcB); ++ if (nfp_me_is_imm_opnd10 (srcA) && (imm == 0)) ++ { ++ dinfo->fprintf_func (dinfo->stream, "nop"); ++ return 0; ++ } ++ } ++ else ++ { ++ imm = (imm << 8) | nfp_me_imm_opnd10 (srcA); ++ } ++ ++ if (inv) ++ imm = (imm ^ 0xffff) | 0xffff0000U; ++ ++ if (by) ++ { ++ dinfo->fprintf_func (dinfo->stream, "immed_b%d[", byte_shift); ++ imm &= 0xff; ++ } ++ else if (wd) ++ { ++ dinfo->fprintf_func (dinfo->stream, "immed_w%d[", (byte_shift / 2)); ++ imm &= 0xffff; ++ } ++ else ++ dinfo->fprintf_func (dinfo->stream, "immed["); ++ ++ /* Dest. */ ++ if (nfp_me_is_imm_opnd10 (srcA) && nfp_me_is_imm_opnd10 (srcB)) ++ dinfo->fprintf_func (dinfo->stream, "--"); /* No Dest. */ ++ else if (nfp_me_is_imm_opnd10 (srcA)) ++ err = err || !nfp_me_print_opnd10 (srcB, 'B', num_ctx, dst_lmext, dinfo); ++ else ++ err = err || !nfp_me_print_opnd10 (srcA, 'A', num_ctx, dst_lmext, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", 0x%x", imm); ++ ++ if ((!by) && (!wd) && (byte_shift)) ++ dinfo->fprintf_func (dinfo->stream, ", <<%d", (byte_shift * 8)); ++ ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ ++ if (gpr_wrboth) ++ dinfo->fprintf_func (dinfo->stream, ", gpr_wrboth"); ++ if (pred_cc) ++ dinfo->fprintf_func (dinfo->stream, ", predicate_cc"); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me27_28_print_ld_field (uint64_t instr, unsigned int pred_cc, ++ unsigned int dst_lmext, unsigned int src_lmext, ++ unsigned int gpr_wrboth, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int load_cc = _BTST (instr, 34); ++ unsigned int shift = _BF (instr, 32, 28); ++ unsigned int byte_mask = _BF (instr, 27, 24); ++ unsigned int zerof = _BTST (instr, 20); ++ unsigned int swap = _BTST (instr, 19); ++ unsigned int imm_msb = _BTST (instr, 18); ++ unsigned int src = _BF (instr, 17, 10); ++ unsigned int sc = _BF (instr, 9, 8); ++ unsigned int dst = _BF (instr, 7, 0); ++ bfd_boolean err = FALSE; ++ ++ if (swap) ++ { ++ unsigned int tmp = src; ++ src = dst; ++ dst = tmp; ++ } ++ ++ if (zerof) ++ dinfo->fprintf_func (dinfo->stream, "ld_field_w_clr["); ++ else ++ dinfo->fprintf_func (dinfo->stream, "ld_field["); ++ ++ err = err || !nfp_me_print_opnd8 (dst, (swap) ? 'B' : 'A', num_ctx, ++ dst_lmext, imm_msb, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", %d%d%d%d, ", ++ _BTST (byte_mask, 3), ++ _BTST (byte_mask, 2), ++ _BTST (byte_mask, 1), _BTST (byte_mask, 0)); ++ err = err || !nfp_me_print_opnd8 (src, (swap) ? 'A' : 'B', num_ctx, ++ src_lmext, imm_msb, dinfo); ++ ++ if ((sc == 0) && (shift != 0)) ++ dinfo->fprintf_func (dinfo->stream, ", >>rot%d", shift); ++ else if (sc == 1) ++ { ++ if (shift) ++ dinfo->fprintf_func (dinfo->stream, ", >>%d", shift); ++ else ++ dinfo->fprintf_func (dinfo->stream, ", >>indirect"); ++ } ++ else if (sc == 2) ++ { ++ if (shift) ++ dinfo->fprintf_func (dinfo->stream, ", <<%d", (32 - shift)); ++ else ++ dinfo->fprintf_func (dinfo->stream, ", <fprintf_func (dinfo->stream, ", >>dbl%d", shift); ++ ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ ++ if (load_cc) ++ dinfo->fprintf_func (dinfo->stream, ", load_cc"); ++ if (gpr_wrboth) ++ dinfo->fprintf_func (dinfo->stream, ", gpr_wrboth"); ++ if (pred_cc) ++ dinfo->fprintf_func (dinfo->stream, ", predicate_cc"); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me27_28_print_ctx_arb (uint64_t instr, struct disassemble_info *dinfo) ++{ ++ unsigned int resume_addr = _BFS (instr, 40, 40, 13) | _BF (instr, 34, 22); ++ unsigned int defer = _BF (instr, 21, 20); ++ unsigned int no_load = _BTST (instr, 19); ++ unsigned int resume = _BTST (instr, 18); ++ unsigned int bpt = _BTST (instr, 17); ++ unsigned int sig_or = _BTST (instr, 16); ++ unsigned int ev_mask = _BF (instr, 15, 0); ++ ++ dinfo->fprintf_func (dinfo->stream, "ctx_arb["); ++ if (bpt) ++ dinfo->fprintf_func (dinfo->stream, "bpt"); ++ else if (ev_mask == 1) ++ dinfo->fprintf_func (dinfo->stream, "voluntary"); ++ else if ((!no_load) && (ev_mask == 0)) ++ { ++ dinfo->fprintf_func (dinfo->stream, "kill"); ++ sig_or = 0; ++ } ++ else if (ev_mask == 0) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ else ++ { ++ int first_print = 1; ++ unsigned int n; ++ ++ for (n = 1; n < 16; n++) ++ { ++ if (!_BTST (ev_mask, n)) ++ continue; ++ dinfo->fprintf_func (dinfo->stream, "%ssig%d", ++ (first_print) ? "" : ", ", n); ++ first_print = 0; ++ } ++ } ++ ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ ++ if (sig_or) ++ dinfo->fprintf_func (dinfo->stream, ", any"); ++ if (resume) ++ dinfo->fprintf_func (dinfo->stream, ", br[.%d]", resume_addr); ++ if (defer) ++ dinfo->fprintf_func (dinfo->stream, ", defer[%d]", defer); ++ ++ return 0; ++} ++ ++static int ++nfp_me27_28_print_local_csr (uint64_t instr, ++ unsigned int src_lmext, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int srcA = _BF (instr, 9, 0); ++ unsigned int srcB = _BF (instr, 19, 10); ++ unsigned int wr = _BTST (instr, 21); ++ unsigned int csr_num = _BF (instr, 32, 22); ++ unsigned int src = srcA; ++ char src_bank = 'A'; ++ bfd_boolean err = FALSE; ++ ++ if (nfp_me_is_imm_opnd10 (srcA) && !nfp_me_is_imm_opnd10 (srcB)) ++ { ++ src_bank = 'B'; ++ src = srcB; ++ } ++ ++ /* MEv28 does not have urd/uwr. */ ++ if (csr_num == 1) ++ { ++ if (wr) ++ { ++ dinfo->fprintf_func (dinfo->stream, "uwr[*u$index%d++, ", ++ (int) _BTST (instr, 20)); ++ err = err || !nfp_me_print_opnd10 (src, src_bank, num_ctx, ++ src_lmext, dinfo); ++ } ++ else ++ { ++ dinfo->fprintf_func (dinfo->stream, "urd["); ++ err = err || !nfp_me_print_opnd10 (src, src_bank, num_ctx, ++ src_lmext, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", *u$index%d++", ++ (int) _BTST (instr, 20)); ++ } ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ } ++ else ++ { ++ const char *nm = NULL; ++ ++ if (csr_num < ARRAY_SIZE (nfp_me27_28_mecsrs)) ++ nm = nfp_me27_28_mecsrs[csr_num]; ++ ++ dinfo->fprintf_func (dinfo->stream, "local_csr_%s[", ++ (wr) ? "wr" : "rd"); ++ if (nm) ++ dinfo->fprintf_func (dinfo->stream, "%s", nm); ++ else ++ dinfo->fprintf_func (dinfo->stream, "0x%x", (csr_num * 4)); ++ ++ if (wr) ++ { ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ err = err || !nfp_me_print_opnd10 (src, src_bank, num_ctx, ++ src_lmext, dinfo); ++ } ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ } ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me27_28_print_branch (uint64_t instr, ++ const char *br_inpstates[16], ++ struct disassemble_info *dinfo) ++{ ++ unsigned int br_op = _BF (instr, 4, 0); ++ unsigned int ctx_sig_state = _BF (instr, 17, 14); ++ unsigned int defer = _BF (instr, 21, 20); ++ unsigned int br_addr = _BFS (instr, 40, 40, 13) | _BF (instr, 34, 22); ++ int ret = 0; ++ ++ if (!nfp_me27_28_br_ops[br_op]) ++ { ++ dinfo->fprintf_func (dinfo->stream, _("[")); ++ ret = _NFP_ERR_CONT; ++ } ++ else ++ dinfo->fprintf_func (dinfo->stream, "%s[", nfp_me27_28_br_ops[br_op]); ++ ++ switch (br_op) ++ { ++ case 16: /* br=ctx */ ++ case 17: /* br!=ctx */ ++ case 18: /* br_signal */ ++ case 19: /* br_!signal */ ++ dinfo->fprintf_func (dinfo->stream, "%d, ", ctx_sig_state); ++ break; ++ case 20: /* "br_inp_state" */ ++ case 21: /* "br_!inp_state" */ ++ dinfo->fprintf_func (dinfo->stream, "%s, ", ++ br_inpstates[ctx_sig_state]); ++ break; ++ case 22: /* "br_cls_state" */ ++ case 23: /* "br_!cls_state" */ ++ dinfo->fprintf_func (dinfo->stream, "cls_ring%d_status, ", ++ ctx_sig_state); ++ break; ++ default: ++ break; ++ } ++ ++ dinfo->fprintf_func (dinfo->stream, ".%d]", br_addr); ++ ++ if (defer) ++ dinfo->fprintf_func (dinfo->stream, ", defer[%d]", defer); ++ ++ return ret; ++} ++ ++static int ++nfp_me27_28_print_br_byte (uint64_t instr, ++ unsigned int src_lmext, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int srcA = _BF (instr, 7, 0); ++ unsigned int by = _BF (instr, 9, 8); ++ unsigned int srcB = _BF (instr, 17, 10); ++ unsigned int imm_msb = _BTST (instr, 18); ++ unsigned int eq = _BTST (instr, 19); ++ unsigned int defer = _BF (instr, 21, 20); ++ unsigned int br_addr = _BFS (instr, 40, 40, 13) | _BF (instr, 34, 22); ++ bfd_boolean err = FALSE; ++ ++ if (eq) ++ dinfo->fprintf_func (dinfo->stream, "br=byte["); ++ else ++ dinfo->fprintf_func (dinfo->stream, "br!=byte["); ++ ++ if (nfp_me_is_imm_opnd8 (srcA)) ++ err = err || !nfp_me_print_opnd8 (srcB, 'B', num_ctx, ++ src_lmext, imm_msb, dinfo); ++ else ++ err = err || !nfp_me_print_opnd8 (srcA, 'A', num_ctx, ++ src_lmext, imm_msb, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", %d, ", by); ++ ++ if (nfp_me_is_imm_opnd8 (srcA)) ++ err = err || !nfp_me_print_opnd8 (srcA, 'A', num_ctx, ++ src_lmext, imm_msb, dinfo); ++ else ++ err = err || !nfp_me_print_opnd8 (srcB, 'B', num_ctx, ++ src_lmext, imm_msb, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", .%d]", br_addr); ++ ++ if (defer) ++ dinfo->fprintf_func (dinfo->stream, ", defer[%d]", defer); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me27_28_print_br_bit (uint64_t instr, unsigned int src_lmext, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int srcA = _BF (instr, 7, 0); ++ unsigned int srcB = _BF (instr, 17, 10); ++ unsigned int b = _BTST (instr, 18); ++ unsigned int defer = _BF (instr, 21, 20); ++ unsigned int br_addr = _BFS (instr, 40, 40, 13) | _BF (instr, 34, 22); ++ bfd_boolean err = FALSE; ++ ++ if (b) ++ dinfo->fprintf_func (dinfo->stream, "br_bset["); ++ else ++ dinfo->fprintf_func (dinfo->stream, "br_bclr["); ++ ++ if (nfp_me_is_imm_opnd8 (srcA)) ++ { ++ err = err ++ || !nfp_me_print_opnd8 (srcB, 'B', num_ctx, src_lmext, 0, dinfo); ++ b = (nfp_me_imm_opnd8 (srcA, 0) - 1) & 0x1f; ++ } ++ else ++ { ++ err = err ++ || !nfp_me_print_opnd8 (srcA, 'A', num_ctx, src_lmext, 0, dinfo); ++ b = (nfp_me_imm_opnd8 (srcB, 0) - 1) & 0x1f; ++ } ++ ++ dinfo->fprintf_func (dinfo->stream, ", %d, .%d]", b, br_addr); ++ ++ if (defer) ++ dinfo->fprintf_func (dinfo->stream, ", defer[%d]", defer); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me27_28_print_br_alu (uint64_t instr, unsigned int src_lmext, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int srcA = _BF (instr, 9, 0); ++ unsigned int srcB = _BF (instr, 19, 10); ++ unsigned int defer = _BF (instr, 21, 20); ++ unsigned int imm = _BF (instr, 30, 22); ++ bfd_boolean err = FALSE; ++ ++ if (nfp_me_is_imm_opnd10 (srcA)) ++ imm = (imm << 8) | nfp_me_imm_opnd10 (srcA); ++ else ++ imm = (imm << 8) | nfp_me_imm_opnd10 (srcB); ++ ++ if (!imm) ++ dinfo->fprintf_func (dinfo->stream, "rtn["); ++ else ++ dinfo->fprintf_func (dinfo->stream, "jump["); ++ ++ if (nfp_me_is_imm_opnd10 (srcA)) ++ err = err || !nfp_me_print_opnd10 (srcB, 'B', num_ctx, src_lmext, dinfo); ++ else ++ err = err || !nfp_me_print_opnd10 (srcA, 'A', num_ctx, src_lmext, dinfo); ++ ++ if (imm) ++ dinfo->fprintf_func (dinfo->stream, ", .%d", imm); ++ ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ ++ if (defer) ++ dinfo->fprintf_func (dinfo->stream, ", defer[%d]", defer); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me27_28_print_mult (uint64_t instr, unsigned int pred_cc, ++ unsigned int dst_lmext, unsigned int src_lmext, ++ unsigned int gpr_wrboth, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int srcA = _BF (instr, 9, 0); ++ unsigned int srcB = _BF (instr, 19, 10); ++ unsigned int mstep = _BF (instr, 22, 20); ++ char dst_bank = 'A' + _BTST (instr, 23); ++ unsigned int swap = _BTST (instr, 30); ++ unsigned int mtype = _BF (instr, 32, 31); ++ unsigned int nocc = _BTST (instr, 40); ++ bfd_boolean err = FALSE; ++ ++ if (swap) ++ { ++ unsigned int tmp = srcA; ++ srcA = srcB; ++ srcB = tmp; ++ } ++ ++ dinfo->fprintf_func (dinfo->stream, "mul_step["); ++ ++ if (mstep >= 4) ++ err = err ++ || !nfp_me_print_opnd10 (srcA, dst_bank, num_ctx, dst_lmext, dinfo); ++ else ++ err = err || !nfp_me_print_opnd10 (srcA, (swap) ? 'B' : 'A', num_ctx, ++ src_lmext, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ ++ if (mstep >= 4) ++ dinfo->fprintf_func (dinfo->stream, "--"); ++ else ++ err = err || !nfp_me_print_opnd10 (srcB, (swap) ? 'A' : 'B', num_ctx, ++ src_lmext, dinfo); ++ ++ dinfo->fprintf_func (dinfo->stream, "], %s", nfp_me27_28_mult_types[mtype]); ++ if (mtype > 0) ++ { ++ const char *s = nfp_me27_28_mult_steps[mstep]; ++ if (!s) ++ { ++ s = ""; ++ err = TRUE; ++ } ++ dinfo->fprintf_func (dinfo->stream, "_%s", s); ++ } ++ ++ if (nocc) ++ dinfo->fprintf_func (dinfo->stream, ", no_cc"); ++ if (gpr_wrboth) ++ dinfo->fprintf_func (dinfo->stream, ", gpr_wrboth"); ++ if (pred_cc) ++ dinfo->fprintf_func (dinfo->stream, ", predicate_cc"); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++_nfp_cmp_mnmnc (const void *arg_a, const void *arg_b) ++{ ++ const nfp_cmd_mnemonic *a = arg_a; ++ const nfp_cmd_mnemonic *b = arg_b; ++ ++ if (a->cpp_target != b->cpp_target) ++ return (a->cpp_target > b->cpp_target) - (a->cpp_target < b->cpp_target); ++ ++ if (a->cpp_action != b->cpp_action) ++ return (a->cpp_action > b->cpp_action) - (a->cpp_action < b->cpp_action); ++ ++ return (a->cpp_token > b->cpp_token) - (a->cpp_token < b->cpp_token); ++} ++ ++static const char * ++nfp_me_find_mnemonic (unsigned int cpp_tgt, unsigned int cpp_act, ++ unsigned int cpp_tok, unsigned int cpp_len, ++ const nfp_cmd_mnemonic * mnemonics, ++ size_t mnemonics_cnt) ++{ ++ nfp_cmd_mnemonic search_key = { cpp_tgt, cpp_act, cpp_tok, 0, 0, NULL }; ++ const nfp_cmd_mnemonic *cmd = NULL; ++ ++ cmd = bsearch (&search_key, mnemonics, mnemonics_cnt, ++ sizeof (nfp_cmd_mnemonic), _nfp_cmp_mnmnc); ++ ++ if (!cmd) ++ return NULL; ++ ++ /* Make sure we backtrack to the first entry that still matches the three ++ bsearched fields - then we simply iterate and compare cpp_len. */ ++ while ((cmd > mnemonics) && (_nfp_cmp_mnmnc (&cmd[-1], &search_key) == 0)) ++ --cmd; ++ ++ /* Now compare by cpp_len and make sure we stay in range. */ ++ for (; (cmd < (mnemonics + mnemonics_cnt)) ++ && (_nfp_cmp_mnmnc (cmd, &search_key) == 0); ++cmd) ++ { ++ if ((cpp_len & cmd->len_mask) == cmd->len_fixed) ++ return cmd->mnemonic; ++ } ++ ++ return NULL; ++} ++ ++/* NFP-32xx (ME Version 2.7). */ ++ ++static int ++nfp_me27_print_cmd (uint64_t instr, int third_party_32bit, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int srcA = _BF (instr, 7, 0); ++ unsigned int ctxswap_defer = _BF (instr, 9, 8); ++ unsigned int srcB = _BF (instr, 17, 10); ++ unsigned int token = _BF (instr, 19, 18); ++ unsigned int xfer = _BFS (instr, 40, 40, 5) | _BF (instr, 24, 20); ++ unsigned int cpp_len = _BF (instr, 27, 25); ++ unsigned int sig = _BF (instr, 31, 28); ++ unsigned int tgtcmd = _BF (instr, 38, 32); ++ unsigned int indref = _BTST (instr, 41); ++ unsigned int mode = _BF (instr, 44, 42); ++ ++ bfd_boolean err = FALSE; ++ int cpp_target = -1; ++ int cpp_action = -1; ++ const char *mnemonic = NULL; ++ unsigned int imm; ++ unsigned int valBA; ++ int visswap = ((mode == 1) || (mode == 3)); ++ ++ imm = (sig << 10) | (cpp_len << 7) | ((xfer & 0x1f) << 2) | token; ++ valBA = (srcB << 8) | srcA; ++ ++ if (mode == 6) ++ { ++ token = 0; ++ sig = 0; ++ xfer = 0; ++ } ++ ++ /* Convert tgtcmd to action/token tuple. */ ++ if (_BF (tgtcmd, 6, 5) == 0x0) ++ { ++ switch (_BF (tgtcmd, 4, 2)) ++ { ++ case 0: ++ cpp_target = NFP_3200_CPPTGT_CAP; ++ dinfo->fprintf_func (dinfo->stream, "cap["); ++ break; ++ case 1: ++ cpp_target = NFP_3200_CPPTGT_MSF0; ++ dinfo->fprintf_func (dinfo->stream, "msf0["); ++ break; ++ case 2: ++ cpp_target = NFP_3200_CPPTGT_MSF1; ++ dinfo->fprintf_func (dinfo->stream, "msf1["); ++ break; ++ case 3: ++ cpp_target = NFP_3200_CPPTGT_PCIE; ++ dinfo->fprintf_func (dinfo->stream, "pcie["); ++ break; ++ case 4: ++ cpp_target = NFP_3200_CPPTGT_HASH; ++ break; ++ case 5: ++ cpp_target = NFP_3200_CPPTGT_CRYPTO; ++ dinfo->fprintf_func (dinfo->stream, "crypto["); ++ break; ++ case 6: ++ cpp_target = NFP_3200_CPPTGT_ARM; ++ dinfo->fprintf_func (dinfo->stream, "arm["); ++ break; ++ case 7: ++ cpp_target = NFP_3200_CPPTGT_CT; ++ dinfo->fprintf_func (dinfo->stream, "ct["); ++ break; ++ } ++ cpp_action = _BF (tgtcmd, 1, 0); ++ } ++ else ++ { ++ switch (_BF (tgtcmd, 6, 4)) ++ { ++ case 2: ++ cpp_target = NFP_3200_CPPTGT_GS; ++ dinfo->fprintf_func (dinfo->stream, "scratch["); ++ break; ++ case 3: ++ cpp_target = NFP_3200_CPPTGT_QDR; /* A.k.a. SRAM. */ ++ dinfo->fprintf_func (dinfo->stream, "sram["); ++ break; ++ case 4: ++ case 5: ++ cpp_target = NFP_3200_CPPTGT_MU; ++ dinfo->fprintf_func (dinfo->stream, "mem["); ++ break; ++ case 6: ++ case 7: ++ cpp_target = NFP_3200_CPPTGT_CLS; ++ dinfo->fprintf_func (dinfo->stream, "cls["); ++ break; ++ } ++ cpp_action = _BF (tgtcmd, 3, 0); ++ } ++ ++ if (cpp_target < 0) ++ { ++ dinfo->fprintf_func (dinfo->stream, _("[]"), ++ cpp_target, cpp_action, token); ++ return _NFP_ERR_CONT; ++ } ++ ++ mnemonic = nfp_me_find_mnemonic (cpp_target, cpp_action, token, cpp_len, ++ nfp_me27_mnemonics, ++ ARRAY_SIZE (nfp_me27_mnemonics)); ++ ++ if (!mnemonic) ++ { ++ dinfo->fprintf_func (dinfo->stream, _("[]"), ++ cpp_target, cpp_action, token); ++ return _NFP_ERR_CONT; ++ } ++ ++ if (cpp_target == NFP_3200_CPPTGT_HASH) ++ { ++ dinfo->fprintf_func (dinfo->stream, "%s[$xfer_%d, %d", ++ mnemonic, xfer, cpp_len); ++ goto print_opt_toks; ++ } ++ ++ dinfo->fprintf_func (dinfo->stream, "%s, ", mnemonic); ++ ++ if (visswap) ++ { ++ unsigned int tmp = srcA; ++ srcA = srcB; ++ srcB = tmp; ++ } ++ ++ switch (mode) ++ { ++ case 0: /* (A << 8) + B. */ ++ case 1: /* (B << 8) + A. */ ++ dinfo->fprintf_func (dinfo->stream, "$xfer_%d, ", xfer); ++ err = err ++ || !nfp_me_print_opnd8 (srcA, 'A' + visswap, num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", <<8, "); ++ err = err ++ || !nfp_me_print_opnd8 (srcB, 'B' - visswap, num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", %d", (cpp_len + 1)); ++ break; ++ case 2: /* Accelerated 3rd party (A[ << 8]) + B. */ ++ case 3: /* Accelerated 3rd party (B[ << 8]) + A. */ ++ dinfo->fprintf_func (dinfo->stream, "0x%x, ", (indref << 6) | xfer); ++ err = err ++ || !nfp_me_print_opnd8 (srcA, 'A' + visswap, num_ctx, 0, 0, dinfo); ++ if (third_party_32bit) ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ else ++ dinfo->fprintf_func (dinfo->stream, ", <<8, "); ++ err = err ++ || !nfp_me_print_opnd8 (srcB, 'B' - visswap, num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", %d", (cpp_len + 1)); ++ break; ++ case 4: /* A + B. */ ++ dinfo->fprintf_func (dinfo->stream, "$xfer_%d, ", xfer); ++ err = err || !nfp_me_print_opnd8 (srcA, 'A', num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ err = err || !nfp_me_print_opnd8 (srcB, 'B', num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", %d", (cpp_len + 1)); ++ break; ++ case 5: /* Immediate address. */ ++ dinfo->fprintf_func (dinfo->stream, "$xfer_%d, 0x%x, %d", xfer, valBA, ++ (cpp_len + 1)); ++ break; ++ case 6: /* Immediate address and data. */ ++ dinfo->fprintf_func (dinfo->stream, "0x%x, 0x%x", valBA, imm); ++ break; ++ case 7: /* Immediate data. */ ++ dinfo->fprintf_func (dinfo->stream, "0x%x, --, %d", ++ ((xfer << 16) | valBA), (cpp_len + 1)); ++ break; ++ } ++ ++ print_opt_toks: ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ ++ if (indref && (mode != 2) && (mode != 3)) ++ dinfo->fprintf_func (dinfo->stream, ", indirect_ref"); ++ ++ if (ctxswap_defer != 3) ++ { ++ dinfo->fprintf_func (dinfo->stream, ", ctx_swap["); ++ if (sig) ++ dinfo->fprintf_func (dinfo->stream, "sig%d]", sig); ++ else ++ dinfo->fprintf_func (dinfo->stream, "--]"); ++ ++ if (ctxswap_defer != 0) ++ dinfo->fprintf_func (dinfo->stream, ", defer[%d]", ctxswap_defer); ++ } ++ else if (sig) ++ dinfo->fprintf_func (dinfo->stream, ", sig_done[sig%d]", sig); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me27_print_alu_shf (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_alu_shf (instr, 0, 0, 0, 0, num_ctx, dinfo); ++} ++ ++static int ++nfp_me27_print_alu (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_alu_shf (instr, 0, 0, 0, 0, num_ctx, dinfo); ++} ++ ++static int ++nfp_me27_print_immed (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_immed (instr, 0, 0, 0, num_ctx, dinfo); ++} ++ ++static int ++nfp_me27_print_ld_field (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_ld_field (instr, 0, 0, 0, 0, num_ctx, dinfo); ++} ++ ++static int ++nfp_me27_print_ctx_arb (uint64_t instr, struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_ctx_arb (instr, dinfo); ++} ++ ++static int ++nfp_me27_print_local_csr (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_local_csr (instr, 0, num_ctx, dinfo); ++} ++ ++static int ++nfp_me27_print_branch (uint64_t instr, struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_branch (instr, nfp_me27_br_inpstates, dinfo); ++} ++ ++static int ++nfp_me27_print_br_byte (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_br_byte (instr, 0, num_ctx, dinfo); ++} ++ ++static int ++nfp_me27_print_br_bit (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_br_bit (instr, 0, num_ctx, dinfo); ++} ++ ++static int ++nfp_me27_print_br_alu (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_br_alu (instr, 0, num_ctx, dinfo); ++} ++ ++static int ++nfp_me27_print_mult (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_mult (instr, 0, 0, 0, 0, num_ctx, dinfo); ++} ++ ++/*NFP-6xxx/4xxx (ME Version 2.8). */ ++ ++static int ++nfp_me28_print_cmd (uint64_t instr, int third_party_32bit, ++ int num_ctx, struct disassemble_info *dinfo) ++{ ++ unsigned int srcA = _BF (instr, 7, 0); ++ unsigned int ctxswap_defer = _BF (instr, 9, 8); ++ unsigned int srcB = _BF (instr, 17, 10); ++ unsigned int token = _BF (instr, 19, 18); ++ unsigned int xfer = _BFS (instr, 40, 40, 5) | _BF (instr, 24, 20); ++ unsigned int cpp_len = _BF (instr, 27, 25); ++ unsigned int sig = _BF (instr, 31, 28); ++ unsigned int tgtcmd = _BF (instr, 38, 32); ++ unsigned int indref = _BTST (instr, 41); ++ unsigned int mode = _BF (instr, 44, 42); ++ ++ bfd_boolean err = FALSE; ++ int cpp_target = -1; ++ int cpp_action = -1; ++ const char *mnemonic = NULL; ++ unsigned int imm; ++ unsigned int valBA; ++ int visswap = ((mode == 1) || (mode == 3)); ++ ++ imm = (sig << 10) | (cpp_len << 7) | ((xfer & 0x1f) << 2) | token; ++ valBA = (srcB << 8) | srcA; ++ ++ if (mode == 6) ++ { ++ token = 0; ++ sig = 0; ++ xfer = 0; ++ } ++ ++ /* Convert tgtcmd to action/token tuple. */ ++ if (_BF (tgtcmd, 6, 5) == 0x0) ++ { ++ switch (_BF (tgtcmd, 4, 2)) ++ { ++ case 0: ++ cpp_target = NFP_6000_CPPTGT_ILA; ++ dinfo->fprintf_func (dinfo->stream, "ila["); ++ break; ++ case 1: ++ cpp_target = NFP_6000_CPPTGT_NBI; ++ dinfo->fprintf_func (dinfo->stream, "nbi["); ++ break; ++ case 3: ++ cpp_target = NFP_6000_CPPTGT_PCIE; ++ dinfo->fprintf_func (dinfo->stream, "pcie["); ++ break; ++ case 5: ++ cpp_target = NFP_6000_CPPTGT_CRYPTO; ++ dinfo->fprintf_func (dinfo->stream, "crypto["); ++ break; ++ case 6: ++ cpp_target = NFP_6000_CPPTGT_ARM; ++ dinfo->fprintf_func (dinfo->stream, "arm["); ++ break; ++ case 7: ++ cpp_target = NFP_6000_CPPTGT_CTXPB; ++ dinfo->fprintf_func (dinfo->stream, "ct["); ++ break; ++ } ++ cpp_action = _BF (tgtcmd, 1, 0); ++ } ++ else ++ { ++ /* One bit overlap between "t" and "a" fields, for sram it's "t" and ++ for mem/cls it's "a". */ ++ cpp_action = _BF (tgtcmd, 4, 0); ++ switch (_BF (tgtcmd, 6, 4)) ++ { ++ case 3: ++ cpp_target = NFP_6000_CPPTGT_VQDR; ++ cpp_action = _BF (tgtcmd, 3, 0); ++ dinfo->fprintf_func (dinfo->stream, "sram["); ++ break; ++ case 4: ++ case 5: ++ cpp_target = NFP_6000_CPPTGT_MU; ++ dinfo->fprintf_func (dinfo->stream, "mem["); ++ break; ++ case 6: ++ case 7: ++ cpp_target = NFP_6000_CPPTGT_CLS; ++ dinfo->fprintf_func (dinfo->stream, "cls["); ++ break; ++ } ++ } ++ ++ if (cpp_target < 0) ++ { ++ dinfo->fprintf_func (dinfo->stream, _("[]"), ++ cpp_target, cpp_action, token); ++ return _NFP_ERR_CONT; ++ } ++ ++ mnemonic = nfp_me_find_mnemonic (cpp_target, cpp_action, token, cpp_len, ++ nfp_me28_mnemonics, ++ ARRAY_SIZE (nfp_me28_mnemonics)); ++ ++ if (!mnemonic) ++ { ++ dinfo->fprintf_func (dinfo->stream, _("[]"), ++ cpp_target, cpp_action, token); ++ return _NFP_ERR_CONT; ++ } ++ ++ dinfo->fprintf_func (dinfo->stream, "%s, ", mnemonic); ++ ++ if (visswap) ++ { ++ unsigned int tmp = srcA; ++ srcA = srcB; ++ srcB = tmp; ++ } ++ ++ switch (mode) ++ { ++ case 0: /* (A << 8) + B. */ ++ case 1: /* (B << 8) + A. */ ++ dinfo->fprintf_func (dinfo->stream, "$xfer_%d, ", xfer); ++ err = err ++ || !nfp_me_print_opnd8 (srcA, 'A' + visswap, num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", <<8, "); ++ err = err ++ || !nfp_me_print_opnd8 (srcB, 'B' - visswap, num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", %d", (cpp_len + 1)); ++ break; ++ case 2: /* Accelerated 3rd party (A[ << 8]) + B. */ ++ case 3: /* Accelerated 3rd party (B[ << 8]) + A. */ ++ dinfo->fprintf_func (dinfo->stream, "0x%x, ", (indref << 6) | xfer); ++ err = err ++ || !nfp_me_print_opnd8 (srcA, 'A' + visswap, num_ctx, 0, 0, dinfo); ++ if (third_party_32bit) ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ else ++ dinfo->fprintf_func (dinfo->stream, ", <<8, "); ++ err = err ++ || !nfp_me_print_opnd8 (srcB, 'B' - visswap, num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", %d", (cpp_len + 1)); ++ break; ++ case 4: /* A + B. */ ++ dinfo->fprintf_func (dinfo->stream, "$xfer_%d, ", xfer); ++ err = err || !nfp_me_print_opnd8 (srcA, 'A', num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", "); ++ err = err || !nfp_me_print_opnd8 (srcB, 'B', num_ctx, 0, 0, dinfo); ++ dinfo->fprintf_func (dinfo->stream, ", %d", (cpp_len + 1)); ++ break; ++ case 5: /* Immediate address. */ ++ dinfo->fprintf_func (dinfo->stream, "$xfer_%d, 0x%x, %d", xfer, valBA, ++ (cpp_len + 1)); ++ break; ++ case 6: /* Immediate address and data. */ ++ dinfo->fprintf_func (dinfo->stream, "0x%x, 0x%x", valBA, imm); ++ break; ++ case 7: /* Immediate data. */ ++ dinfo->fprintf_func (dinfo->stream, "0x%x, --, %d", ++ ((xfer << 16) | valBA), (cpp_len + 1)); ++ break; ++ } ++ ++ dinfo->fprintf_func (dinfo->stream, "]"); ++ ++ if (indref && (mode != 2) && (mode != 3)) ++ dinfo->fprintf_func (dinfo->stream, ", indirect_ref"); ++ ++ if (ctxswap_defer != 3) ++ { ++ dinfo->fprintf_func (dinfo->stream, ", ctx_swap["); ++ if (sig) ++ dinfo->fprintf_func (dinfo->stream, "sig%d]", sig); ++ else ++ dinfo->fprintf_func (dinfo->stream, "--]"); ++ ++ if (ctxswap_defer != 0) ++ dinfo->fprintf_func (dinfo->stream, ", defer[%d]", ctxswap_defer); ++ } ++ else if (sig) ++ dinfo->fprintf_func (dinfo->stream, ", sig_done[sig%d]", sig); ++ ++ if (err) ++ return _NFP_ERR_CONT; ++ return 0; ++} ++ ++static int ++nfp_me28_print_alu_shf (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int gpr_wrboth = _BTST (instr, 41); ++ unsigned int src_lmext = _BTST (instr, 42); ++ unsigned int dst_lmext = _BTST (instr, 43); ++ unsigned int pred_cc = _BTST (instr, 44); ++ ++ return nfp_me27_28_print_alu_shf (instr, pred_cc, dst_lmext, ++ src_lmext, gpr_wrboth, num_ctx, dinfo); ++} ++ ++static int ++nfp_me28_print_alu (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int gpr_wrboth = _BTST (instr, 41); ++ unsigned int src_lmext = _BTST (instr, 42); ++ unsigned int dst_lmext = _BTST (instr, 43); ++ unsigned int pred_cc = _BTST (instr, 44); ++ ++ return nfp_me27_28_print_alu (instr, pred_cc, dst_lmext, src_lmext, ++ gpr_wrboth, num_ctx, dinfo); ++} ++ ++static int ++nfp_me28_print_immed (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int gpr_wrboth = _BTST (instr, 41); ++ unsigned int dst_lmext = _BTST (instr, 43); ++ unsigned int pred_cc = _BTST (instr, 44); ++ ++ return nfp_me27_28_print_immed (instr, pred_cc, dst_lmext, gpr_wrboth, ++ num_ctx, dinfo); ++} ++ ++static int ++nfp_me28_print_ld_field (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int gpr_wrboth = _BTST (instr, 41); ++ unsigned int src_lmext = _BTST (instr, 42); ++ unsigned int dst_lmext = _BTST (instr, 43); ++ unsigned int pred_cc = _BTST (instr, 44); ++ ++ return nfp_me27_28_print_ld_field (instr, pred_cc, dst_lmext, ++ src_lmext, gpr_wrboth, num_ctx, dinfo); ++} ++ ++static int ++nfp_me28_print_ctx_arb (uint64_t instr, struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_ctx_arb (instr, dinfo); ++} ++ ++static int ++nfp_me28_print_local_csr (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int src_lmext = _BTST (instr, 42); ++ ++ return nfp_me27_28_print_local_csr (instr, src_lmext, num_ctx, dinfo); ++} ++ ++static int ++nfp_me28_print_branch (uint64_t instr, struct disassemble_info *dinfo) ++{ ++ return nfp_me27_28_print_branch (instr, nfp_me28_br_inpstates, dinfo); ++} ++ ++static int ++nfp_me28_print_br_byte (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int src_lmext = _BTST (instr, 42); ++ return nfp_me27_28_print_br_byte (instr, src_lmext, num_ctx, dinfo); ++} ++ ++static int ++nfp_me28_print_br_bit (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int src_lmext = _BTST (instr, 42); ++ return nfp_me27_28_print_br_bit (instr, src_lmext, num_ctx, dinfo); ++} ++ ++static int ++nfp_me28_print_br_alu (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int src_lmext = _BTST (instr, 42); ++ return nfp_me27_28_print_br_alu (instr, src_lmext, num_ctx, dinfo); ++} ++ ++static int ++nfp_me28_print_mult (uint64_t instr, int num_ctx, ++ struct disassemble_info *dinfo) ++{ ++ unsigned int gpr_wrboth = _BTST (instr, 41); ++ unsigned int src_lmext = _BTST (instr, 42); ++ unsigned int dst_lmext = _BTST (instr, 43); ++ unsigned int pred_cc = _BTST (instr, 44); ++ ++ return nfp_me27_28_print_mult (instr, pred_cc, dst_lmext, src_lmext, ++ gpr_wrboth, num_ctx, dinfo); ++} ++ ++static bfd_boolean ++init_nfp3200_priv (nfp_priv_data * priv, struct disassemble_info *dinfo) ++{ ++ Elf_Internal_Shdr *sec = NULL; ++ Elf_Nfp_MeConfig mecfg_ent; ++ unsigned char buffer[sizeof (Elf_Nfp_MeConfig)]; ++ file_ptr roff = 0; ++ unsigned int sec_cnt = 0; ++ unsigned int sec_idx; ++ size_t menum_linear = 0; ++ ++ if (!dinfo->section) ++ /* No section info, will use default values. */ ++ return TRUE; ++ ++ sec_cnt = elf_numsections (dinfo->section->owner); ++ ++ /* Find the MECONFIG section. It's index is also in e_flags, but it has ++ a unique SHT and we'll use that. */ ++ for (sec_idx = 0; sec_idx < sec_cnt; sec_idx++) ++ { ++ sec = elf_elfsections (dinfo->section->owner)[sec_idx]; ++ ++ if (sec->sh_type == SHT_NFP_MECONFIG) ++ break; ++ } ++ ++ if (sec_idx == sec_cnt) ++ { ++ dinfo->fprintf_func (dinfo->stream, _("File has no ME-Config section.")); ++ return FALSE; ++ } ++ ++ for (roff = 0; (bfd_size_type) roff < sec->sh_size; ++ roff += sec->sh_entsize, menum_linear++) ++ { ++ nfp_priv_mecfg *mecfg; ++ int isl = menum_linear >> 3; ++ int menum = menum_linear & 7; ++ ++ if (menum_linear >= 40) ++ { ++ dinfo->fprintf_func (dinfo->stream, ++ _("File has invalid ME-Config section.")); ++ return FALSE; ++ } ++ ++ mecfg = &priv->mecfgs[isl][menum][1]; ++ ++ if (!bfd_get_section_contents (dinfo->section->owner, sec->bfd_section, ++ buffer, roff, sizeof (buffer))) ++ return FALSE; ++ ++ mecfg_ent.ctx_enables = bfd_getl32 (buffer + offsetof (Elf_Nfp_MeConfig, ++ ctx_enables)); ++ mecfg_ent.misc_control = bfd_getl32 (buffer ++ + offsetof (Elf_Nfp_MeConfig, misc_control)); ++ ++ mecfg->ctx4_mode = _BTST (mecfg_ent.ctx_enables, 31); ++ mecfg->addr_3rdparty32 = _BTST (mecfg_ent.misc_control, 4); ++ mecfg->scs_cnt = _BTST (mecfg_ent.misc_control, 2); ++ } ++ ++ return TRUE; ++} ++ ++static bfd_boolean ++init_nfp6000_mecsr_sec (nfp_priv_data * priv, Elf_Internal_Shdr * sec, ++ int is_for_text, struct disassemble_info *dinfo) ++{ ++ Elf_Nfp_InitRegEntry ireg; ++ unsigned char buffer[sizeof (Elf_Nfp_InitRegEntry)]; ++ file_ptr ireg_off = 0; ++ size_t isl, menum; ++ ++ if (sec->sh_entsize != sizeof (ireg)) ++ return FALSE; ++ ++ isl = SHI_NFP_IREG_ISLAND (sec->sh_info); ++ ++ /* For these sections we know that the address will only be 32 bits ++ so we only need cpp_offset_lo. ++ Address is encoded as follows: ++ <31:30> 0 ++ <29:24> island (already got this from sh_info) ++ <23:17> 0 ++ <16:16> XferCsrRegSel (1 for these sections) ++ <15:14> 0 ++ <13:10> DataMasterID (MEnum = this - 4) ++ <9:2> register (index) ++ <1:0> 0b0 (register byte address if appened to the previous field). */ ++ for (ireg_off = 0; (bfd_size_type) ireg_off < sec->sh_size; ++ ireg_off += sec->sh_entsize) ++ { ++ uint32_t csr_off; ++ nfp_priv_mecfg *mecfg; ++ ++ if (!bfd_get_section_contents (dinfo->section->owner, sec->bfd_section, ++ buffer, ireg_off, sizeof (buffer))) ++ return FALSE; ++ ++ ireg.cpp_offset_lo = bfd_getl32 (buffer ++ + offsetof (Elf_Nfp_InitRegEntry, cpp_offset_lo)); ++ ireg.mask = bfd_getl32 (buffer + offsetof (Elf_Nfp_InitRegEntry, mask)); ++ ireg.val = bfd_getl32 (buffer + offsetof (Elf_Nfp_InitRegEntry, val)); ++ ireg.w0 = bfd_getl32 (buffer + offsetof (Elf_Nfp_InitRegEntry, w0)); ++ ++ if (NFP_IREG_ENTRY_WO_NLW (ireg.w0)) ++ continue; ++ ++ /* Only consider entries that are permanent for runtime. */ ++ if ((NFP_IREG_ENTRY_WO_VTP (ireg.w0) != NFP_IREG_VTP_CONST) ++ && (NFP_IREG_ENTRY_WO_VTP (ireg.w0) != NFP_IREG_VTP_FORCE)) ++ continue; ++ ++ menum = _BF (ireg.cpp_offset_lo, 13, 10) - 4; ++ csr_off = _BF (ireg.cpp_offset_lo, 9, 0); ++ ++ mecfg = &priv->mecfgs[isl][menum][is_for_text]; ++ switch (csr_off) ++ { ++ case _NFP_ME27_28_CSR_CTX_ENABLES: ++ mecfg->ctx4_mode = _BTST (ireg.val, 31); ++ break; ++ case _NFP_ME27_28_CSR_MISC_CONTROL: ++ mecfg->addr_3rdparty32 = _BTST (ireg.val, 4); ++ mecfg->scs_cnt = _BTST (ireg.val, 2); ++ break; ++ default: ++ break; ++ } ++ } ++ ++ return TRUE; ++} ++ ++static bfd_boolean ++init_nfp6000_priv (nfp_priv_data * priv, struct disassemble_info *dinfo) ++{ ++ int mecfg_orders[64][2]; ++ size_t isl; ++ unsigned int sec_cnt = 0; ++ unsigned int sec_idx; ++ int is_for_text; ++ ++ memset (mecfg_orders, -1, sizeof (mecfg_orders)); ++ ++ if (!dinfo->section) ++ /* No section info, will use default values. */ ++ return TRUE; ++ ++ sec_cnt = elf_numsections (dinfo->section->owner); ++ ++ /* Go through all MECSR init sections to find ME configs. */ ++ for (sec_idx = 0; sec_idx < sec_cnt; sec_idx++) ++ { ++ Elf_Internal_Shdr *sec; ++ int sec_order; ++ ++ sec = elf_elfsections (dinfo->section->owner)[sec_idx]; ++ sec_order = (int) SHI_NFP_IREG_ORDER (sec->sh_info); ++ ++ is_for_text = (sec->sh_flags & (SHF_NFP_INIT | SHF_NFP_INIT2)) == 0; ++ ++ /* If we have an init2 section, that is the one that applies to the ++ ME when executing init code. So we make it's order higher than ++ any plain init section. */ ++ if (sec->sh_flags & SHF_NFP_INIT2) ++ sec_order += SHI_NFP_IREG_ORDER (~0U) + 1; ++ ++ if (sec->sh_type != SHT_NFP_INITREG) ++ continue; ++ if (!SHI_NFP_6000_IS_IREG_MECSR (sec->sh_info)) ++ continue; ++ ++ isl = SHI_NFP_IREG_ISLAND (sec->sh_info); ++ if ((sec_order < mecfg_orders[isl][is_for_text])) ++ /* Lower order or transient, skip it. */ ++ continue; ++ ++ mecfg_orders[isl][is_for_text] = sec_order; ++ ++ if (!init_nfp6000_mecsr_sec (priv, sec, is_for_text, dinfo)) ++ { ++ dinfo->fprintf_func (dinfo->stream, ++ _("Error processing section %u "), sec_idx); ++ return FALSE; ++ } ++ } ++ ++ return TRUE; ++} ++ ++static int ++parse_disassembler_options (nfp_opts * opts, struct disassemble_info *dinfo) ++{ ++ const char *option; ++ ++ if (dinfo->disassembler_options == NULL) ++ return 0; ++ ++ FOR_EACH_DISASSEMBLER_OPTION (option, dinfo->disassembler_options) ++ { ++ if (disassembler_options_cmp (option, "no-pc") == 0) ++ opts->show_pc = 0; ++ else if (disassembler_options_cmp (option, "ctx4") == 0) ++ { ++ if (!opts->ctx_mode) ++ opts->ctx_mode = 4; ++ } ++ else if (disassembler_options_cmp (option, "ctx8") == 0) ++ opts->ctx_mode = 8; ++ else ++ { ++ dinfo->fprintf_func (dinfo->stream, _("Invalid NFP option: %s"), option); ++ return _NFP_ERR_STOP; ++ } ++ } ++ ++ return 0; ++} ++ ++/* Called on first disassembly attempt so that dinfo->section is valid ++ so that we can get the bfd owner to find ME configs. */ ++ ++static nfp_priv_data * ++init_nfp_priv (struct disassemble_info *dinfo) ++{ ++ nfp_priv_data *priv; ++ int ret = FALSE; ++ ++ if (dinfo->private_data) ++ return (nfp_priv_data *) dinfo->private_data; ++ ++#if 0 /* Right now only section-related info is kept in priv. ++ So don't even calloc it if we don't need it. */ ++ if (!dinfo->section) ++ return NULL; ++#endif ++ ++ /* Alloc with no free, seems to be either this or a static global variable ++ and this at least keeps a large struct unallocated until really needed. */ ++ priv = calloc (1, sizeof (*priv)); ++ if (!priv) ++ return NULL; ++ ++ switch (dinfo->mach) ++ { ++ case E_NFP_MACH_3200: ++ ret = init_nfp3200_priv (priv, dinfo); ++ break; ++ case E_NFP_MACH_6000: ++ ret = init_nfp6000_priv (priv, dinfo); ++ break; ++ } ++ ++ if (!ret) ++ { ++ free (priv); ++ return NULL; ++ } ++ ++ dinfo->private_data = priv; ++ return priv; ++} ++ ++static int ++_print_instrs (bfd_vma addr, struct disassemble_info *dinfo, nfp_opts * opts) ++{ ++ nfp_priv_data *priv = init_nfp_priv (dinfo); ++ bfd_byte buffer[8]; ++ int err; ++ uint64_t instr = 0; ++ size_t island, menum; ++ int num_ctx, scs_cnt, addr_3rdparty32, pc, tmpi, tmpj; ++ int is_text = 1; ++ ++ err = dinfo->read_memory_func (addr, buffer, 8, dinfo); ++ if (err) ++ return _NFP_ERR_STOP; ++ ++ if (!dinfo->section) ++ { ++ num_ctx = 8; ++ scs_cnt = 0; ++ addr_3rdparty32 = 0; ++ } ++ else ++ { ++ unsigned int sh_info = 0; ++ nfp_priv_mecfg *mecfg; ++ ++ /* We have a section, presumably all ELF sections. Try to find ++ proper ME configs to produce better disassembly. */ ++ if (!priv) ++ return _NFP_ERR_STOP; /* Sanity check */ ++ ++ is_text = (elf_section_flags (dinfo->section) ++ & (SHF_NFP_INIT | SHF_NFP_INIT2)) == 0; ++ ++ sh_info = elf_section_info (dinfo->section); ++ ++ switch (dinfo->mach) ++ { ++ case E_NFP_MACH_3200: ++ island = SHI_NFP_3200_ISLAND (sh_info); ++ menum = SHI_NFP_3200_MENUM (sh_info); ++ break; ++ default: ++ island = SHI_NFP_ISLAND (sh_info); ++ menum = SHI_NFP_MENUM (sh_info); ++ break; ++ } ++ ++ mecfg = &priv->mecfgs[island][menum][is_text]; ++ num_ctx = (mecfg->ctx4_mode) ? 4 : 8; ++ addr_3rdparty32 = mecfg->addr_3rdparty32; ++ scs_cnt = mecfg->scs_cnt; ++ } ++ ++ if (opts->ctx_mode) ++ num_ctx = opts->ctx_mode; ++ ++ dinfo->bytes_per_line = 8; ++ dinfo->bytes_per_chunk = 8; ++ ++ instr = bfd_getl64 (buffer); ++ ++ if (opts->show_pc) ++ { ++ pc = (int) (addr >> 3); ++ ++ /* Guess max PC for formatting */ ++ tmpj = (int) (dinfo->buffer_length >> 3); ++ if (scs_cnt == 1) ++ { ++ pc *= 2; ++ tmpj *= 2; ++ if (! !(menum & 1)) ++ { ++ pc++; ++ tmpj++; ++ } ++ } ++ ++ for (tmpi = 1; tmpj > 9; tmpj /= 10) ++ tmpi++; ++ ++ tmpj = pc; ++ for (; tmpj > 9; tmpj /= 10) ++ tmpi--; ++ ++ dinfo->fprintf_func (dinfo->stream, "%*c%d ", tmpi, '.', pc); ++ } ++ ++ switch (dinfo->mach) ++ { ++ case E_NFP_MACH_3200: ++ if (NFP_ME27_INSTR_IS_CMD (instr)) ++ err = nfp_me27_print_cmd (instr, addr_3rdparty32, num_ctx, dinfo); ++ else if (NFP_ME27_INSTR_IS_ALU_SHF (instr)) ++ err = nfp_me27_print_alu_shf (instr, num_ctx, dinfo); ++ else if (NFP_ME27_INSTR_IS_ALU (instr)) ++ err = nfp_me27_print_alu (instr, num_ctx, dinfo); ++ else if (NFP_ME27_INSTR_IS_IMMED (instr)) ++ err = nfp_me27_print_immed (instr, num_ctx, dinfo); ++ else if (NFP_ME27_INSTR_IS_LD_FIELD (instr)) ++ err = nfp_me27_print_ld_field (instr, num_ctx, dinfo); ++ else if (NFP_ME27_INSTR_IS_CTX_ARB (instr)) ++ err = nfp_me27_print_ctx_arb (instr, dinfo); ++ else if (NFP_ME27_INSTR_IS_LOCAL_CSR (instr)) ++ err = nfp_me27_print_local_csr (instr, num_ctx, dinfo); ++ else if (NFP_ME27_INSTR_IS_BRANCH (instr)) ++ err = nfp_me27_print_branch (instr, dinfo); ++ else if (NFP_ME27_INSTR_IS_BR_BYTE (instr)) ++ err = nfp_me27_print_br_byte (instr, num_ctx, dinfo); ++ else if (NFP_ME27_INSTR_IS_BR_BIT (instr)) ++ err = nfp_me27_print_br_bit (instr, num_ctx, dinfo); ++ else if (NFP_ME27_INSTR_IS_BR_ALU (instr)) ++ err = nfp_me27_print_br_alu (instr, num_ctx, dinfo); ++ else if (NFP_ME27_INSTR_IS_MULT (instr)) ++ err = nfp_me27_print_mult (instr, num_ctx, dinfo); ++ else ++ err = nfp_me_print_invalid (instr, dinfo); ++ break; ++ ++ case E_NFP_MACH_6000: ++ if (NFP_ME28_INSTR_IS_CMD (instr)) ++ err = nfp_me28_print_cmd (instr, addr_3rdparty32, num_ctx, dinfo); ++ else if (NFP_ME28_INSTR_IS_ALU_SHF (instr)) ++ err = nfp_me28_print_alu_shf (instr, num_ctx, dinfo); ++ else if (NFP_ME28_INSTR_IS_ALU (instr)) ++ err = nfp_me28_print_alu (instr, num_ctx, dinfo); ++ else if (NFP_ME28_INSTR_IS_IMMED (instr)) ++ err = nfp_me28_print_immed (instr, num_ctx, dinfo); ++ else if (NFP_ME28_INSTR_IS_LD_FIELD (instr)) ++ err = nfp_me28_print_ld_field (instr, num_ctx, dinfo); ++ else if (NFP_ME28_INSTR_IS_CTX_ARB (instr)) ++ err = nfp_me28_print_ctx_arb (instr, dinfo); ++ else if (NFP_ME28_INSTR_IS_LOCAL_CSR (instr)) ++ err = nfp_me28_print_local_csr (instr, num_ctx, dinfo); ++ else if (NFP_ME28_INSTR_IS_BRANCH (instr)) ++ err = nfp_me28_print_branch (instr, dinfo); ++ else if (NFP_ME28_INSTR_IS_BR_BYTE (instr)) ++ err = nfp_me28_print_br_byte (instr, num_ctx, dinfo); ++ else if (NFP_ME28_INSTR_IS_BR_BIT (instr)) ++ err = nfp_me28_print_br_bit (instr, num_ctx, dinfo); ++ else if (NFP_ME28_INSTR_IS_BR_ALU (instr)) ++ err = nfp_me28_print_br_alu (instr, num_ctx, dinfo); ++ else if (NFP_ME28_INSTR_IS_MULT (instr)) ++ err = nfp_me28_print_mult (instr, num_ctx, dinfo); ++ else ++ err = nfp_me_print_invalid (instr, dinfo); ++ break; ++ } ++ ++ if (err < 0) ++ return err; ++ return 8; ++} ++ ++int ++print_insn_nfp (bfd_vma addr, struct disassemble_info *dinfo) ++{ ++ nfp_opts opts; ++ int err; ++ ++ opts.show_pc = 1; ++ opts.ctx_mode = 0; ++ err = parse_disassembler_options (&opts, dinfo); ++ if (err < 0) ++ goto end; ++ ++ err = _print_instrs (addr, dinfo, &opts); ++ ++end: ++ if (err != 8) ++ dinfo->fprintf_func (dinfo->stream, "\t # ERROR"); ++ if (err == _NFP_ERR_CONT) ++ return 8; ++ return err; ++} ++ ++void ++print_nfp_disassembler_options (FILE * stream) ++{ ++ fprintf (stream, _("\n\ ++The following NFP specific disassembler options are supported for use\n\ ++with the -M switch (multiple options should be separated by commas):\n")); ++ ++ fprintf (stream, _("\n\ ++ no-pc Don't print program counter prefix.\n\ ++ ctx4 Force disassembly using 4-context mode.\n\ ++ ctx8 Force 8-context mode, takes precedence.")); ++ ++ fprintf (stream, _("\n")); ++} +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ /binutils/testsuite/binutils-all/nfp/test2_nfp6000.nffw 2018-04-30 11:21:22.978953995 +0100 +@@ -0,0 +1,11 @@ ++ELF`@@@@[ 40&H 4pP?pKp.shstrtab.note.nfp.note.build_info.text.i32.me0.regi.xpbm.regi1.xpbm.regt.mecsr.i32NFP NFP NFPLgZnfld 6.x-devel (build 3484) 0  0 0 0    ++`R ++`& ++`\ ++`v$ ++`Q( ++`A 0 ++`C8 ++`@ < ++`@ ++`  Us @ ?@ ?"@ ?2@ ?B@ ?R@ ?b@ ?r@ ?D H H "H 2H BH RH bH rH P P "P 2P BP RP bP rP `  +\ No newline at end of file +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ /binutils/testsuite/binutils-all/nfp/test1_nfp6000.nffw 2018-11-15 10:36:45.969182755 +0000 +@@ -0,0 +1,75 @@ ++ELF`@@@ ++y @4xd&h 4Hh !Bp" Mp# Yp#ip%.shstrtab.note.nfp.note.build_info.text.i32.me0.text.i33.me9.regi.xpbm.regi1.xpbm.regt.mecsr.i32.regt.mecsr.i33NFP NFPTNFP[Toolchain: nfld 6.x-devel (build 3781) ++Name: ++Version: 0.0.0 ++Build Number: 0 ++,@,, ,` ,0,1,@,,,H ,h ,%,@,( ),  `  `w`,@ < ++m@@@ 4  @ @ ``/ 0 ҁ @@ ڀ` ++/ (/($ $<ŋ $ $ @$$ ($ ! $($ $<$\$|h $ ++  ++) 0$1d1` ++ @AA /o @ o @2 Б "` @@@@  ++ @ @@@@ ++@@!  SpA pp  / 0 8@ ++/ 0 1@/ 0 A1@/ 0 a1@$/ 0 A1@ ++/ 0 E/ 0 E/ 0 E ++/ 0 8@/ 0 8@0 / 0 8@  w w@  !w@"w#w $w$w%w %w &wؠ'w@(w)w +w@*wؠ8` 8  w wЀ ,wР#$w!$w` $wЀ#$w   +,wЀ w wȠ w` ++ w BwȤ bw  w@ww wȀ wȠ6w 6wؠ  6w 6w7w 7w 0w 0w 0w0w@ ++ 4w@ 4Bw`4w؀ 4w  4w؀ ++4wؠ5w@5w` 2Bw`2w؀2wؠ3w@2w`    @@@  @  0 ` AACC ++`(`t`H`" ++ ( < ++B(<  CG @  < ,H  H@  H &@  H6      ` @@  @F  @` @`      & 6  `  ' v@ v v  v v@ v   ++ Vs  V"        `   0 0  w` ++P@P@ P@ @@PP! P P?@`  "#(@@r  HM8@Tؠ'`8@Tؠ'8@Tؠ'8@Tؠ@@ `` {Ā|  `  ` l ++l`        0L@ \  ++L L LL 0 0 C080 1  ++ d ++  0 0    0BP$0BP 0B$0B$ 0$0B 0'0%0B 0 C N @d ++ @f Bd`Bf 0@e, @`Pe<?Xstart == pnote->end) ++ { ++ duplicate_found = TRUE; ++ pnote->note.type = 0; ++ continue; ++ } ++ + /* Rule 2 - preserve function notes. */ + if (! is_open_note (pnote)) +- continue; ++ { ++ int iter; ++ ++ /* Check to see if there is an identical previous function note. ++ This can happen with overlays for example. */ ++ for (iter = 0, back = pnote -1; back >= pnotes; back --) ++ { ++ if (back->start == pnote->start ++ && back->end == pnote->end ++ && back->note.namesz == pnote->note.namesz ++ && memcmp (back->note.namedata, pnote->note.namedata, pnote->note.namesz) == 0) ++ { ++ duplicate_found = TRUE; ++ pnote->note.type = 0; ++ break; ++ } ++ ++ /* Don't scan too far back however. */ ++ if (iter ++ > 16) ++ break; ++ } ++ continue; ++ } + + note_type = pnote->note.namedata[attribute_type_byte]; + diff --git a/SOURCES/binutils-page-to-segment-assignment.patch b/SOURCES/binutils-page-to-segment-assignment.patch new file mode 100644 index 0000000..c622d7c --- /dev/null +++ b/SOURCES/binutils-page-to-segment-assignment.patch @@ -0,0 +1,77 @@ +diff --git a/bfd/elf.c b/bfd/elf.c +index c132098558..325bdd545a 100644 +--- a/bfd/elf.c ++++ b/bfd/elf.c +@@ -4727,33 +4727,35 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) + the previous section, then we need a new segment. */ + new_segment = TRUE; + } ++ else if ((abfd->flags & D_PAGED) != 0 ++ && (((last_hdr->lma + last_size - 1) & -maxpagesize) ++ == (hdr->lma & -maxpagesize))) ++ { ++ /* If we are demand paged then we can't map two disk ++ pages onto the same memory page. */ ++ new_segment = FALSE; ++ } + /* In the next test we have to be careful when last_hdr->lma is close + to the end of the address space. If the aligned address wraps + around to the start of the address space, then there are no more + pages left in memory and it is OK to assume that the current + section can be included in the current segment. */ +- else if ((BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) + maxpagesize +- > last_hdr->lma) +- && (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) + maxpagesize +- <= hdr->lma)) ++ else if ((BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) ++ + maxpagesize > last_hdr->lma) ++ && (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) ++ + maxpagesize <= hdr->lma)) + { + /* If putting this section in this segment would force us to + skip a page in the segment, then we need a new segment. */ + new_segment = TRUE; + } + else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0 +- && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0 +- && ((abfd->flags & D_PAGED) == 0 +- || (((last_hdr->lma + last_size - 1) & -maxpagesize) +- != (hdr->lma & -maxpagesize)))) ++ && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0) + { + /* We don't want to put a loaded section after a + nonloaded (ie. bss style) section in the same segment + as that will force the non-loaded section to be loaded. +- Consider .tbss sections as loaded for this purpose. +- However, like the writable/non-writable case below, +- if they are on the same page then they must be put +- in the same segment. */ ++ Consider .tbss sections as loaded for this purpose. */ + new_segment = TRUE; + } + else if ((abfd->flags & D_PAGED) == 0) +@@ -4769,21 +4771,11 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) + { + new_segment = TRUE; + } +- else if (! writable +- && (hdr->flags & SEC_READONLY) == 0 +- && ((info != NULL +- && info->relro_end > info->relro_start) +- || (((last_hdr->lma + last_size - 1) & -maxpagesize) +- != (hdr->lma & -maxpagesize)))) ++ else if (! writable ++ && (hdr->flags & SEC_READONLY) == 0) + { + /* We don't want to put a writable section in a read only +- segment, unless they are on the same page in memory +- anyhow and there is no RELRO segment. We already +- know that the last section does not bring us past the +- current section on the page, so the only case in which +- the new section is not on the same page as the previous +- section is when the previous section ends precisely on +- a page boundary. */ ++ segment. */ + new_segment = TRUE; + } + else diff --git a/SOURCES/binutils-readelf-other-sym-info.patch b/SOURCES/binutils-readelf-other-sym-info.patch new file mode 100644 index 0000000..fa1b2f2 --- /dev/null +++ b/SOURCES/binutils-readelf-other-sym-info.patch @@ -0,0 +1,66 @@ +diff -rup binutils.orig/binutils/readelf.c binutils-2.29/binutils/readelf.c +--- binutils.orig/binutils/readelf.c 2017-12-12 16:24:19.571221194 +0000 ++++ binutils-2.29/binutils/readelf.c 2017-12-12 16:27:26.997979803 +0000 +@@ -11018,12 +11018,14 @@ print_dynamic_symbol (bfd_vma si, unsign + 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 (" %3.3s ", get_symbol_index_type (filedata, psym->st_shndx)); +@@ -11031,6 +11033,15 @@ print_dynamic_symbol (bfd_vma si, unsign + print_symbol (25, GET_DYNAMIC_NAME (psym->st_name)); + else + printf (_(" "), psym->st_name); ++#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'); + } + +--- binutils.orig/binutils/readelf.c 2017-12-12 16:36:21.806561149 +0000 ++++ binutils-2.29.1/binutils/readelf.c 2017-12-12 16:38:17.763168514 +0000 +@@ -11548,11 +11548,13 @@ process_symbol_table (FILE * file) + 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)); + print_symbol (25, psym->st_name < strtab_size +@@ -11571,7 +11573,15 @@ process_symbol_table (FILE * file) + printf (sym_info == symbol_hidden ? "@%s" : "@@%s", + version_string); + } ++#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 diff --git a/SOURCES/binutils-remove-empty-ISA-properties.patch b/SOURCES/binutils-remove-empty-ISA-properties.patch new file mode 100644 index 0000000..bb459e0 --- /dev/null +++ b/SOURCES/binutils-remove-empty-ISA-properties.patch @@ -0,0 +1,314 @@ +diff -rup binutils.orig/bfd/elfxx-x86.c binutils-2.30/bfd/elfxx-x86.c +--- binutils.orig/bfd/elfxx-x86.c 2018-07-30 16:01:04.881710127 +0100 ++++ binutils-2.30/bfd/elfxx-x86.c 2018-07-30 16:01:28.809447800 +0100 +@@ -2320,13 +2320,34 @@ _bfd_x86_elf_merge_gnu_properties (struc + { + number = aprop->u.number; + aprop->u.number = number | bprop->u.number; +- updated = number != (unsigned int) aprop->u.number; ++ /* Remove the property if ISA bits are empty. */ ++ if (aprop->u.number == 0) ++ { ++ aprop->pr_kind = property_remove; ++ updated = TRUE; ++ } ++ else ++ updated = number != (unsigned int) aprop->u.number; + } + else + { +- /* Return TRUE if APROP is NULL to indicate that BPROP should +- be added to ABFD. */ +- updated = aprop == NULL; ++ /* Only one of APROP and BPROP can be NULL. */ ++ if (aprop != NULL) ++ { ++ if (aprop->u.number == 0) ++ { ++ /* Remove APROP if ISA bits are empty. */ ++ aprop->pr_kind = property_remove; ++ updated = TRUE; ++ } ++ } ++ else ++ { ++ /* Return TRUE if APROP is NULL and ISA bits of BPROP ++ aren't empty to indicate that BPROP should be added ++ to ABFD. */ ++ updated = bprop->u.number != 0; ++ } + } + break; + +diff -rup binutils.orig/ld/testsuite/ld-i386/i386.exp binutils-2.30/ld/testsuite/ld-i386/i386.exp +--- binutils.orig/ld/testsuite/ld-i386/i386.exp 2018-07-30 16:00:54.241826775 +0100 ++++ binutils-2.30/ld/testsuite/ld-i386/i386.exp 2018-07-30 16:02:58.911459984 +0100 +@@ -450,6 +450,8 @@ run_dump_test "pr22115-1b" + run_dump_test "pr22115-1c" + run_dump_test "pr22115-1d" + run_dump_test "pr22135" ++run_dump_test "pr23372a" ++run_dump_test "pr23372b" + + if { !([istarget "i?86-*-linux*"] + || [istarget "i?86-*-gnu*"] +diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp +--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2018-07-30 16:00:55.340814726 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp 2018-07-30 16:03:32.624090383 +0100 +@@ -379,6 +379,10 @@ run_dump_test "pr22115-1c-x32" + run_dump_test "pr22115-1d" + run_dump_test "pr22115-1d-x32" + run_dump_test "pr22135" ++run_dump_test "pr23372a" ++run_dump_test "pr23372a-x32" ++run_dump_test "pr23372b" ++run_dump_test "pr23372b-x32" + + if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} { + return +diff --git a/ld/testsuite/ld-i386/pr23372a.d b/ld/testsuite/ld-i386/pr23372a.d +new file mode 100644 +index 0000000000..b75523bdc3 +--- /dev/null ++++ b/ld/testsuite/ld-i386/pr23372a.d +@@ -0,0 +1,5 @@ ++#source: pr23372a.s ++#source: pr23372b.s ++#as: --32 ++#ld: -r -m elf_i386 ++#readelf: -n +diff --git a/ld/testsuite/ld-i386/pr23372a.s b/ld/testsuite/ld-i386/pr23372a.s +new file mode 100644 +index 0000000000..9849d620a1 +--- /dev/null ++++ b/ld/testsuite/ld-i386/pr23372a.s +@@ -0,0 +1,18 @@ ++ .section ".note.gnu.property", "a" ++ .p2align 2 ++ .long 1f - 0f /* name length. */ ++ .long 4f - 1f /* data length. */ ++ /* NT_GNU_PROPERTY_TYPE_0 */ ++ .long 5 /* note type. */ ++0: ++ .asciz "GNU" /* vendor name. */ ++1: ++ .p2align 2 ++ /* GNU_PROPERTY_X86_ISA_1_USED */ ++ .long 0xc0000000 /* pr_type. */ ++ .long 3f - 2f /* pr_datasz. */ ++2: ++ .long 0x0 ++3: ++ .p2align 2 ++4: +diff --git a/ld/testsuite/ld-i386/pr23372b.d b/ld/testsuite/ld-i386/pr23372b.d +new file mode 100644 +index 0000000000..a8e9c819a4 +--- /dev/null ++++ b/ld/testsuite/ld-i386/pr23372b.d +@@ -0,0 +1,5 @@ ++#source: pr23372a.s ++#source: pr23372c.s ++#as: --32 ++#ld: -r -m elf_i386 ++#readelf: -n +diff --git a/ld/testsuite/ld-i386/pr23372b.s b/ld/testsuite/ld-i386/pr23372b.s +new file mode 100644 +index 0000000000..9849d620a1 +--- /dev/null ++++ b/ld/testsuite/ld-i386/pr23372b.s +@@ -0,0 +1,18 @@ ++ .section ".note.gnu.property", "a" ++ .p2align 2 ++ .long 1f - 0f /* name length. */ ++ .long 4f - 1f /* data length. */ ++ /* NT_GNU_PROPERTY_TYPE_0 */ ++ .long 5 /* note type. */ ++0: ++ .asciz "GNU" /* vendor name. */ ++1: ++ .p2align 2 ++ /* GNU_PROPERTY_X86_ISA_1_USED */ ++ .long 0xc0000000 /* pr_type. */ ++ .long 3f - 2f /* pr_datasz. */ ++2: ++ .long 0x0 ++3: ++ .p2align 2 ++4: +diff --git a/ld/testsuite/ld-i386/pr23372c.s b/ld/testsuite/ld-i386/pr23372c.s +new file mode 100644 +index 0000000000..3470dce649 +--- /dev/null ++++ b/ld/testsuite/ld-i386/pr23372c.s +@@ -0,0 +1,18 @@ ++ .section ".note.gnu.property", "a" ++ .p2align 2 ++ .long 1f - 0f /* name length. */ ++ .long 4f - 1f /* data length. */ ++ /* NT_GNU_PROPERTY_TYPE_0 */ ++ .long 5 /* note type. */ ++0: ++ .asciz "GNU" /* vendor name. */ ++1: ++ .p2align 2 ++ /* GNU_PROPERTY_X86_ISA_1_NEEDED */ ++ .long 0xc0000001 /* pr_type. */ ++ .long 3f - 2f /* pr_datasz. */ ++2: ++ .long 0x0 ++3: ++ .p2align 2 ++4: +diff --git a/ld/testsuite/ld-x86-64/pr23372a-x32.d b/ld/testsuite/ld-x86-64/pr23372a-x32.d +new file mode 100644 +index 0000000000..9f93642364 +--- /dev/null ++++ b/ld/testsuite/ld-x86-64/pr23372a-x32.d +@@ -0,0 +1,5 @@ ++#source: pr23372a.s ++#source: pr23372b.s ++#as: --x32 ++#ld: -r -m elf32_x86_64 ++#readelf: -n +diff --git a/ld/testsuite/ld-x86-64/pr23372a.d b/ld/testsuite/ld-x86-64/pr23372a.d +new file mode 100644 +index 0000000000..ee688fc2e2 +--- /dev/null ++++ b/ld/testsuite/ld-x86-64/pr23372a.d +@@ -0,0 +1,5 @@ ++#source: pr23372a.s ++#source: pr23372b.s ++#as: --64 -defsym __64_bit__=1 ++#ld: -r -m elf_x86_64 ++#readelf: -n +diff --git a/ld/testsuite/ld-x86-64/pr23372a.s b/ld/testsuite/ld-x86-64/pr23372a.s +new file mode 100644 +index 0000000000..639fc26de4 +--- /dev/null ++++ b/ld/testsuite/ld-x86-64/pr23372a.s +@@ -0,0 +1,30 @@ ++ .section ".note.gnu.property", "a" ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++ .long 1f - 0f /* name length. */ ++ .long 4f - 1f /* data length. */ ++ /* NT_GNU_PROPERTY_TYPE_0 */ ++ .long 5 /* note type. */ ++0: ++ .asciz "GNU" /* vendor name. */ ++1: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++ /* GNU_PROPERTY_X86_ISA_1_USED */ ++ .long 0xc0000000 /* pr_type. */ ++ .long 3f - 2f /* pr_datasz. */ ++2: ++ .long 0x0 ++3: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++4: +diff --git a/ld/testsuite/ld-x86-64/pr23372b-x32.d b/ld/testsuite/ld-x86-64/pr23372b-x32.d +new file mode 100644 +index 0000000000..5b0cf98618 +--- /dev/null ++++ b/ld/testsuite/ld-x86-64/pr23372b-x32.d +@@ -0,0 +1,5 @@ ++#source: pr23372a.s ++#source: pr23372c.s ++#as: --x32 ++#ld: -r -m elf32_x86_64 ++#readelf: -n +diff --git a/ld/testsuite/ld-x86-64/pr23372b.d b/ld/testsuite/ld-x86-64/pr23372b.d +new file mode 100644 +index 0000000000..727afa8ab5 +--- /dev/null ++++ b/ld/testsuite/ld-x86-64/pr23372b.d +@@ -0,0 +1,5 @@ ++#source: pr23372a.s ++#source: pr23372c.s ++#as: --64 -defsym __64_bit__=1 ++#ld: -r -m elf_x86_64 ++#readelf: -n +diff --git a/ld/testsuite/ld-x86-64/pr23372b.s b/ld/testsuite/ld-x86-64/pr23372b.s +new file mode 100644 +index 0000000000..639fc26de4 +--- /dev/null ++++ b/ld/testsuite/ld-x86-64/pr23372b.s +@@ -0,0 +1,30 @@ ++ .section ".note.gnu.property", "a" ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++ .long 1f - 0f /* name length. */ ++ .long 4f - 1f /* data length. */ ++ /* NT_GNU_PROPERTY_TYPE_0 */ ++ .long 5 /* note type. */ ++0: ++ .asciz "GNU" /* vendor name. */ ++1: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++ /* GNU_PROPERTY_X86_ISA_1_USED */ ++ .long 0xc0000000 /* pr_type. */ ++ .long 3f - 2f /* pr_datasz. */ ++2: ++ .long 0x0 ++3: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++4: +diff --git a/ld/testsuite/ld-x86-64/pr23372c.s b/ld/testsuite/ld-x86-64/pr23372c.s +new file mode 100644 +index 0000000000..b4eaf69777 +--- /dev/null ++++ b/ld/testsuite/ld-x86-64/pr23372c.s +@@ -0,0 +1,30 @@ ++ .section ".note.gnu.property", "a" ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++ .long 1f - 0f /* name length. */ ++ .long 4f - 1f /* data length. */ ++ /* NT_GNU_PROPERTY_TYPE_0 */ ++ .long 5 /* note type. */ ++0: ++ .asciz "GNU" /* vendor name. */ ++1: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++ /* GNU_PROPERTY_X86_ISA_1_NEEDED */ ++ .long 0xc0000001 /* pr_type. */ ++ .long 3f - 2f /* pr_datasz. */ ++2: ++ .long 0x0 ++3: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++4: diff --git a/SOURCES/binutils-revert-PowerPC-speculation-barriers.patch b/SOURCES/binutils-revert-PowerPC-speculation-barriers.patch new file mode 100644 index 0000000..fe69cbf --- /dev/null +++ b/SOURCES/binutils-revert-PowerPC-speculation-barriers.patch @@ -0,0 +1,749 @@ +diff -rup binutils.orig/bfd/elf32-ppc.c binutils-2.30/bfd/elf32-ppc.c +--- binutils.orig/bfd/elf32-ppc.c 2018-02-08 10:49:07.649185371 +0000 ++++ binutils-2.30/bfd/elf32-ppc.c 2018-02-08 10:50:11.058395459 +0000 +@@ -69,7 +69,7 @@ static bfd_reloc_status_type ppc_elf_unh + /* For new-style .glink and .plt. */ + #define GLINK_PLTRESOLVE 16*4 + #define GLINK_ENTRY_SIZE(htab, h) \ +- (((!htab->params->speculate_indirect_jumps ? 6*4 : 4*4) \ ++ ((4*4 \ + + (h != NULL \ + && h == htab->tls_get_addr \ + && !htab->params->no_tls_get_addr_opt ? 8*4 : 0) \ +@@ -155,8 +155,6 @@ static const bfd_vma ppc_elf_vxworks_pic + #define BA 0x48000002 + #define BCL_20_31 0x429f0005 + #define BCTR 0x4e800420 +-#define CRSETEQ 0x4c421242 +-#define BEQCTRM 0x4dc20420 + #define BEQLR 0x4d820020 + #define CMPWI_11_0 0x2c0b0000 + #define LIS_11 0x3d600000 +@@ -2880,14 +2878,15 @@ ppc_elf_final_write_processing (bfd *abf + static bfd_boolean + is_nonpic_glink_stub (bfd *abfd, asection *glink, bfd_vma off) + { +- bfd_byte buf[3 * 4]; ++ bfd_byte buf[4 * 4]; + + if (!bfd_get_section_contents (abfd, glink, buf, off, sizeof buf)) + return FALSE; + + return ((bfd_get_32 (abfd, buf + 0) & 0xffff0000) == LIS_11 + && (bfd_get_32 (abfd, buf + 4) & 0xffff0000) == LWZ_11_11 +- && bfd_get_32 (abfd, buf + 8) == MTCTR_11); ++ && bfd_get_32 (abfd, buf + 8) == MTCTR_11 ++ && bfd_get_32 (abfd, buf + 12) == BCTR); + } + + static bfd_boolean +@@ -3366,7 +3365,7 @@ ppc_elf_link_hash_table_create (bfd *abf + { + struct ppc_elf_link_hash_table *ret; + static struct ppc_elf_params default_params +- = { PLT_OLD, 0, 1, 0, 1, 0, 0, 12, 0, 0, 0 }; ++ = { PLT_OLD, 0, 0, 1, 0, 0, 12, 0, 0, 0 }; + + ret = bfd_zmalloc (sizeof (struct ppc_elf_link_hash_table)); + if (ret == NULL) +@@ -7171,8 +7170,6 @@ ppc_elf_relax_section (bfd *abfd, + size = 4 * ARRAY_SIZE (stub_entry); + insn_offset = 0; + } +- if (!htab->params->speculate_indirect_jumps) +- size += 8; + stub_rtype = R_PPC_RELAX; + if (tsec == htab->elf.splt + || tsec == htab->glink) +@@ -7454,26 +7451,6 @@ elf_finish_pointer_linker_section (bfd * + #define PPC_HI(v) (((v) >> 16) & 0xffff) + #define PPC_HA(v) PPC_HI ((v) + 0x8000) + +-static inline bfd_byte * +-output_bctr (struct ppc_elf_link_hash_table *htab, bfd *obfd, bfd_byte *p) +-{ +- if (!htab->params->speculate_indirect_jumps) +- { +- bfd_put_32 (obfd, CRSETEQ, p); +- p += 4; +- bfd_put_32 (obfd, BEQCTRM, p); +- p += 4; +- bfd_put_32 (obfd, B, p); +- p += 4; +- } +- else +- { +- bfd_put_32 (obfd, BCTR, p); +- p += 4; +- } +- return p; +-} +- + static void + write_glink_stub (struct elf_link_hash_entry *h, struct plt_entry *ent, + asection *plt_sec, unsigned char *p, +@@ -7541,7 +7518,8 @@ write_glink_stub (struct elf_link_hash_e + p += 4; + bfd_put_32 (output_bfd, MTCTR_11, p); + p += 4; +- p = output_bctr (htab, output_bfd, p); ++ bfd_put_32 (output_bfd, BCTR, p); ++ p += 4; + while (p < end) + { + bfd_put_32 (output_bfd, htab->params->ppc476_workaround ? BA : NOP, p); +@@ -8979,7 +8957,6 @@ ppc_elf_relocate_section (bfd *output_bf + stub = stub_entry; + size = ARRAY_SIZE (stub_entry); + } +- --size; + + relocation += addend; + if (bfd_link_relocatable (info)) +@@ -9004,7 +8981,6 @@ ppc_elf_relocate_section (bfd *output_bf + bfd_put_32 (input_bfd, insn, contents + insn_offset); + insn_offset += 4; + } +- output_bctr (htab, input_bfd, contents + insn_offset); + + /* Rewrite the reloc and convert one of the trailing nop + relocs to describe this relocation. */ +@@ -10713,7 +10689,8 @@ ppc_elf_finish_dynamic_sections (bfd *ou + p += 4; + bfd_put_32 (output_bfd, ADD_11_0_11, p); + p += 4; +- p = output_bctr (htab, output_bfd, p); ++ bfd_put_32 (output_bfd, BCTR, p); ++ p += 4; + while (p < endp) + { + bfd_put_32 (output_bfd, +diff -rup binutils.orig/bfd/elf32-ppc.h binutils-2.30/bfd/elf32-ppc.h +--- binutils.orig/bfd/elf32-ppc.h 2018-02-08 10:49:07.644185433 +0000 ++++ binutils-2.30/bfd/elf32-ppc.h 2018-02-08 10:50:11.058395459 +0000 +@@ -35,9 +35,6 @@ struct ppc_elf_params + /* Set if individual PLT call stubs should be aligned. */ + int plt_stub_align; + +- /* Clear if PLT call stubs should use a speculative execution barrier. */ +- int speculate_indirect_jumps; +- + /* Whether to emit symbols for stubs. */ + int emit_stub_syms; + +diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.30/bfd/elf64-ppc.c +--- binutils.orig/bfd/elf64-ppc.c 2018-02-08 10:49:07.645185421 +0000 ++++ binutils-2.30/bfd/elf64-ppc.c 2018-02-08 10:50:11.060395434 +0000 +@@ -161,10 +161,6 @@ static bfd_vma opd_entry_value + #define LD_R11_0R11 0xe96b0000 /* ld %r11,xxx+16@l(%r11) */ + #define BCTR 0x4e800420 /* bctr */ + +-#define CRSETEQ 0x4c421242 /* crset 4*%cr0+%eq */ +-#define BEQCTRM 0x4dc20420 /* beqctr- */ +-#define BEQCTRLM 0x4dc20421 /* beqctrl- */ +- + #define ADDI_R11_R11 0x396b0000 /* addi %r11,%r11,off@l */ + #define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */ + #define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */ +@@ -193,8 +189,7 @@ static bfd_vma opd_entry_value + + /* __glink_PLTresolve stub instructions. We enter with the index in R0. */ + #define GLINK_PLTRESOLVE_SIZE(htab) \ +- (8u + (htab->opd_abi ? 11 * 4 : 14 * 4) \ +- + (!htab->params->speculate_indirect_jumps ? 2 * 4 : 0)) ++ (8u + (htab->opd_abi ? 11 * 4 : 14 * 4)) + /* 0: */ + /* .quad plt0-1f */ + /* __glink: */ +@@ -9886,8 +9881,6 @@ size_global_entry_stubs (struct elf_link + unsigned int align_power; + + stub_size = 16; +- if (!htab->params->speculate_indirect_jumps) +- stub_size += 8; + stub_off = s->size; + if (htab->params->plt_stub_align >= 0) + align_power = htab->params->plt_stub_align; +@@ -10453,8 +10446,6 @@ plt_stub_size (struct ppc_link_hash_tabl + size += 4; + if (PPC_HA (off) != 0) + size += 4; +- if (!htab->params->speculate_indirect_jumps) +- size += 8; + if (htab->opd_abi) + { + size += 4; +@@ -10476,11 +10467,7 @@ plt_stub_size (struct ppc_link_hash_tabl + size += 7 * 4; + if (ALWAYS_EMIT_R2SAVE + || stub_entry->stub_type == ppc_stub_plt_call_r2save) +- { +- size += 6 * 4; +- if (!htab->params->speculate_indirect_jumps) +- size -= 4; +- } ++ size += 6 * 4; + } + return size; + } +@@ -10515,26 +10502,6 @@ plt_stub_pad (struct ppc_link_hash_table + return 0; + } + +-static inline bfd_byte * +-output_bctr (struct ppc_link_hash_table *htab, bfd *obfd, bfd_byte *p) +-{ +- if (!htab->params->speculate_indirect_jumps) +- { +- bfd_put_32 (obfd, CRSETEQ, p); +- p += 4; +- bfd_put_32 (obfd, BEQCTRM, p); +- p += 4; +- bfd_put_32 (obfd, B_DOT, p); +- p += 4; +- } +- else +- { +- bfd_put_32 (obfd, BCTR, p); +- p += 4; +- } +- return p; +-} +- + /* Build a .plt call stub. */ + + static inline bfd_byte * +@@ -10555,7 +10522,6 @@ build_plt_stub (struct ppc_link_hash_tab + if (!ALWAYS_USE_FAKE_DEP + && plt_load_toc + && plt_thread_safe +- && htab->params->speculate_indirect_jumps + && !((stub_entry->h == htab->tls_get_addr_fd + || stub_entry->h == htab->tls_get_addr) + && htab->params->tls_get_addr_opt)) +@@ -10710,7 +10676,7 @@ build_plt_stub (struct ppc_link_hash_tab + bfd_put_32 (obfd, B_DOT | (cmp_branch_off & 0x3fffffc), p), p += 4; + } + else +- p = output_bctr (htab, obfd, p); ++ bfd_put_32 (obfd, BCTR, p), p += 4; + return p; + } + +@@ -10754,13 +10720,7 @@ build_tls_get_addr_stub (struct ppc_link + if (r != NULL) + r[0].r_offset += 2 * 4; + p = build_plt_stub (htab, stub_entry, p, offset, r); +- if (!htab->params->speculate_indirect_jumps) +- { +- p -= 4; +- bfd_put_32 (obfd, BEQCTRLM, p - 4); +- } +- else +- bfd_put_32 (obfd, BCTRL, p - 4); ++ bfd_put_32 (obfd, BCTRL, p - 4); + + bfd_put_32 (obfd, LD_R2_0R1 + STK_TOC (htab), p), p += 4; + bfd_put_32 (obfd, LD_R11_0R1 + STK_LINKER (htab), p), p += 4; +@@ -11113,7 +11073,8 @@ ppc_build_one_stub (struct bfd_hash_entr + p += 4; + bfd_put_32 (htab->params->stub_bfd, MTCTR_R12, p); + p += 4; +- p = output_bctr (htab, htab->params->stub_bfd, p); ++ bfd_put_32 (htab->params->stub_bfd, BCTR, p); ++ p += 4; + break; + + case ppc_stub_plt_call: +@@ -11446,8 +11407,6 @@ ppc_size_one_stub (struct bfd_hash_entry + if (PPC_LO (r2off) != 0) + size += 4; + } +- if (!htab->params->speculate_indirect_jumps) +- size += 8; + } + else if (info->emitrelocations) + { +@@ -13089,7 +13048,7 @@ build_global_entry_stubs (struct elf_lin + p += 4; + bfd_put_32 (s->owner, MTCTR_R12, p); + p += 4; +- output_bctr (htab, s->owner, p); ++ bfd_put_32 (s->owner, BCTR, p); + break; + } + return TRUE; +@@ -13218,7 +13177,8 @@ ppc64_elf_build_stubs (struct bfd_link_i + bfd_put_32 (htab->glink->owner, LD_R11_0R11 | 8, p); + p += 4; + } +- p = output_bctr (htab, htab->glink->owner, p); ++ bfd_put_32 (htab->glink->owner, BCTR, p); ++ p += 4; + BFD_ASSERT (p == htab->glink->contents + GLINK_PLTRESOLVE_SIZE (htab)); + + /* Build the .glink lazy link call stubs. */ +diff -rup binutils.orig/bfd/elf64-ppc.h binutils-2.30/bfd/elf64-ppc.h +--- binutils.orig/bfd/elf64-ppc.h 2018-02-08 10:49:07.637185520 +0000 ++++ binutils-2.30/bfd/elf64-ppc.h 2018-02-08 10:50:11.060395434 +0000 +@@ -51,9 +51,6 @@ struct ppc64_elf_params + /* Set if PLT call stubs for localentry:0 functions should omit r2 save. */ + int plt_localentry0; + +- /* Clear if PLT call stubs should use a speculative execution barrier. */ +- int speculate_indirect_jumps; +- + /* Whether to canonicalize .opd so that there are no overlapping + .opd entries. */ + int non_overlapping_opd; +diff -rup binutils.orig/gold/options.h binutils-2.30/gold/options.h +--- binutils.orig/gold/options.h 2018-02-08 10:49:07.354189045 +0000 ++++ binutils-2.30/gold/options.h 2018-02-08 10:50:11.060395434 +0000 +@@ -1108,10 +1108,6 @@ class General_options + N_("(PowerPC64 only) Optimize calls to ELFv2 localentry:0 functions"), + N_("(PowerPC64 only) Don't optimize ELFv2 calls")); + +- DEFINE_bool(speculate_indirect_jumps, options::TWO_DASHES, '\0', true, +- N_("(PowerPC only) PLT call stubs without speculation barrier"), +- N_("(PowerPC only) PLT call stubs with speculation barrier")); +- + DEFINE_bool(plt_static_chain, options::TWO_DASHES, '\0', false, + N_("(PowerPC64 only) PLT call stubs should load r11"), + N_("(PowerPC64 only) PLT call stubs should not load r11")); +diff -rup binutils.orig/gold/powerpc.cc binutils-2.30/gold/powerpc.cc +--- binutils.orig/gold/powerpc.cc 2018-02-08 10:49:07.355189033 +0000 ++++ binutils-2.30/gold/powerpc.cc 2018-02-08 10:50:11.061395422 +0000 +@@ -3781,8 +3781,6 @@ static const uint32_t b = 0x48000000; + static const uint32_t bcl_20_31 = 0x429f0005; + static const uint32_t bctr = 0x4e800420; + static const uint32_t bctrl = 0x4e800421; +-static const uint32_t beqctrm = 0x4dc20420; +-static const uint32_t beqctrlm = 0x4dc20421; + static const uint32_t beqlr = 0x4d820020; + static const uint32_t blr = 0x4e800020; + static const uint32_t bnectr_p4 = 0x4ce20420; +@@ -3792,7 +3790,6 @@ static const uint32_t cmpdi_11_0 = 0x2c2 + static const uint32_t cmpwi_11_0 = 0x2c0b0000; + static const uint32_t cror_15_15_15 = 0x4def7b82; + static const uint32_t cror_31_31_31 = 0x4ffffb82; +-static const uint32_t crseteq = 0x4c421242; + static const uint32_t ld_0_1 = 0xe8010000; + static const uint32_t ld_0_12 = 0xe80c0000; + static const uint32_t ld_2_1 = 0xe8410000; +@@ -4168,24 +4165,6 @@ write_insn(unsigned char* p, uint32_t v) + elfcpp::Swap<32, big_endian>::writeval(p, v); + } + +-template +-static unsigned char* +-output_bctr(unsigned char* p) +-{ +- if (!parameters->options().speculate_indirect_jumps()) +- { +- write_insn(p, crseteq); +- p += 4; +- write_insn(p, beqctrm); +- p += 4; +- write_insn(p, b); +- } +- else +- write_insn(p, bctr); +- p += 4; +- return p; +-} +- + template + static inline unsigned int + param_plt_align() +@@ -4454,7 +4433,6 @@ class Stub_table : public Output_relaxed + { + const Symbol* gsym = p->first.sym_; + return (4 * 4 +- + (!parameters->options().speculate_indirect_jumps() ? 2 * 4 : 0) + + (this->targ_->is_tls_get_addr_opt(gsym) ? 8 * 4 : 0)); + } + +@@ -4470,8 +4448,6 @@ class Stub_table : public Output_relaxed + got_addr += ppcobj->toc_base_offset(); + Address off = plt_addr - got_addr; + unsigned int bytes = 4 * 4 + 4 * (ha(off) != 0); +- if (!parameters->options().speculate_indirect_jumps()) +- bytes += 2 * 4; + const Symbol* gsym = p->first.sym_; + if (this->targ_->is_tls_get_addr_opt(gsym)) + bytes += 13 * 4; +@@ -4502,8 +4478,6 @@ class Stub_table : public Output_relaxed + if (p->first.dest_ - loc + (1 << 25) < 2 << 25) + return 4; + unsigned int bytes = 16; +- if (!parameters->options().speculate_indirect_jumps()) +- bytes += 8; + if (size == 32 && parameters->options().output_is_position_independent()) + bytes += 16; + return bytes; +@@ -4955,8 +4929,7 @@ class Output_data_glink : public Output_ + { + if (size == 64) + return (8 +- + (this->targ_->abiversion() < 2 ? 11 * 4 : 14 * 4) +- + (!parameters->options().speculate_indirect_jumps() ? 2 * 4 : 0)); ++ + (this->targ_->abiversion() < 2 ? 11 * 4 : 14 * 4)); + return 16 * 4; + } + +@@ -5033,8 +5006,7 @@ Output_data_glink::add + std::pair p + = this->global_entry_stubs_.insert(std::make_pair(gsym, off)); + if (p.second) +- this->ge_size_ +- = off + 16 + (!parameters->options().speculate_indirect_jumps() ? 8 : 0); ++ this->ge_size_ = off + 16; + } + + template +@@ -5223,10 +5195,7 @@ Stub_table::do_write(O + = plt_load_toc && this->targ_->plt_thread_safe(); + bool use_fake_dep = false; + Address cmp_branch_off = 0; +- if (thread_safe +- && !parameters->options().speculate_indirect_jumps()) +- use_fake_dep = true; +- else if (thread_safe) ++ if (thread_safe) + { + unsigned int pltindex + = ((pltoff - this->targ_->first_plt_entry_offset()) +@@ -5274,7 +5243,7 @@ Stub_table::do_write(O + + this->targ_->stk_linker())); + p += 4; + } +- use_fake_dep |= thread_safe; ++ use_fake_dep = thread_safe; + } + if (ha(off) != 0) + { +@@ -5365,14 +5334,7 @@ Stub_table::do_write(O + if (!cs->second.localentry0_ + && this->targ_->is_tls_get_addr_opt(gsym)) + { +- if (!parameters->options().speculate_indirect_jumps()) +- { +- write_insn(p, crseteq); +- p += 4; +- write_insn(p, beqctrlm); +- } +- else +- write_insn(p, bctrl); ++ write_insn(p, bctrl); + p += 4; + write_insn(p, ld_2_1 + this->targ_->stk_toc()); + p += 4; +@@ -5391,7 +5353,7 @@ Stub_table::do_write(O + write_insn(p, b | (cmp_branch_off & 0x3fffffc)); + } + else +- output_bctr(p); ++ write_insn(p, bctr); + } + } + +@@ -5426,7 +5388,7 @@ Stub_table::do_write(O + write_insn(p, ld_12_12 + l(brltoff)), p += 4; + } + write_insn(p, mtctr_12), p += 4; +- output_bctr(p); ++ write_insn(p, bctr); + } + } + } +@@ -5522,7 +5484,7 @@ Stub_table::do_write(O + p += 4; + write_insn(p, mtctr_11); + p += 4; +- output_bctr(p); ++ write_insn(p, bctr); + } + } + +@@ -5563,7 +5525,7 @@ Stub_table::do_write(O + p += 4; + write_insn(p, mtctr_12); + p += 4; +- output_bctr(p); ++ write_insn(p, bctr); + } + } + if (this->need_save_res_) +@@ -5630,7 +5592,7 @@ Output_data_glink::do_ + write_insn(p, mtctr_12), p += 4; + write_insn(p, ld_11_11 + 8), p += 4; + } +- p = output_bctr(p); ++ write_insn(p, bctr), p += 4; + gold_assert(p == oview + this->pltresolve_size()); + + // Write lazy link call stubs. +@@ -5686,7 +5648,7 @@ Output_data_glink::do_ + write_insn(p, addis_12_12 + ha(off)), p += 4; + write_insn(p, ld_12_12 + l(off)), p += 4; + write_insn(p, mtctr_12), p += 4; +- output_bctr(p); ++ write_insn(p, bctr); + } + } + else +@@ -5778,7 +5740,8 @@ Output_data_glink::do_ + write_insn(p, add_11_0_11); + } + p += 4; +- p = output_bctr(p); ++ write_insn(p, bctr); ++ p += 4; + while (p < end_p) + { + write_insn(p, nop); +diff -rup binutils.orig/ld/emultempl/ppc32elf.em binutils-2.30/ld/emultempl/ppc32elf.em +--- binutils.orig/ld/emultempl/ppc32elf.em 2018-02-08 10:49:07.192191063 +0000 ++++ binutils-2.30/ld/emultempl/ppc32elf.em 2018-02-08 10:50:11.062395410 +0000 +@@ -38,7 +38,7 @@ static int notlsopt = 0; + /* Choose the correct place for .got. */ + static int old_got = 0; + +-static struct ppc_elf_params params = { PLT_UNSET, 0, 1, -1, ++static struct ppc_elf_params params = { PLT_UNSET, 0, -1, + 0, 0, 0, 0, 0, 0, 0 }; + + static void +@@ -246,8 +246,6 @@ enum ppc32_opt + OPTION_NO_TLS_GET_ADDR_OPT, + OPTION_NEW_PLT, + OPTION_OLD_PLT, +- OPTION_SPECULATE_INDIRECT_JUMPS, +- OPTION_NO_SPECULATE_INDIRECT_JUMPS, + OPTION_PLT_ALIGN, + OPTION_NO_PLT_ALIGN, + OPTION_OLD_GOT, +@@ -269,8 +267,6 @@ if test -z "$VXWORKS_BASE_EM_FILE" ; the + PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}' + { "secure-plt", no_argument, NULL, OPTION_NEW_PLT }, + { "bss-plt", no_argument, NULL, OPTION_OLD_PLT }, +- { "speculate-indirect-jumps", no_argument, NULL, OPTION_SPECULATE_INDIRECT_JUMPS }, +- { "no-speculate-indirect-jumps", no_argument, NULL, OPTION_NO_SPECULATE_INDIRECT_JUMPS }, + { "plt-align", optional_argument, NULL, OPTION_PLT_ALIGN }, + { "no-plt-align", no_argument, NULL, OPTION_NO_PLT_ALIGN }, + { "sdata-got", no_argument, NULL, OPTION_OLD_GOT },' +@@ -304,12 +300,6 @@ if test -z "$VXWORKS_BASE_EM_FILE" ; the + --bss-plt Force old-style BSS PLT.\n" + )); + fprintf (file, _("\ +- --speculate-indirect-jumps PLT call stubs without speculation barrier.\n" +- )); +- fprintf (file, _("\ +- --no-speculate-indirect-jumps PLT call stubs with speculation barrier.\n" +- )); +- fprintf (file, _("\ + --plt-align Align PLT call stubs to fit cache lines.\n" + )); + fprintf (file, _("\ +@@ -360,14 +350,6 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LI + params.plt_style = PLT_OLD; + break; + +- case OPTION_SPECULATE_INDIRECT_JUMPS: +- params.speculate_indirect_jumps = 1; +- break; +- +- case OPTION_NO_SPECULATE_INDIRECT_JUMPS: +- params.speculate_indirect_jumps = 0; +- break; +- + case OPTION_PLT_ALIGN: + if (optarg != NULL) + { +diff -rup binutils.orig/ld/emultempl/ppc64elf.em binutils-2.30/ld/emultempl/ppc64elf.em +--- binutils.orig/ld/emultempl/ppc64elf.em 2018-02-08 10:49:07.192191063 +0000 ++++ binutils-2.30/ld/emultempl/ppc64elf.em 2018-02-08 10:50:11.062395410 +0000 +@@ -38,7 +38,7 @@ static struct ppc64_elf_params params = + &ppc_layout_sections_again, + 1, -1, 0, + ${DEFAULT_PLT_STATIC_CHAIN-0}, -1, 5, +- -1, 1, 0, -1, -1, 0}; ++ -1, 0, -1, -1, 0}; + + /* Fake input file for stubs. */ + static lang_input_statement_type *stub_file; +@@ -692,8 +692,6 @@ enum ppc64_opt + OPTION_NO_PLT_STATIC_CHAIN, + OPTION_PLT_THREAD_SAFE, + OPTION_NO_PLT_THREAD_SAFE, +- OPTION_SPECULATE_INDIRECT_JUMPS, +- OPTION_NO_SPECULATE_INDIRECT_JUMPS, + OPTION_PLT_ALIGN, + OPTION_NO_PLT_ALIGN, + OPTION_PLT_LOCALENTRY, +@@ -721,8 +719,6 @@ PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST + { "no-plt-static-chain", no_argument, NULL, OPTION_NO_PLT_STATIC_CHAIN }, + { "plt-thread-safe", no_argument, NULL, OPTION_PLT_THREAD_SAFE }, + { "no-plt-thread-safe", no_argument, NULL, OPTION_NO_PLT_THREAD_SAFE }, +- { "speculate-indirect-jumps", no_argument, NULL, OPTION_SPECULATE_INDIRECT_JUMPS }, +- { "no-speculate-indirect-jumps", no_argument, NULL, OPTION_NO_SPECULATE_INDIRECT_JUMPS }, + { "plt-align", optional_argument, NULL, OPTION_PLT_ALIGN }, + { "no-plt-align", no_argument, NULL, OPTION_NO_PLT_ALIGN }, + { "plt-localentry", optional_argument, NULL, OPTION_PLT_LOCALENTRY }, +@@ -764,13 +760,7 @@ PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_ + --plt-thread-safe PLT call stubs with load-load barrier.\n" + )); + fprintf (file, _("\ +- --no-plt-thread-safe PLT call stubs without load-load barrier.\n" +- )); +- fprintf (file, _("\ +- --speculate-indirect-jumps PLT call stubs without speculation barrier.\n" +- )); +- fprintf (file, _("\ +- --no-speculate-indirect-jumps PLT call stubs with speculation barrier.\n" ++ --no-plt-thread-safe PLT call stubs without barrier.\n" + )); + fprintf (file, _("\ + --plt-align [=] Align PLT call stubs to fit cache lines.\n" +@@ -860,14 +850,6 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LI + params.plt_thread_safe = 0; + break; + +- case OPTION_SPECULATE_INDIRECT_JUMPS: +- params.speculate_indirect_jumps = 1; +- break; +- +- case OPTION_NO_SPECULATE_INDIRECT_JUMPS: +- params.speculate_indirect_jumps = 0; +- break; +- + case OPTION_PLT_ALIGN: + if (optarg != NULL) + { +diff -rup binutils.orig/ld/ld.texinfo binutils-2.30/ld/ld.texinfo +--- binutils.orig/ld/ld.texinfo 2018-02-08 10:49:07.203190926 +0000 ++++ binutils-2.30/ld/ld.texinfo 2018-02-08 10:50:11.063395397 +0000 +@@ -7646,15 +7646,6 @@ looks for calls to commonly used functio + seen, adds the necessary barriers. Use these options to change the + default behaviour. + +-@cindex PowerPC64 PLT call stub speculative execution barrier +-@kindex --speculate-indirect-jumps +-@kindex --no-speculate-indirect-jumps +-@item --speculate-indirect-jumps +-@itemx --no-speculate-indirect-jumps +-Use these options to control whether all indirect branch instructions +-emitted by @code{ld}, such as those in the PLT, have a speculative +-execution barrier to mitigate Spectre variant 2 attacks. +- + @cindex PowerPC64 ELFv2 PLT localentry optimization + @kindex --plt-localentry + @kindex --no-plt-localentry +diff -rup binutils.orig/ld/testsuite/ld-powerpc/elfv2exe.d binutils-2.30/ld/testsuite/ld-powerpc/elfv2exe.d +--- binutils.orig/ld/testsuite/ld-powerpc/elfv2exe.d 2018-02-08 10:49:07.261190203 +0000 ++++ binutils-2.30/ld/testsuite/ld-powerpc/elfv2exe.d 2018-02-08 10:50:11.063395397 +0000 +@@ -1,6 +1,6 @@ + #source: elfv2.s + #as: -a64 +-#ld: -melf64ppc --speculate-indirect-jumps --defsym f2=0x1234 --defsym f3=0x10008888 --defsym f4=0x1200000 --defsym _start=f1 ++#ld: -melf64ppc --defsym f2=0x1234 --defsym f3=0x10008888 --defsym f4=0x1200000 --defsym _start=f1 + #objdump: -dr + + .* +diff -rup binutils.orig/ld/testsuite/ld-powerpc/elfv2so.d binutils-2.30/ld/testsuite/ld-powerpc/elfv2so.d +--- binutils.orig/ld/testsuite/ld-powerpc/elfv2so.d 2018-02-08 10:49:07.264190166 +0000 ++++ binutils-2.30/ld/testsuite/ld-powerpc/elfv2so.d 2018-02-08 10:50:11.063395397 +0000 +@@ -1,6 +1,6 @@ + #source: elfv2.s + #as: -a64 +-#ld: -melf64ppc -shared --speculate-indirect-jumps ++#ld: -melf64ppc -shared + #objdump: -dr + + .* +diff -rup binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp binutils-2.30/ld/testsuite/ld-powerpc/powerpc.exp +--- binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp 2018-02-08 10:49:07.261190203 +0000 ++++ binutils-2.30/ld/testsuite/ld-powerpc/powerpc.exp 2018-02-08 10:50:11.063395397 +0000 +@@ -121,11 +121,11 @@ set ppcelftests { + "tls32"} + {"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" "" {} + {} "libtlslib32.so"} +- {"TLS32 dynamic exec" "-melf32ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o tmpdir/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 -sj.got tlsexe32.g} {objdump -sj.tdata tlsexe32.t}} + "tlsexe32"} +- {"TLS32 shared" "-shared -melf32ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o" "" "" {} ++ {"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 -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}} + "tls32.so"} +@@ -147,7 +147,7 @@ set ppcelftests { + {"TLS32 DLL" "-shared -melf32ppc --version-script tlsdll.ver" "" + "-a32" {tlsdll_32.s} + {} "tlsdll32.so"} +- {"TLS32 opt 5" "-melf32ppc -shared --gc-sections --secure-plt --no-plt-align --speculate-indirect-jumps tmpdir/tlsdll32.so" "" "-a32" {tlsopt5_32.s} ++ {"TLS32 opt 5" "-melf32ppc -shared --gc-sections --secure-plt --no-plt-align tmpdir/tlsdll32.so" "" "-a32" {tlsopt5_32.s} + {{objdump -dr tlsopt5_32.d}} + "tlsopt5_32"} + {"Shared library with global symbol" "-shared -melf32ppc" "" "-a32" {sdalib.s} +@@ -174,15 +174,15 @@ set ppc64elftests { + {} "libtlslib.so"} + {"TLS helper old shared lib" "-shared -melf64ppc" "" "-a64" {oldtlslib.s} + {} "liboldlib.so"} +- {"TLS dynamic exec" "-melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {} ++ {"TLS dynamic exec" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {} + {{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d} + {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}} + "tlsexe"} +- {"TLS dynamic old" "-melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/liboldlib.so" "" "" {} ++ {"TLS dynamic old" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/liboldlib.so" "" "" {} + {{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d} + {objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}} + "tlsexeold"} +- {"TLS shared" "-shared -melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o" "" "" {} ++ {"TLS shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o" "" "" {} + {{readelf -WSsrl tlsso.r} {objdump -dr tlsso.d} + {objdump -sj.got tlsso.g} {objdump -sj.tdata tlsso.t}} + "tls.so"} +@@ -190,17 +190,17 @@ set ppc64elftests { + {{objdump -dr tlstoc.d} {objdump -sj.got tlstoc.g} + {objdump -sj.tdata tlstoc.t}} + "tlstoc"} +- {"TLSTOC dynamic exec" "-melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" "" ++ {"TLSTOC dynamic exec" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" "" + "" {} + {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d} + {objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}} + "tlsexetoc"} +- {"TLSTOC dynamic old" "-melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/liboldlib.so" "" ++ {"TLSTOC dynamic old" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/liboldlib.so" "" + "" {} + {{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d} + {objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}} + "tlsexetocold"} +- {"TLSTOC shared" "-shared -melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o" "" "" {} ++ {"TLSTOC shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o" "" "" {} + {{readelf -WSsrl tlstocso.r} {objdump -dr tlstocso.d} + {objdump -sj.got tlstocso.g} {objdump -sj.tdata tlstocso.t}} + "tlstoc.so"} +@@ -221,7 +221,7 @@ set ppc64elftests { + "tlsopt4"} + {"TLS DLL" "-shared -melf64ppc --version-script tlsdll.ver" "" "-a64" {tlsdll.s} + {} "tlsdll.so"} +- {"TLS opt 5" "-melf64ppc --no-plt-align --speculate-indirect-jumps -shared --gc-sections --no-plt-localentry tmpdir/tlsdll.so" "" "-a64" {tlsopt5.s} ++ {"TLS opt 5" "-melf64ppc --no-plt-align -shared --gc-sections --no-plt-localentry tmpdir/tlsdll.so" "" "-a64" {tlsopt5.s} + {{objdump -dr tlsopt5.d} {readelf -wf tlsopt5.wf}} + "tlsopt5"} + {"sym@tocbase" "-shared -melf64ppc" "" "-a64" {symtocbase-1.s symtocbase-2.s} +diff -rup binutils.orig/ld/testsuite/ld-powerpc/relbrlt.d binutils-2.30/ld/testsuite/ld-powerpc/relbrlt.d +--- binutils.orig/ld/testsuite/ld-powerpc/relbrlt.d 2018-02-08 10:49:07.262190191 +0000 ++++ binutils-2.30/ld/testsuite/ld-powerpc/relbrlt.d 2018-02-08 10:50:11.063395397 +0000 +@@ -1,6 +1,6 @@ + #source: relbrlt.s + #as: -a64 +-#ld: -melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --emit-relocs ++#ld: -melf64ppc --no-plt-align --no-ld-generated-unwind-info --emit-relocs + #objdump: -Dr + + .* diff --git a/SOURCES/binutils-s390x-arch13.patch b/SOURCES/binutils-s390x-arch13.patch new file mode 100644 index 0000000..8b33bd3 --- /dev/null +++ b/SOURCES/binutils-s390x-arch13.patch @@ -0,0 +1,1040 @@ +# Add support for the arch13 extension to the s390x architecture. (#1659437) + +diff -rup binutils.orig/gas/config/tc-s390.c binutils-2.30/gas/config/tc-s390.c +--- binutils.orig/gas/config/tc-s390.c 2019-03-07 13:21:13.799468286 +0000 ++++ binutils-2.30/gas/config/tc-s390.c 2019-03-07 14:02:36.903119967 +0000 +@@ -291,6 +291,8 @@ s390_parse_cpu (const char * arg + { STRING_COMMA_LEN ("z13"), STRING_COMMA_LEN ("arch11"), + S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, + { STRING_COMMA_LEN ("z14"), STRING_COMMA_LEN ("arch12"), ++ S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, ++ { STRING_COMMA_LEN (""), STRING_COMMA_LEN ("arch13"), + S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX } + }; + static struct +@@ -1229,6 +1231,24 @@ s390_elf_cons (int nbytes /* 1=.byte, 2= + demand_empty_rest_of_line (); + } + ++/* Return true if all remaining operands in the opcode with ++ OPCODE_FLAGS can be skipped. */ ++static bfd_boolean ++skip_optargs_p (unsigned int opcode_flags, const unsigned char *opindex_ptr) ++{ ++ if ((opcode_flags & (S390_INSTR_FLAG_OPTPARM | S390_INSTR_FLAG_OPTPARM2)) ++ && opindex_ptr[0] != '\0' ++ && opindex_ptr[1] == '\0') ++ return TRUE; ++ ++ if ((opcode_flags & S390_INSTR_FLAG_OPTPARM2) ++ && opindex_ptr[0] != '\0' ++ && opindex_ptr[1] != '\0' ++ && opindex_ptr[2] == '\0') ++ return TRUE; ++ return FALSE; ++} ++ + /* We need to keep a list of fixups. We can't simply generate them as + we go, because that would require us to first create the frag, and + that would screw up references to ``.''. */ +@@ -1468,6 +1488,9 @@ md_gather_operands (char *str, + while (!(operand->flags & S390_OPERAND_BASE)) + operand = s390_operands + *(++opindex_ptr); + ++ if (*str == '\0' && skip_optargs_p (opcode->flags, &opindex_ptr[1])) ++ continue; ++ + /* If there is a next operand it must be separated by a comma. */ + if (opindex_ptr[1] != '\0') + { +@@ -1510,6 +1533,10 @@ md_gather_operands (char *str, + if (*str++ != ')') + as_bad (_("syntax error; missing ')' after base register")); + skip_optional = 0; ++ ++ if (*str == '\0' && skip_optargs_p (opcode->flags, &opindex_ptr[1])) ++ continue; ++ + /* If there is a next operand it must be separated by a comma. */ + if (opindex_ptr[1] != '\0') + { +@@ -1539,18 +1566,7 @@ md_gather_operands (char *str, + str++; + } + +- if ((opcode->flags & (S390_INSTR_FLAG_OPTPARM +- | S390_INSTR_FLAG_OPTPARM2)) +- && opindex_ptr[1] != '\0' +- && opindex_ptr[2] == '\0' +- && *str == '\0') +- continue; +- +- if ((opcode->flags & S390_INSTR_FLAG_OPTPARM2) +- && opindex_ptr[1] != '\0' +- && opindex_ptr[2] != '\0' +- && opindex_ptr[3] == '\0' +- && *str == '\0') ++ if (*str == '\0' && skip_optargs_p (opcode->flags, &opindex_ptr[1])) + continue; + + /* If there is a next operand it must be separated by a comma. */ +diff -rup binutils.orig/gas/doc/c-s390.texi binutils-2.30/gas/doc/c-s390.texi +--- binutils.orig/gas/doc/c-s390.texi 2019-03-07 13:21:13.806468232 +0000 ++++ binutils-2.30/gas/doc/c-s390.texi 2019-03-07 13:23:07.799582976 +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), and z14 (or arch12). ++(or arch11), z14 (or arch12), and arch13. + + @menu + * s390 Options:: Command-line Options. +@@ -68,8 +68,10 @@ are recognized: + @code{z9-ec} (or @code{arch7}), + @code{z10} (or @code{arch8}), + @code{z196} (or @code{arch9}), +-@code{zEC12} (or @code{arch10}) and +-@code{z13} (or @code{arch11}). ++@code{zEC12} (or @code{arch10}), ++@code{z13} (or @code{arch11}), ++@code{z14} (or @code{arch12}), and ++@code{arch13}). + + 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.30/gas/testsuite/gas/s390/s390.exp +--- binutils.orig/gas/testsuite/gas/s390/s390.exp 2019-03-07 13:21:13.813468178 +0000 ++++ binutils-2.30/gas/testsuite/gas/s390/s390.exp 2019-03-07 13:24:31.563932472 +0000 +@@ -29,9 +29,11 @@ if [expr [istarget "s390-*-*"] || [ista + run_dump_test "zarch-zEC12" "{as -m64} {as -march=zEC12}" + 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-reloc" "{as -m64}" + run_dump_test "zarch-operands" "{as -m64} {as -march=z9-109}" + run_dump_test "zarch-machine" "{as -m64} {as -march=z900}" ++ run_dump_test "zarch-optargs" "{as -m64} {as -march=arch12}" + run_list_test "machine-parsing-1" "" + run_list_test "machine-parsing-2" "" + run_list_test "machine-parsing-3" "" +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-arch12.d binutils-2.30/gas/testsuite/gas/s390/zarch-arch12.d +--- binutils.orig/gas/testsuite/gas/s390/zarch-arch12.d 2019-03-07 13:21:13.815468162 +0000 ++++ binutils-2.30/gas/testsuite/gas/s390/zarch-arch12.d 2019-03-07 13:25:32.126462146 +0000 +@@ -201,3 +201,11 @@ Disassembly of section .text: + .*: b9 3c 00 69 [ ]*prno %r6,%r9 + .*: b9 a1 00 69 [ ]*tpei %r6,%r9 + .*: b9 ac 00 69 [ ]*irbm %r6,%r9 ++.*: e7 f6 9f a0 00 06 [ ]*vl %v15,4000\(%r6,%r9\) ++.*: e7 f6 9f a0 d0 06 [ ]*vl %v15,4000\(%r6,%r9\),13 ++.*: e7 f1 6f a0 04 36 [ ]*vlm %v15,%v17,4000\(%r6\) ++.*: e7 f1 6f a0 d4 36 [ ]*vlm %v15,%v17,4000\(%r6\),13 ++.*: e7 f6 9f a0 00 0e [ ]*vst %v15,4000\(%r6,%r9\) ++.*: e7 f6 9f a0 d0 0e [ ]*vst %v15,4000\(%r6,%r9\),13 ++.*: e7 f1 6f a0 04 3e [ ]*vstm %v15,%v17,4000\(%r6\) ++.*: e7 f1 6f a0 d4 3e [ ]*vstm %v15,%v17,4000\(%r6\),13 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-arch12.s binutils-2.30/gas/testsuite/gas/s390/zarch-arch12.s +--- binutils.orig/gas/testsuite/gas/s390/zarch-arch12.s 2019-03-07 13:21:13.814468170 +0000 ++++ binutils-2.30/gas/testsuite/gas/s390/zarch-arch12.s 2019-03-07 13:25:32.126462146 +0000 +@@ -195,3 +195,11 @@ foo: + prno %r6,%r9 + tpei %r6,%r9 + irbm %r6,%r9 ++ vl %v15,4000(%r6,%r9) ++ vl %v15,4000(%r6,%r9),13 ++ vlm %v15,%v17,4000(%r6) ++ vlm %v15,%v17,4000(%r6),13 ++ vst %v15,4000(%r6,%r9) ++ vst %v15,4000(%r6,%r9),13 ++ vstm %v15,%v17,4000(%r6) ++ vstm %v15,%v17,4000(%r6),13 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-z13.d binutils-2.30/gas/testsuite/gas/s390/zarch-z13.d +--- binutils.orig/gas/testsuite/gas/s390/zarch-z13.d 2019-03-07 13:21:13.814468170 +0000 ++++ binutils-2.30/gas/testsuite/gas/s390/zarch-z13.d 2019-03-07 13:23:07.799582976 +0000 +@@ -495,16 +495,16 @@ Disassembly of section .text: + .*: e7 f1 40 10 36 ea [ ]*vfchedbs %v15,%v17,%v20 + .*: e7 f1 40 08 36 ea [ ]*wfchedb %v15,%v17,%v20 + .*: e7 f1 40 18 36 ea [ ]*wfchedbs %v15,%v17,%v20 +-.*: e7 f1 00 bc d4 c3 [ ]*vcdg %v15,%v17,13,12,11 ++.*: e7 f1 00 bc d4 c3 [ ]*vcfps %v15,%v17,13,12,11 + .*: e7 f1 00 cd 34 c3 [ ]*wcdgb %v15,%v17,5,12 + .*: e7 f1 00 cd 34 c3 [ ]*wcdgb %v15,%v17,5,12 +-.*: e7 f1 00 bc d4 c1 [ ]*vcdlg %v15,%v17,13,12,11 ++.*: e7 f1 00 bc d4 c1 [ ]*vcfpl %v15,%v17,13,12,11 + .*: e7 f1 00 cd 34 c1 [ ]*wcdlgb %v15,%v17,5,12 + .*: e7 f1 00 cd 34 c1 [ ]*wcdlgb %v15,%v17,5,12 +-.*: e7 f1 00 bc d4 c2 [ ]*vcgd %v15,%v17,13,12,11 ++.*: e7 f1 00 bc d4 c2 [ ]*vcsfp %v15,%v17,13,12,11 + .*: e7 f1 00 cd 34 c2 [ ]*wcgdb %v15,%v17,5,12 + .*: e7 f1 00 cd 34 c2 [ ]*wcgdb %v15,%v17,5,12 +-.*: e7 f1 00 bc d4 c0 [ ]*vclgd %v15,%v17,13,12,11 ++.*: e7 f1 00 bc d4 c0 [ ]*vclfp %v15,%v17,13,12,11 + .*: e7 f1 00 cd 34 c0 [ ]*wclgdb %v15,%v17,5,12 + .*: e7 f1 00 cd 34 c0 [ ]*wclgdb %v15,%v17,5,12 + .*: e7 f1 40 0c d6 e5 [ ]*vfd %v15,%v17,%v20,13,12 +diff -rup binutils.orig/include/opcode/s390.h binutils-2.30/include/opcode/s390.h +--- binutils.orig/include/opcode/s390.h 2019-03-07 13:21:14.295464435 +0000 ++++ binutils-2.30/include/opcode/s390.h 2019-03-07 13:23:07.799582976 +0000 +@@ -43,6 +43,7 @@ enum s390_opcode_cpu_val + S390_OPCODE_ZEC12, + S390_OPCODE_Z13, + S390_OPCODE_ARCH12, ++ S390_OPCODE_ARCH13, + S390_OPCODE_MAXCPU + }; + +diff -rup binutils.orig/opcodes/s390-mkopc.c binutils-2.30/opcodes/s390-mkopc.c +--- binutils.orig/opcodes/s390-mkopc.c 2019-03-07 13:21:13.440471074 +0000 ++++ binutils-2.30/opcodes/s390-mkopc.c 2019-03-07 13:23:07.818582828 +0000 +@@ -377,6 +377,8 @@ main (void) + else if (strcmp (cpu_string, "z14") == 0 + || strcmp (cpu_string, "arch12") == 0) + min_cpu = S390_OPCODE_ARCH12; ++ else if (strcmp (cpu_string, "arch13") == 0) ++ min_cpu = S390_OPCODE_ARCH13; + else { + fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string); + exit (1); +diff -rup binutils.orig/opcodes/s390-opc.c binutils-2.30/opcodes/s390-opc.c +--- binutils.orig/opcodes/s390-opc.c 2019-03-07 13:21:13.439471082 +0000 ++++ binutils-2.30/opcodes/s390-opc.c 2019-03-07 13:23:07.819582821 +0000 +@@ -359,6 +359,7 @@ const struct s390_operand s390_operands[ + #define INSTR_RRF_RURR2 4, { R_24,R_16,R_28,U4_20,0,0 } /* e.g. lptea */ + #define INSTR_RRF_R0RR 4, { R_24,R_16,R_28,0,0,0 } /* e.g. idte */ + #define INSTR_RRF_R0RR2 4, { R_24,R_28,R_16,0,0,0 } /* e.g. ark */ ++#define INSTR_RRF_R0RR3 4, { R_24,R_28,R_16,0,0,0 } /* e.g. selrz */ + #define INSTR_RRF_U0FF 4, { F_24,U4_16,F_28,0,0,0 } /* e.g. fidbr */ + #define INSTR_RRF_U0FEFE 4, { FE_24,U4_16,FE_28,0,0,0 } /* e.g. fixbr */ + #define INSTR_RRF_U0RF 4, { R_24,U4_16,F_28,0,0,0 } /* e.g. cfebr */ +@@ -513,6 +514,7 @@ const struct s390_operand s390_operands[ + #define INSTR_VRR_VV0U0U 6, { V_8,V_12,U4_32,U4_24,0,0 } /* e.g. vistr */ + #define INSTR_VRR_0VV0U 6, { V_12,V_16,U4_24,0,0,0 } /* e.g. vcp */ + #define INSTR_VRR_RV0U 6, { R_8,V_12,U4_24,0,0,0 } /* e.g. vcvb */ ++#define INSTR_VRR_RV0UU 6, { R_8,V_12,U4_24,U4_28,0,0 } /* e.g. vcvb */ + #define INSTR_VSI_URDV 6, { V_32,D_20,B_16,U8_8,0,0 } /* e.g. vlrl */ + + #define MASK_E { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } +@@ -578,6 +580,7 @@ const struct s390_operand s390_operands[ + #define MASK_RRF_RURR2 { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } + #define MASK_RRF_R0RR { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } + #define MASK_RRF_R0RR2 { 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } ++#define MASK_RRF_R0RR3 { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } + #define MASK_RRF_U0FF { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } + #define MASK_RRF_U0FEFE { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } + #define MASK_RRF_U0RF { 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00 } +@@ -732,6 +735,7 @@ const struct s390_operand s390_operands[ + #define MASK_VRR_VV0U0U { 0xff, 0x00, 0xff, 0x0f, 0x00, 0xff } + #define MASK_VRR_0VV0U { 0xff, 0xf0, 0x0f, 0x0f, 0xf0, 0xff } + #define MASK_VRR_RV0U { 0xff, 0x00, 0xff, 0x0f, 0xf0, 0xff } ++#define MASK_VRR_RV0UU { 0xff, 0x00, 0xff, 0x00, 0xf0, 0xff } + #define MASK_VSI_URDV { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff } + + +diff -rup binutils.orig/opcodes/s390-opc.txt binutils-2.30/opcodes/s390-opc.txt +--- binutils.orig/opcodes/s390-opc.txt 2019-03-07 13:21:13.425471191 +0000 ++++ binutils-2.30/opcodes/s390-opc.txt 2019-03-07 13:26:01.603233234 +0000 +@@ -1880,3 +1880,115 @@ b929 kma RRF_R0RR "cipher message with g + b93c prno RRE_RR "perform pseudorandom number operation" arch12 zarch + b9a1 tpei RRE_RR "test pending external interruption" arch12 zarch + b9ac irbm RRE_RR "insert reference bits multiple" arch12 zarch ++ ++ ++# Aligned vector store hints ++ ++e70000000006 vl VRX_VRRDU "vector memory load" arch12 zarch optparm ++e70000000036 vlm VRS_VVRDU "vector load multiple" arch12 zarch optparm ++e7000000000e vst VRX_VRRDU "vector store" arch12 zarch optparm ++e7000000003e vstm VRS_VVRDU "vector store multiple" arch12 zarch optparm ++ ++# arch13 instructions ++ ++b9f5 ncrk RRF_R0RR2 " " arch13 zarch ++b9e5 ncgrk RRF_R0RR2 " " arch13 zarch ++e50a mvcrl SSE_RDRD " " arch13 zarch ++b974 nnrk RRF_R0RR2 " " arch13 zarch ++b964 nngrk RRF_R0RR2 " " arch13 zarch ++b976 nork RRF_R0RR2 " " arch13 zarch ++b966 nogrk RRF_R0RR2 " " arch13 zarch ++b977 nxrk RRF_R0RR2 " " arch13 zarch ++b967 nxgrk RRF_R0RR2 " " arch13 zarch ++b975 ocrk RRF_R0RR2 " " arch13 zarch ++b965 ocgrk RRF_R0RR2 " " arch13 zarch ++b9e1 popcnt RRF_U0RR " " arch13 zarch optparm ++b9f0 selr RRF_RURR " " arch13 zarch ++b9f00000 selr*20 RRF_R0RR3 " " arch13 zarch ++b9e3 selgr RRF_RURR " " arch13 zarch ++b9e30000 selgr*20 RRF_R0RR3 " " arch13 zarch ++b9c0 selhhhr RRF_RURR " " arch13 zarch ++b9c00000 selhhhr*20 RRF_R0RR3 " " arch13 zarch ++ ++e60000000006 vlbr VRX_VRRDU " " arch13 zarch ++e60000001006 vlbrh VRX_VRRD " " arch13 zarch ++e60000002006 vlbrf VRX_VRRD " " arch13 zarch ++e60000003006 vlbrg VRX_VRRD " " arch13 zarch ++e60000004006 vlbrq VRX_VRRD " " arch13 zarch ++ ++e60000000007 vler VRX_VRRDU " " arch13 zarch ++e60000001007 vlerh VRX_VRRD " " arch13 zarch ++e60000002007 vlerf VRX_VRRD " " arch13 zarch ++e60000003007 vlerg VRX_VRRD " " arch13 zarch ++ ++e60000000004 vllebrz VRX_VRRDU " " arch13 zarch ++e60000001004 vllebrzh VRX_VRRD " " arch13 zarch ++e60000002004 vllebrzf VRX_VRRD " " arch13 zarch ++e60000003004 ldrv VRX_VRRD " " arch13 zarch ++e60000003004 vllebrzg VRX_VRRD " " arch13 zarch ++e60000006004 lerv VRX_VRRD " " arch13 zarch ++e60000006004 vllebrze VRX_VRRD " " arch13 zarch ++ ++e60000000001 vlebrh VRX_VRRDU " " arch13 zarch ++e60000000003 vlebrf VRX_VRRDU " " arch13 zarch ++e60000000002 vlebrg VRX_VRRDU " " arch13 zarch ++ ++e60000000005 vlbrrep VRX_VRRDU " " arch13 zarch ++e60000001005 vlbrreph VRX_VRRD " " arch13 zarch ++e60000002005 vlbrrepf VRX_VRRD " " arch13 zarch ++e60000003005 vlbrrepg VRX_VRRD " " arch13 zarch ++ ++e6000000000e vstbr VRX_VRRDU " " arch13 zarch ++e6000000100e vstbrh VRX_VRRD " " arch13 zarch ++e6000000200e vstbrf VRX_VRRD " " arch13 zarch ++e6000000300e vstbrg VRX_VRRD " " arch13 zarch ++e6000000400e vstbrq VRX_VRRD " " arch13 zarch ++ ++e6000000000f vster VRX_VRRDU " " arch13 zarch ++e6000000100f vsterh VRX_VRRD " " arch13 zarch ++e6000000200f vsterf VRX_VRRD " " arch13 zarch ++e6000000300f vsterg VRX_VRRD " " arch13 zarch ++ ++e60000000009 vstebrh VRX_VRRDU " " arch13 zarch ++e6000000000b vstebrf VRX_VRRDU " " arch13 zarch ++e6000000000b sterv VRX_VRRD " " arch13 zarch ++e6000000000a vstebrg VRX_VRRDU " " arch13 zarch ++e6000000000a stdrv VRX_VRRD " " arch13 zarch ++ ++e70000000086 vsld VRI_VVV0U " " arch13 zarch ++e70000000087 vsrd VRI_VVV0U " " arch13 zarch ++ ++e7000000008b vstrs VRR_VVVUU0V " " arch13 zarch optparm ++ ++e7000000008b vstrsb VRR_VVVU0VB " " arch13 zarch optparm ++e7000100008b vstrsh VRR_VVVU0VB " " arch13 zarch optparm ++e7000200008b vstrsf VRR_VVVU0VB " " arch13 zarch optparm ++ ++e7000020008b vstrszb VRR_VVVU0VB2 " " arch13 zarch optparm ++e7000120008b vstrszh VRR_VVVU0VB2 " " arch13 zarch optparm ++e7000220008b vstrszf VRR_VVVU0VB2 " " arch13 zarch optparm ++ ++e700000000c3 vcfps VRR_VV0UUU " " arch13 zarch ++e700000020c3 vcefb VRR_VV0UU " " arch13 zarch ++e700000820c3 wcefb VRR_VV0UU8 " " arch13 zarch ++ ++e700000000c1 vcfpl VRR_VV0UUU " " arch13 zarch ++e700000020c1 vcelfb VRR_VV0UU " " arch13 zarch ++e700000820c1 wcelfb VRR_VV0UU8 " " arch13 zarch ++ ++e700000000c2 vcsfp VRR_VV0UUU " " arch13 zarch ++e700000020c2 vcfeb VRR_VV0UU " " arch13 zarch ++e700000820c2 wcfeb VRR_VV0UU8 " " arch13 zarch ++ ++e700000000c0 vclfp VRR_VV0UUU " " arch13 zarch ++e700000020c0 vclfeb VRR_VV0UU " " arch13 zarch ++e700000820c0 wclfeb VRR_VV0UU8 " " arch13 zarch ++ ++b939 dfltcc RRF_R0RR2 " " arch13 zarch ++ ++b938 sortl RRE_RR " " arch13 zarch ++ ++e60000000050 vcvb VRR_RV0UU " " arch13 zarch optparm ++e60000000052 vcvbg VRR_RV0UU " " arch13 zarch optparm ++ ++b93a kdsa RRE_RR " " arch13 zarch +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/gas/testsuite/gas/s390/zarch-arch13.s 2019-03-07 13:23:07.799582976 +0000 +@@ -0,0 +1,150 @@ ++.text ++foo: ++ ncrk %r6,%r9,%r11 ++ ncgrk %r6,%r9,%r11 ++ mvcrl 4000(%r6),4000(%r9) ++ nnrk %r6,%r9,%r11 ++ nngrk %r6,%r9,%r11 ++ nork %r6,%r9,%r11 ++ nogrk %r6,%r9,%r11 ++ nxrk %r6,%r9,%r11 ++ nxgrk %r6,%r9,%r11 ++ ocrk %r6,%r9,%r11 ++ ocgrk %r6,%r9,%r11 ++ popcnt %r6,%r9 ++ popcnt %r6,%r9,13 ++ selr %r6,%r9,%r11,13 ++ selro %r6,%r9,%r11 ++ selrh %r6,%r9,%r11 ++ selrp %r6,%r9,%r11 ++ selrnle %r6,%r9,%r11 ++ selrl %r6,%r9,%r11 ++ selrm %r6,%r9,%r11 ++ selrnhe %r6,%r9,%r11 ++ selrlh %r6,%r9,%r11 ++ selrne %r6,%r9,%r11 ++ selrnz %r6,%r9,%r11 ++ selre %r6,%r9,%r11 ++ selrz %r6,%r9,%r11 ++ selrnlh %r6,%r9,%r11 ++ selrhe %r6,%r9,%r11 ++ selrnl %r6,%r9,%r11 ++ selrnm %r6,%r9,%r11 ++ selrle %r6,%r9,%r11 ++ selrnh %r6,%r9,%r11 ++ selrnp %r6,%r9,%r11 ++ selrno %r6,%r9,%r11 ++ selgr %r6,%r9,%r11,13 ++ selgro %r6,%r9,%r11 ++ selgrh %r6,%r9,%r11 ++ selgrp %r6,%r9,%r11 ++ selgrnle %r6,%r9,%r11 ++ selgrl %r6,%r9,%r11 ++ selgrm %r6,%r9,%r11 ++ selgrnhe %r6,%r9,%r11 ++ selgrlh %r6,%r9,%r11 ++ selgrne %r6,%r9,%r11 ++ selgrnz %r6,%r9,%r11 ++ selgre %r6,%r9,%r11 ++ selgrz %r6,%r9,%r11 ++ selgrnlh %r6,%r9,%r11 ++ selgrhe %r6,%r9,%r11 ++ selgrnl %r6,%r9,%r11 ++ selgrnm %r6,%r9,%r11 ++ selgrle %r6,%r9,%r11 ++ selgrnh %r6,%r9,%r11 ++ selgrnp %r6,%r9,%r11 ++ selgrno %r6,%r9,%r11 ++ selhhhr %r6,%r9,%r11,13 ++ selhhhro %r6,%r9,%r11 ++ selhhhrh %r6,%r9,%r11 ++ selhhhrp %r6,%r9,%r11 ++ selhhhrnle %r6,%r9,%r11 ++ selhhhrl %r6,%r9,%r11 ++ selhhhrm %r6,%r9,%r11 ++ selhhhrnhe %r6,%r9,%r11 ++ selhhhrlh %r6,%r9,%r11 ++ selhhhrne %r6,%r9,%r11 ++ selhhhrnz %r6,%r9,%r11 ++ selhhhre %r6,%r9,%r11 ++ selhhhrz %r6,%r9,%r11 ++ selhhhrnlh %r6,%r9,%r11 ++ selhhhrhe %r6,%r9,%r11 ++ selhhhrnl %r6,%r9,%r11 ++ selhhhrnm %r6,%r9,%r11 ++ selhhhrle %r6,%r9,%r11 ++ selhhhrnh %r6,%r9,%r11 ++ selhhhrnp %r6,%r9,%r11 ++ selhhhrno %r6,%r9,%r11 ++ vlbr %v15,4000(%r6,%r9),13 ++ vlbrh %v15,4000(%r6,%r9) ++ vlbrf %v15,4000(%r6,%r9) ++ vlbrg %v15,4000(%r6,%r9) ++ vlbrq %v15,4000(%r6,%r9) ++ vler %v15,4000(%r6,%r9),13 ++ vlerh %v15,4000(%r6,%r9) ++ vlerf %v15,4000(%r6,%r9) ++ vlerg %v15,4000(%r6,%r9) ++ vllebrz %v15,4000(%r6,%r9),13 ++ vllebrzh %v15,4000(%r6,%r9) ++ vllebrzf %v15,4000(%r6,%r9) ++ ldrv %v15,4000(%r6,%r9) ++ vllebrzg %v15,4000(%r6,%r9) ++ lerv %v15,4000(%r6,%r9) ++ vllebrze %v15,4000(%r6,%r9) ++ vlebrh %v15,4000(%r6,%r9),13 ++ vlebrf %v15,4000(%r6,%r9),13 ++ vlebrg %v15,4000(%r6,%r9),13 ++ vlbrrep %v15,4000(%r6,%r9),13 ++ vlbrreph %v15,4000(%r6,%r9) ++ vlbrrepf %v15,4000(%r6,%r9) ++ vlbrrepg %v15,4000(%r6,%r9) ++ vstbr %v15,4000(%r6,%r9),13 ++ vstbrh %v15,4000(%r6,%r9) ++ vstbrf %v15,4000(%r6,%r9) ++ vstbrg %v15,4000(%r6,%r9) ++ vstbrq %v15,4000(%r6,%r9) ++ vster %v15,4000(%r6,%r9),13 ++ vsterh %v15,4000(%r6,%r9) ++ vsterf %v15,4000(%r6,%r9) ++ vsterg %v15,4000(%r6,%r9) ++ vstebrh %v15,4000(%r6,%r9),13 ++ vstebrf %v15,4000(%r6,%r9),13 ++ sterv %v15,4000(%r6,%r9) ++ vstebrg %v15,4000(%r6,%r9),13 ++ stdrv %v15,4000(%r6,%r9) ++ vsld %v15,%v17,%v20,253 ++ vsrd %v15,%v17,%v20,253 ++ vstrs %v15,%v17,%v20,%v24,13 ++ vstrs %v15,%v17,%v20,%v24,13,12 ++ vstrsb %v15,%v17,%v20,%v24 ++ vstrsb %v15,%v17,%v20,%v24,13 ++ vstrsh %v15,%v17,%v20,%v24 ++ vstrsh %v15,%v17,%v20,%v24,13 ++ vstrsf %v15,%v17,%v20,%v24 ++ vstrsf %v15,%v17,%v20,%v24,13 ++ vstrszb %v15,%v17,%v20,%v24 ++ vstrszb %v15,%v17,%v20,%v24,13 ++ vstrszh %v15,%v17,%v20,%v24 ++ vstrszh %v15,%v17,%v20,%v24,13 ++ vstrszf %v15,%v17,%v20,%v24 ++ vstrszf %v15,%v17,%v20,%v24,13 ++ vcfps %v15,%v17,13,12,11 ++ vcefb %v15,%v17,13,12 ++ wcefb %v15,%v17,13,12 ++ vcfpl %v15,%v17,13,12,11 ++ vcelfb %v15,%v17,13,12 ++ wcelfb %v15,%v17,13,12 ++ vcsfp %v15,%v17,13,12,11 ++ vcfeb %v15,%v17,13,12 ++ wcfeb %v15,%v17,13,12 ++ vclfp %v15,%v17,13,12,11 ++ vclfeb %v15,%v17,13,12 ++ wclfeb %v15,%v17,13,12 ++ dfltcc %r6,%r9,%r11 ++ sortl %r6,%r9 ++ vcvb %r6,%v15,13 ++ vcvb %r6,%v15,13,12 ++ vcvbg %r6,%v15,13 ++ vcvbg %r6,%v15,13,12 ++ kdsa %r6,%r9 +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/gas/testsuite/gas/s390/zarch-arch13.d 2019-03-07 13:23:07.799582976 +0000 +@@ -0,0 +1,156 @@ ++#name: s390x opcode ++#objdump: -dr ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++.* : ++.*: b9 f5 b0 69 [ ]*ncrk %r6,%r9,%r11 ++.*: b9 e5 b0 69 [ ]*ncgrk %r6,%r9,%r11 ++.*: e5 0a 6f a0 9f a0 [ ]*mvcrl 4000\(%r6\),4000\(%r9\) ++.*: b9 74 b0 69 [ ]*nnrk %r6,%r9,%r11 ++.*: b9 64 b0 69 [ ]*nngrk %r6,%r9,%r11 ++.*: b9 76 b0 69 [ ]*nork %r6,%r9,%r11 ++.*: b9 66 b0 69 [ ]*nogrk %r6,%r9,%r11 ++.*: b9 77 b0 69 [ ]*nxrk %r6,%r9,%r11 ++.*: b9 67 b0 69 [ ]*nxgrk %r6,%r9,%r11 ++.*: b9 75 b0 69 [ ]*ocrk %r6,%r9,%r11 ++.*: b9 65 b0 69 [ ]*ocgrk %r6,%r9,%r11 ++.*: b9 e1 00 69 [ ]*popcnt %r6,%r9 ++.*: b9 e1 d0 69 [ ]*popcnt %r6,%r9,13 ++.*: b9 f0 bd 69 [ ]*selrnh %r6,%r9,%r11 ++.*: b9 f0 b1 69 [ ]*selro %r6,%r9,%r11 ++.*: b9 f0 b2 69 [ ]*selrh %r6,%r9,%r11 ++.*: b9 f0 b2 69 [ ]*selrh %r6,%r9,%r11 ++.*: b9 f0 b3 69 [ ]*selrnle %r6,%r9,%r11 ++.*: b9 f0 b4 69 [ ]*selrl %r6,%r9,%r11 ++.*: b9 f0 b4 69 [ ]*selrl %r6,%r9,%r11 ++.*: b9 f0 b5 69 [ ]*selrnhe %r6,%r9,%r11 ++.*: b9 f0 b6 69 [ ]*selrlh %r6,%r9,%r11 ++.*: b9 f0 b7 69 [ ]*selrne %r6,%r9,%r11 ++.*: b9 f0 b7 69 [ ]*selrne %r6,%r9,%r11 ++.*: b9 f0 b8 69 [ ]*selre %r6,%r9,%r11 ++.*: b9 f0 b8 69 [ ]*selre %r6,%r9,%r11 ++.*: b9 f0 b9 69 [ ]*selrnlh %r6,%r9,%r11 ++.*: b9 f0 ba 69 [ ]*selrhe %r6,%r9,%r11 ++.*: b9 f0 bb 69 [ ]*selrnl %r6,%r9,%r11 ++.*: b9 f0 bb 69 [ ]*selrnl %r6,%r9,%r11 ++.*: b9 f0 bc 69 [ ]*selrle %r6,%r9,%r11 ++.*: b9 f0 bd 69 [ ]*selrnh %r6,%r9,%r11 ++.*: b9 f0 bd 69 [ ]*selrnh %r6,%r9,%r11 ++.*: b9 f0 be 69 [ ]*selrno %r6,%r9,%r11 ++.*: b9 e3 bd 69 [ ]*selgrnh %r6,%r9,%r11 ++.*: b9 e3 b1 69 [ ]*selgro %r6,%r9,%r11 ++.*: b9 e3 b2 69 [ ]*selgrh %r6,%r9,%r11 ++.*: b9 e3 b2 69 [ ]*selgrh %r6,%r9,%r11 ++.*: b9 e3 b3 69 [ ]*selgrnle %r6,%r9,%r11 ++.*: b9 e3 b4 69 [ ]*selgrl %r6,%r9,%r11 ++.*: b9 e3 b4 69 [ ]*selgrl %r6,%r9,%r11 ++.*: b9 e3 b5 69 [ ]*selgrnhe %r6,%r9,%r11 ++.*: b9 e3 b6 69 [ ]*selgrlh %r6,%r9,%r11 ++.*: b9 e3 b7 69 [ ]*selgrne %r6,%r9,%r11 ++.*: b9 e3 b7 69 [ ]*selgrne %r6,%r9,%r11 ++.*: b9 e3 b8 69 [ ]*selgre %r6,%r9,%r11 ++.*: b9 e3 b8 69 [ ]*selgre %r6,%r9,%r11 ++.*: b9 e3 b9 69 [ ]*selgrnlh %r6,%r9,%r11 ++.*: b9 e3 ba 69 [ ]*selgrhe %r6,%r9,%r11 ++.*: b9 e3 bb 69 [ ]*selgrnl %r6,%r9,%r11 ++.*: b9 e3 bb 69 [ ]*selgrnl %r6,%r9,%r11 ++.*: b9 e3 bc 69 [ ]*selgrle %r6,%r9,%r11 ++.*: b9 e3 bd 69 [ ]*selgrnh %r6,%r9,%r11 ++.*: b9 e3 bd 69 [ ]*selgrnh %r6,%r9,%r11 ++.*: b9 e3 be 69 [ ]*selgrno %r6,%r9,%r11 ++.*: b9 c0 bd 69 [ ]*selhhhrnh %r6,%r9,%r11 ++.*: b9 c0 b1 69 [ ]*selhhhro %r6,%r9,%r11 ++.*: b9 c0 b2 69 [ ]*selhhhrh %r6,%r9,%r11 ++.*: b9 c0 b2 69 [ ]*selhhhrh %r6,%r9,%r11 ++.*: b9 c0 b3 69 [ ]*selhhhrnle %r6,%r9,%r11 ++.*: b9 c0 b4 69 [ ]*selhhhrl %r6,%r9,%r11 ++.*: b9 c0 b4 69 [ ]*selhhhrl %r6,%r9,%r11 ++.*: b9 c0 b5 69 [ ]*selhhhrnhe %r6,%r9,%r11 ++.*: b9 c0 b6 69 [ ]*selhhhrlh %r6,%r9,%r11 ++.*: b9 c0 b7 69 [ ]*selhhhrne %r6,%r9,%r11 ++.*: b9 c0 b7 69 [ ]*selhhhrne %r6,%r9,%r11 ++.*: b9 c0 b8 69 [ ]*selhhhre %r6,%r9,%r11 ++.*: b9 c0 b8 69 [ ]*selhhhre %r6,%r9,%r11 ++.*: b9 c0 b9 69 [ ]*selhhhrnlh %r6,%r9,%r11 ++.*: b9 c0 ba 69 [ ]*selhhhrhe %r6,%r9,%r11 ++.*: b9 c0 bb 69 [ ]*selhhhrnl %r6,%r9,%r11 ++.*: b9 c0 bb 69 [ ]*selhhhrnl %r6,%r9,%r11 ++.*: b9 c0 bc 69 [ ]*selhhhrle %r6,%r9,%r11 ++.*: b9 c0 bd 69 [ ]*selhhhrnh %r6,%r9,%r11 ++.*: b9 c0 bd 69 [ ]*selhhhrnh %r6,%r9,%r11 ++.*: b9 c0 be 69 [ ]*selhhhrno %r6,%r9,%r11 ++.*: e6 f6 9f a0 d0 06 [ ]*vlbr %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 10 06 [ ]*vlbrh %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 20 06 [ ]*vlbrf %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 30 06 [ ]*vlbrg %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 40 06 [ ]*vlbrq %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 d0 07 [ ]*vler %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 10 07 [ ]*vlerh %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 20 07 [ ]*vlerf %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 30 07 [ ]*vlerg %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 d0 04 [ ]*vllebrz %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 10 04 [ ]*vllebrzh %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 20 04 [ ]*vllebrzf %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 30 04 [ ]*ldrv %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 30 04 [ ]*ldrv %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 60 04 [ ]*lerv %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 60 04 [ ]*lerv %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 d0 01 [ ]*vlebrh %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 d0 03 [ ]*vlebrf %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 d0 02 [ ]*vlebrg %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 d0 05 [ ]*vlbrrep %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 10 05 [ ]*vlbrreph %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 20 05 [ ]*vlbrrepf %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 30 05 [ ]*vlbrrepg %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 d0 0e [ ]*vstbr %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 10 0e [ ]*vstbrh %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 20 0e [ ]*vstbrf %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 30 0e [ ]*vstbrg %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 40 0e [ ]*vstbrq %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 d0 0f [ ]*vster %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 10 0f [ ]*vsterh %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 20 0f [ ]*vsterf %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 30 0f [ ]*vsterg %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 d0 09 [ ]*vstebrh %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 d0 0b [ ]*vstebrf %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 00 0b [ ]*sterv %v15,4000\(%r6,%r9\) ++.*: e6 f6 9f a0 d0 0a [ ]*vstebrg %v15,4000\(%r6,%r9\),13 ++.*: e6 f6 9f a0 00 0a [ ]*stdrv %v15,4000\(%r6,%r9\) ++.*: e7 f1 40 fd 06 86 [ ]*vsld %v15,%v17,%v20,253 ++.*: e7 f1 40 fd 06 87 [ ]*vsrd %v15,%v17,%v20,253 ++.*: e7 f1 4d 00 87 8b [ ]*vstrs %v15,%v17,%v20,%v24,13 ++.*: e7 f1 4d c0 87 8b [ ]*vstrs %v15,%v17,%v20,%v24,13,12 ++.*: e7 f1 40 00 87 8b [ ]*vstrsb %v15,%v17,%v20,%v24 ++.*: e7 f1 40 d0 87 8b [ ]*vstrsb %v15,%v17,%v20,%v24,13 ++.*: e7 f1 41 00 87 8b [ ]*vstrsh %v15,%v17,%v20,%v24 ++.*: e7 f1 41 d0 87 8b [ ]*vstrsh %v15,%v17,%v20,%v24,13 ++.*: e7 f1 42 00 87 8b [ ]*vstrsf %v15,%v17,%v20,%v24 ++.*: e7 f1 42 d0 87 8b [ ]*vstrsf %v15,%v17,%v20,%v24,13 ++.*: e7 f1 40 20 87 8b [ ]*vstrszb %v15,%v17,%v20,%v24 ++.*: e7 f1 40 f0 87 8b [ ]*vstrszb %v15,%v17,%v20,%v24,13 ++.*: e7 f1 41 20 87 8b [ ]*vstrszh %v15,%v17,%v20,%v24 ++.*: e7 f1 41 f0 87 8b [ ]*vstrszh %v15,%v17,%v20,%v24,13 ++.*: e7 f1 42 20 87 8b [ ]*vstrszf %v15,%v17,%v20,%v24 ++.*: e7 f1 42 f0 87 8b [ ]*vstrszf %v15,%v17,%v20,%v24,13 ++.*: e7 f1 00 bc d4 c3 [ ]*vcfps %v15,%v17,13,12,11 ++.*: e7 f1 00 cd 24 c3 [ ]*wcefb %v15,%v17,5,12 ++.*: e7 f1 00 cd 24 c3 [ ]*wcefb %v15,%v17,5,12 ++.*: e7 f1 00 bc d4 c1 [ ]*vcfpl %v15,%v17,13,12,11 ++.*: e7 f1 00 cd 24 c1 [ ]*wcelfb %v15,%v17,5,12 ++.*: e7 f1 00 cd 24 c1 [ ]*wcelfb %v15,%v17,5,12 ++.*: e7 f1 00 bc d4 c2 [ ]*vcsfp %v15,%v17,13,12,11 ++.*: e7 f1 00 cd 24 c2 [ ]*wcfeb %v15,%v17,5,12 ++.*: e7 f1 00 cd 24 c2 [ ]*wcfeb %v15,%v17,5,12 ++.*: e7 f1 00 bc d4 c0 [ ]*vclfp %v15,%v17,13,12,11 ++.*: e7 f1 00 cd 24 c0 [ ]*wclfeb %v15,%v17,5,12 ++.*: e7 f1 00 cd 24 c0 [ ]*wclfeb %v15,%v17,5,12 ++.*: b9 39 b0 69 [ ]*dfltcc %r6,%r9,%r11 ++.*: b9 38 00 69 [ ]*sortl %r6,%r9 ++.*: e6 6f 00 d0 00 50 [ ]*vcvb %r6,%v15,13 ++.*: e6 6f 00 dc 00 50 [ ]*vcvb %r6,%v15,13,12 ++.*: e6 6f 00 d0 00 52 [ ]*vcvbg %r6,%v15,13 ++.*: e6 6f 00 dc 00 52 [ ]*vcvbg %r6,%v15,13,12 ++.*: b9 3a 00 69 [ ]*kdsa %r6,%r9 +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/gas/testsuite/gas/s390/zarch-optargs.s 2019-03-07 13:24:31.563932472 +0000 +@@ -0,0 +1,6 @@ ++.text ++foo: ++ vst %v0,16 ++ vst %v0,16,3 ++ vst %v0,16(%r2) ++ vst %v0,16(%r2),3 +--- /dev/null 2019-03-07 09:27:55.425999321 +0000 ++++ binutils-2.30/gas/testsuite/gas/s390/zarch-optargs.d 2019-03-07 13:24:31.563932472 +0000 +@@ -0,0 +1,12 @@ ++#name: s390x optargs ++#objdump: -dr ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++.* : ++.*: e7 00 00 10 00 0e [ ]*vst %v0,16 ++.*: e7 00 00 10 30 0e [ ]*vst %v0,16,3 ++.*: e7 00 20 10 00 0e [ ]*vst %v0,16\(%r2\) ++.*: e7 00 20 10 30 0e [ ]*vst %v0,16\(%r2\),3 +--- binutils.orig/opcodes/s390-opc.txt 2019-03-13 13:04:45.457121525 +0000 ++++ binutils-2.30/opcodes/s390-opc.txt 2019-03-13 13:08:20.009362157 +0000 +@@ -1889,106 +1889,120 @@ e70000000036 vlm VRS_VVRDU "vector load + e7000000000e vst VRX_VRRDU "vector store" arch12 zarch optparm + e7000000003e vstm VRS_VVRDU "vector store multiple" arch12 zarch optparm + ++ + # arch13 instructions + +-b9f5 ncrk RRF_R0RR2 " " arch13 zarch +-b9e5 ncgrk RRF_R0RR2 " " arch13 zarch +-e50a mvcrl SSE_RDRD " " arch13 zarch +-b974 nnrk RRF_R0RR2 " " arch13 zarch +-b964 nngrk RRF_R0RR2 " " arch13 zarch +-b976 nork RRF_R0RR2 " " arch13 zarch +-b966 nogrk RRF_R0RR2 " " arch13 zarch +-b977 nxrk RRF_R0RR2 " " arch13 zarch +-b967 nxgrk RRF_R0RR2 " " arch13 zarch +-b975 ocrk RRF_R0RR2 " " arch13 zarch +-b965 ocgrk RRF_R0RR2 " " arch13 zarch +-b9e1 popcnt RRF_U0RR " " arch13 zarch optparm +-b9f0 selr RRF_RURR " " arch13 zarch +-b9f00000 selr*20 RRF_R0RR3 " " arch13 zarch +-b9e3 selgr RRF_RURR " " arch13 zarch +-b9e30000 selgr*20 RRF_R0RR3 " " arch13 zarch +-b9c0 selhhhr RRF_RURR " " arch13 zarch +-b9c00000 selhhhr*20 RRF_R0RR3 " " arch13 zarch +- +-e60000000006 vlbr VRX_VRRDU " " arch13 zarch +-e60000001006 vlbrh VRX_VRRD " " arch13 zarch +-e60000002006 vlbrf VRX_VRRD " " arch13 zarch +-e60000003006 vlbrg VRX_VRRD " " arch13 zarch +-e60000004006 vlbrq VRX_VRRD " " arch13 zarch +- +-e60000000007 vler VRX_VRRDU " " arch13 zarch +-e60000001007 vlerh VRX_VRRD " " arch13 zarch +-e60000002007 vlerf VRX_VRRD " " arch13 zarch +-e60000003007 vlerg VRX_VRRD " " arch13 zarch +- +-e60000000004 vllebrz VRX_VRRDU " " arch13 zarch +-e60000001004 vllebrzh VRX_VRRD " " arch13 zarch +-e60000002004 vllebrzf VRX_VRRD " " arch13 zarch +-e60000003004 ldrv VRX_VRRD " " arch13 zarch +-e60000003004 vllebrzg VRX_VRRD " " arch13 zarch +-e60000006004 lerv VRX_VRRD " " arch13 zarch +-e60000006004 vllebrze VRX_VRRD " " arch13 zarch +- +-e60000000001 vlebrh VRX_VRRDU " " arch13 zarch +-e60000000003 vlebrf VRX_VRRDU " " arch13 zarch +-e60000000002 vlebrg VRX_VRRDU " " arch13 zarch +- +-e60000000005 vlbrrep VRX_VRRDU " " arch13 zarch +-e60000001005 vlbrreph VRX_VRRD " " arch13 zarch +-e60000002005 vlbrrepf VRX_VRRD " " arch13 zarch +-e60000003005 vlbrrepg VRX_VRRD " " arch13 zarch +- +-e6000000000e vstbr VRX_VRRDU " " arch13 zarch +-e6000000100e vstbrh VRX_VRRD " " arch13 zarch +-e6000000200e vstbrf VRX_VRRD " " arch13 zarch +-e6000000300e vstbrg VRX_VRRD " " arch13 zarch +-e6000000400e vstbrq VRX_VRRD " " arch13 zarch +- +-e6000000000f vster VRX_VRRDU " " arch13 zarch +-e6000000100f vsterh VRX_VRRD " " arch13 zarch +-e6000000200f vsterf VRX_VRRD " " arch13 zarch +-e6000000300f vsterg VRX_VRRD " " arch13 zarch +- +-e60000000009 vstebrh VRX_VRRDU " " arch13 zarch +-e6000000000b vstebrf VRX_VRRDU " " arch13 zarch +-e6000000000b sterv VRX_VRRD " " arch13 zarch +-e6000000000a vstebrg VRX_VRRDU " " arch13 zarch +-e6000000000a stdrv VRX_VRRD " " arch13 zarch +- +-e70000000086 vsld VRI_VVV0U " " arch13 zarch +-e70000000087 vsrd VRI_VVV0U " " arch13 zarch +- +-e7000000008b vstrs VRR_VVVUU0V " " arch13 zarch optparm +- +-e7000000008b vstrsb VRR_VVVU0VB " " arch13 zarch optparm +-e7000100008b vstrsh VRR_VVVU0VB " " arch13 zarch optparm +-e7000200008b vstrsf VRR_VVVU0VB " " arch13 zarch optparm +- +-e7000020008b vstrszb VRR_VVVU0VB2 " " arch13 zarch optparm +-e7000120008b vstrszh VRR_VVVU0VB2 " " arch13 zarch optparm +-e7000220008b vstrszf VRR_VVVU0VB2 " " arch13 zarch optparm +- +-e700000000c3 vcfps VRR_VV0UUU " " arch13 zarch +-e700000020c3 vcefb VRR_VV0UU " " arch13 zarch +-e700000820c3 wcefb VRR_VV0UU8 " " arch13 zarch +- +-e700000000c1 vcfpl VRR_VV0UUU " " arch13 zarch +-e700000020c1 vcelfb VRR_VV0UU " " arch13 zarch +-e700000820c1 wcelfb VRR_VV0UU8 " " arch13 zarch +- +-e700000000c2 vcsfp VRR_VV0UUU " " arch13 zarch +-e700000020c2 vcfeb VRR_VV0UU " " arch13 zarch +-e700000820c2 wcfeb VRR_VV0UU8 " " arch13 zarch +- +-e700000000c0 vclfp VRR_VV0UUU " " arch13 zarch +-e700000020c0 vclfeb VRR_VV0UU " " arch13 zarch +-e700000820c0 wclfeb VRR_VV0UU8 " " arch13 zarch + +-b939 dfltcc RRF_R0RR2 " " arch13 zarch ++# Miscellaneous Instruction Extensions Facility 2 ++ ++b9f5 ncrk RRF_R0RR2 "and with complement 32 bit" arch13 zarch ++b9e5 ncgrk RRF_R0RR2 "and with complement 64 bit" arch13 zarch ++e50a mvcrl SSE_RDRD "move right to left" arch13 zarch ++b974 nnrk RRF_R0RR2 "nand 32 bit" arch13 zarch ++b964 nngrk RRF_R0RR2 "nand 64 bit" arch13 zarch ++b976 nork RRF_R0RR2 "nor 32 bit" arch13 zarch ++b966 nogrk RRF_R0RR2 "nor 64 bit" arch13 zarch ++b977 nxrk RRF_R0RR2 "not exclusive or 32 bit" arch13 zarch ++b967 nxgrk RRF_R0RR2 "not exclusive or 64 bit" arch13 zarch ++b975 ocrk RRF_R0RR2 "or with complement 32 bit" arch13 zarch ++b965 ocgrk RRF_R0RR2 "or with complement 64 bit" arch13 zarch ++b9e1 popcnt RRF_U0RR "population count arch13" arch13 zarch optparm ++b9f0 selr RRF_RURR "select 32 bit" arch13 zarch ++b9f00000 selr*20 RRF_R0RR3 "select 32 bit" arch13 zarch ++b9e3 selgr RRF_RURR "select 64 bit" arch13 zarch ++b9e30000 selgr*20 RRF_R0RR3 "select 64 bit" arch13 zarch ++b9c0 selfhr RRF_RURR "select high" arch13 zarch ++b9c00000 selfhr*20 RRF_R0RR3 "select high" arch13 zarch ++ ++# Vector Enhancements Facility 2 ++ ++e60000000006 vlbr VRX_VRRDU "vector load byte reversed elements" arch13 zarch ++e60000001006 vlbrh VRX_VRRD "vector load byte reversed halfword elements" arch13 zarch ++e60000002006 vlbrf VRX_VRRD "vector load byte reversed word elements" arch13 zarch ++e60000003006 vlbrg VRX_VRRD "vector load byte reversed doubleword elements" arch13 zarch ++e60000004006 vlbrq VRX_VRRD "vector load byte reversed quadword elements" arch13 zarch ++ ++e60000000007 vler VRX_VRRDU "vector load elements reversed" arch13 zarch ++e60000001007 vlerh VRX_VRRD "vector load halfword elements reversed" arch13 zarch ++e60000002007 vlerf VRX_VRRD "vector load word elements reversed" arch13 zarch ++e60000003007 vlerg VRX_VRRD "vector load doubleword elements reversed" arch13 zarch ++ ++e60000000004 vllebrz VRX_VRRDU "vector load byte reversed element and zero" arch13 zarch ++e60000001004 vllebrzh VRX_VRRD "vector load byte reversed halfword element and zero" arch13 zarch ++e60000002004 vllebrzf VRX_VRRD "vector load byte reversed word element and zero" arch13 zarch ++e60000003004 ldrv VRX_VRRD "load byte reversed doubleword" arch13 zarch ++e60000003004 vllebrzg VRX_VRRD "vector load byte reversed doubleword element and zero" arch13 zarch ++e60000006004 lerv VRX_VRRD "load byte reversed word" arch13 zarch ++e60000006004 vllebrze VRX_VRRD "vector load byte reversed word element left-aligned and zero" arch13 zarch ++ ++e60000000001 vlebrh VRX_VRRDU "vector load byte reversed halfword element" arch13 zarch ++e60000000003 vlebrf VRX_VRRDU "vector load byte reversed word element" arch13 zarch ++e60000000002 vlebrg VRX_VRRDU "vector load byte reversed doubleword element" arch13 zarch ++ ++e60000000005 vlbrrep VRX_VRRDU "vector load byte reversed element and replicate" arch13 zarch ++e60000001005 vlbrreph VRX_VRRD "vector load byte reversed halfword element and replicate" arch13 zarch ++e60000002005 vlbrrepf VRX_VRRD "vector load byte reversed word element and replicate" arch13 zarch ++e60000003005 vlbrrepg VRX_VRRD "vector load byte reversed doubleword element and replicate" arch13 zarch ++ ++e6000000000e vstbr VRX_VRRDU "vector store byte reversed elements" arch13 zarch ++e6000000100e vstbrh VRX_VRRD "vector store byte reversed halfword elements" arch13 zarch ++e6000000200e vstbrf VRX_VRRD "vector store byte reversed word elements" arch13 zarch ++e6000000300e vstbrg VRX_VRRD "vector store byte reversed doubleword elements" arch13 zarch ++e6000000400e vstbrq VRX_VRRD "vector store byte reversed quadword elements" arch13 zarch ++ ++e6000000000f vster VRX_VRRDU "vector store elements reversed" arch13 zarch ++e6000000100f vsterh VRX_VRRD "vector store halfword elements reversed" arch13 zarch ++e6000000200f vsterf VRX_VRRD "vector store word elements reversed" arch13 zarch ++e6000000300f vsterg VRX_VRRD "vector store doubleword elements reversed" arch13 zarch ++ ++e60000000009 vstebrh VRX_VRRDU "vector store byte reversed halfword element" arch13 zarch ++e6000000000b vstebrf VRX_VRRDU "vector store byte reversed word element" arch13 zarch ++e6000000000b sterv VRX_VRRD "store byte reversed word" arch13 zarch ++e6000000000a vstebrg VRX_VRRDU "vector store byte reversed doubleword element" arch13 zarch ++e6000000000a stdrv VRX_VRRD "store byte reversed doubleword" arch13 zarch ++ ++e70000000086 vsld VRI_VVV0U "vector shift left double by bit" arch13 zarch ++e70000000087 vsrd VRI_VVV0U "vector shift right double by bit" arch13 zarch ++ ++e7000000008b vstrs VRR_VVVUU0V "vector string search" arch13 zarch optparm ++ ++e7000000008b vstrsb VRR_VVVU0VB "vector string search byte" arch13 zarch optparm ++e7000100008b vstrsh VRR_VVVU0VB "vector string search halfword" arch13 zarch optparm ++e7000200008b vstrsf VRR_VVVU0VB "vector string search word" arch13 zarch optparm ++ ++e7000020008b vstrszb VRR_VVV0V "vector string search byte zero" arch13 zarch ++e7000120008b vstrszh VRR_VVV0V "vector string search halfword zero" arch13 zarch ++e7000220008b vstrszf VRR_VVV0V "vector string search word zero" arch13 zarch ++ ++e700000000c3 vcfps VRR_VV0UUU "vector fp convert from fixed" arch13 zarch ++e700000020c3 vcefb VRR_VV0UU "vector fp convert from fixed 32 bit" arch13 zarch ++e700000820c3 wcefb VRR_VV0UU8 "vector fp convert from fixed 32 bit" arch13 zarch ++ ++e700000000c1 vcfpl VRR_VV0UUU "vector fp convert from logical" arch13 zarch ++e700000020c1 vcelfb VRR_VV0UU "vector fp convert from logical 32 bit" arch13 zarch ++e700000820c1 wcelfb VRR_VV0UU8 "vector fp convert from logical 32 bit" arch13 zarch ++ ++e700000000c2 vcsfp VRR_VV0UUU "vector fp convert to fixed" arch13 zarch ++e700000020c2 vcfeb VRR_VV0UU "vector fp convert to fixed 32 bit" arch13 zarch ++e700000820c2 wcfeb VRR_VV0UU8 "vector fp convert to fixed 32 bit" arch13 zarch ++ ++e700000000c0 vclfp VRR_VV0UUU "vector fp convert to logical" arch13 zarch ++e700000020c0 vclfeb VRR_VV0UU "vector fp convert to logical 32 bit" arch13 zarch ++e700000820c0 wclfeb VRR_VV0UU8 "vector fp convert to logical 32 bit" arch13 zarch ++ ++# Deflate conversion facility ++ ++b939 dfltcc RRF_R0RR2 "deflate conversion call" arch13 zarch ++ ++# Enhanced-Sort Facility ++ ++b938 sortl RRE_RR "sort lists" arch13 zarch ++ ++# Vector packed decimal enhancement facility + +-b938 sortl RRE_RR " " arch13 zarch ++e60000000050 vcvb VRR_RV0UU "vector convert to binary 32 bit" arch13 zarch optparm ++e60000000052 vcvbg VRR_RV0UU "vector convert to binary 64 bit" arch13 zarch optparm + +-e60000000050 vcvb VRR_RV0UU " " arch13 zarch optparm +-e60000000052 vcvbg VRR_RV0UU " " arch13 zarch optparm ++# Message Security Assist Extension 9 + +-b93a kdsa RRE_RR " " arch13 zarch ++b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-arch13.d binutils-2.30/gas/testsuite/gas/s390/zarch-arch13.d +--- binutils.orig/gas/testsuite/gas/s390/zarch-arch13.d 2019-05-21 10:55:42.538069199 +0100 ++++ binutils-2.30/gas/testsuite/gas/s390/zarch-arch13.d 2019-05-21 11:15:28.157369631 +0100 +@@ -61,27 +61,27 @@ Disassembly of section .text: + .*: b9 e3 bd 69 [ ]*selgrnh %r6,%r9,%r11 + .*: b9 e3 bd 69 [ ]*selgrnh %r6,%r9,%r11 + .*: b9 e3 be 69 [ ]*selgrno %r6,%r9,%r11 +-.*: b9 c0 bd 69 [ ]*selhhhrnh %r6,%r9,%r11 +-.*: b9 c0 b1 69 [ ]*selhhhro %r6,%r9,%r11 +-.*: b9 c0 b2 69 [ ]*selhhhrh %r6,%r9,%r11 +-.*: b9 c0 b2 69 [ ]*selhhhrh %r6,%r9,%r11 +-.*: b9 c0 b3 69 [ ]*selhhhrnle %r6,%r9,%r11 +-.*: b9 c0 b4 69 [ ]*selhhhrl %r6,%r9,%r11 +-.*: b9 c0 b4 69 [ ]*selhhhrl %r6,%r9,%r11 +-.*: b9 c0 b5 69 [ ]*selhhhrnhe %r6,%r9,%r11 +-.*: b9 c0 b6 69 [ ]*selhhhrlh %r6,%r9,%r11 +-.*: b9 c0 b7 69 [ ]*selhhhrne %r6,%r9,%r11 +-.*: b9 c0 b7 69 [ ]*selhhhrne %r6,%r9,%r11 +-.*: b9 c0 b8 69 [ ]*selhhhre %r6,%r9,%r11 +-.*: b9 c0 b8 69 [ ]*selhhhre %r6,%r9,%r11 +-.*: b9 c0 b9 69 [ ]*selhhhrnlh %r6,%r9,%r11 +-.*: b9 c0 ba 69 [ ]*selhhhrhe %r6,%r9,%r11 +-.*: b9 c0 bb 69 [ ]*selhhhrnl %r6,%r9,%r11 +-.*: b9 c0 bb 69 [ ]*selhhhrnl %r6,%r9,%r11 +-.*: b9 c0 bc 69 [ ]*selhhhrle %r6,%r9,%r11 +-.*: b9 c0 bd 69 [ ]*selhhhrnh %r6,%r9,%r11 +-.*: b9 c0 bd 69 [ ]*selhhhrnh %r6,%r9,%r11 +-.*: b9 c0 be 69 [ ]*selhhhrno %r6,%r9,%r11 ++.*: b9 c0 bd 69 [ ]*selfhrnh %r6,%r9,%r11 ++.*: b9 c0 b1 69 [ ]*selfhro %r6,%r9,%r11 ++.*: b9 c0 b2 69 [ ]*selfhrh %r6,%r9,%r11 ++.*: b9 c0 b2 69 [ ]*selfhrh %r6,%r9,%r11 ++.*: b9 c0 b3 69 [ ]*selfhrnle %r6,%r9,%r11 ++.*: b9 c0 b4 69 [ ]*selfhrl %r6,%r9,%r11 ++.*: b9 c0 b4 69 [ ]*selfhrl %r6,%r9,%r11 ++.*: b9 c0 b5 69 [ ]*selfhrnhe %r6,%r9,%r11 ++.*: b9 c0 b6 69 [ ]*selfhrlh %r6,%r9,%r11 ++.*: b9 c0 b7 69 [ ]*selfhrne %r6,%r9,%r11 ++.*: b9 c0 b7 69 [ ]*selfhrne %r6,%r9,%r11 ++.*: b9 c0 b8 69 [ ]*selfhre %r6,%r9,%r11 ++.*: b9 c0 b8 69 [ ]*selfhre %r6,%r9,%r11 ++.*: b9 c0 b9 69 [ ]*selfhrnlh %r6,%r9,%r11 ++.*: b9 c0 ba 69 [ ]*selfhrhe %r6,%r9,%r11 ++.*: b9 c0 bb 69 [ ]*selfhrnl %r6,%r9,%r11 ++.*: b9 c0 bb 69 [ ]*selfhrnl %r6,%r9,%r11 ++.*: b9 c0 bc 69 [ ]*selfhrle %r6,%r9,%r11 ++.*: b9 c0 bd 69 [ ]*selfhrnh %r6,%r9,%r11 ++.*: b9 c0 bd 69 [ ]*selfhrnh %r6,%r9,%r11 ++.*: b9 c0 be 69 [ ]*selfhrno %r6,%r9,%r11 + .*: e6 f6 9f a0 d0 06 [ ]*vlbr %v15,4000\(%r6,%r9\),13 + .*: e6 f6 9f a0 10 06 [ ]*vlbrh %v15,4000\(%r6,%r9\) + .*: e6 f6 9f a0 20 06 [ ]*vlbrf %v15,4000\(%r6,%r9\) +@@ -130,11 +130,8 @@ Disassembly of section .text: + .*: e7 f1 42 00 87 8b [ ]*vstrsf %v15,%v17,%v20,%v24 + .*: e7 f1 42 d0 87 8b [ ]*vstrsf %v15,%v17,%v20,%v24,13 + .*: e7 f1 40 20 87 8b [ ]*vstrszb %v15,%v17,%v20,%v24 +-.*: e7 f1 40 f0 87 8b [ ]*vstrszb %v15,%v17,%v20,%v24,13 + .*: e7 f1 41 20 87 8b [ ]*vstrszh %v15,%v17,%v20,%v24 +-.*: e7 f1 41 f0 87 8b [ ]*vstrszh %v15,%v17,%v20,%v24,13 + .*: e7 f1 42 20 87 8b [ ]*vstrszf %v15,%v17,%v20,%v24 +-.*: e7 f1 42 f0 87 8b [ ]*vstrszf %v15,%v17,%v20,%v24,13 + .*: e7 f1 00 bc d4 c3 [ ]*vcfps %v15,%v17,13,12,11 + .*: e7 f1 00 cd 24 c3 [ ]*wcefb %v15,%v17,5,12 + .*: e7 f1 00 cd 24 c3 [ ]*wcefb %v15,%v17,5,12 +@@ -154,3 +151,4 @@ Disassembly of section .text: + .*: e6 6f 00 d0 00 52 [ ]*vcvbg %r6,%v15,13 + .*: e6 6f 00 dc 00 52 [ ]*vcvbg %r6,%v15,13,12 + .*: b9 3a 00 69 [ ]*kdsa %r6,%r9 ++.*: 07 07 [ ]*nopr %r7 +diff -rup binutils.orig/gas/testsuite/gas/s390/zarch-arch13.s binutils-2.30/gas/testsuite/gas/s390/zarch-arch13.s +--- binutils.orig/gas/testsuite/gas/s390/zarch-arch13.s 2019-05-21 10:55:42.534069229 +0100 ++++ binutils-2.30/gas/testsuite/gas/s390/zarch-arch13.s 2019-05-21 11:14:33.365770952 +0100 +@@ -55,27 +55,27 @@ foo: + selgrnh %r6,%r9,%r11 + selgrnp %r6,%r9,%r11 + selgrno %r6,%r9,%r11 +- selhhhr %r6,%r9,%r11,13 +- selhhhro %r6,%r9,%r11 +- selhhhrh %r6,%r9,%r11 +- selhhhrp %r6,%r9,%r11 +- selhhhrnle %r6,%r9,%r11 +- selhhhrl %r6,%r9,%r11 +- selhhhrm %r6,%r9,%r11 +- selhhhrnhe %r6,%r9,%r11 +- selhhhrlh %r6,%r9,%r11 +- selhhhrne %r6,%r9,%r11 +- selhhhrnz %r6,%r9,%r11 +- selhhhre %r6,%r9,%r11 +- selhhhrz %r6,%r9,%r11 +- selhhhrnlh %r6,%r9,%r11 +- selhhhrhe %r6,%r9,%r11 +- selhhhrnl %r6,%r9,%r11 +- selhhhrnm %r6,%r9,%r11 +- selhhhrle %r6,%r9,%r11 +- selhhhrnh %r6,%r9,%r11 +- selhhhrnp %r6,%r9,%r11 +- selhhhrno %r6,%r9,%r11 ++ selfhr %r6,%r9,%r11,13 ++ selfhro %r6,%r9,%r11 ++ selfhrh %r6,%r9,%r11 ++ selfhrp %r6,%r9,%r11 ++ selfhrnle %r6,%r9,%r11 ++ selfhrl %r6,%r9,%r11 ++ selfhrm %r6,%r9,%r11 ++ selfhrnhe %r6,%r9,%r11 ++ selfhrlh %r6,%r9,%r11 ++ selfhrne %r6,%r9,%r11 ++ selfhrnz %r6,%r9,%r11 ++ selfhre %r6,%r9,%r11 ++ selfhrz %r6,%r9,%r11 ++ selfhrnlh %r6,%r9,%r11 ++ selfhrhe %r6,%r9,%r11 ++ selfhrnl %r6,%r9,%r11 ++ selfhrnm %r6,%r9,%r11 ++ selfhrle %r6,%r9,%r11 ++ selfhrnh %r6,%r9,%r11 ++ selfhrnp %r6,%r9,%r11 ++ selfhrno %r6,%r9,%r11 + vlbr %v15,4000(%r6,%r9),13 + vlbrh %v15,4000(%r6,%r9) + vlbrf %v15,4000(%r6,%r9) +@@ -124,11 +124,8 @@ foo: + vstrsf %v15,%v17,%v20,%v24 + vstrsf %v15,%v17,%v20,%v24,13 + vstrszb %v15,%v17,%v20,%v24 +- vstrszb %v15,%v17,%v20,%v24,13 + vstrszh %v15,%v17,%v20,%v24 +- vstrszh %v15,%v17,%v20,%v24,13 + vstrszf %v15,%v17,%v20,%v24 +- vstrszf %v15,%v17,%v20,%v24,13 + vcfps %v15,%v17,13,12,11 + vcefb %v15,%v17,13,12 + wcefb %v15,%v17,13,12 diff --git a/SOURCES/binutils-s390x-partial-relro.patch b/SOURCES/binutils-s390x-partial-relro.patch new file mode 100644 index 0000000..63b29b7 --- /dev/null +++ b/SOURCES/binutils-s390x-partial-relro.patch @@ -0,0 +1,899 @@ +diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.30/bfd/elf64-s390.c +--- binutils.orig/bfd/elf64-s390.c 2019-03-11 14:41:06.432547033 +0000 ++++ binutils-2.30/bfd/elf64-s390.c 2019-03-11 14:45:42.066369572 +0000 +@@ -475,7 +475,7 @@ elf_s390_is_local_label_name (bfd *abfd, + + #define RELA_ENTRY_SIZE sizeof (Elf64_External_Rela) + +-/* The first three entries in a procedure linkage table are reserved, ++/* The first three entries in a global offset table are reserved, + and the initial contents are unimportant (we zero them out). + Subsequent entries look like this. See the SVR4 ABI 386 + supplement to see how this works. */ +@@ -505,8 +505,8 @@ elf_s390_is_local_label_name (bfd *abfd, + LG 1,0(1) # 6 bytes Load address from GOT in r1 + BCR 15,1 # 2 bytes Jump to address + RET1: BASR 1,0 # 2 bytes Return from GOT 1st time +- LGF 1,12(1) # 6 bytes Load offset in symbl table in r1 +- BRCL 15,-x # 6 bytes Jump to start of PLT ++ LGF 1,12(1) # 6 bytes Load rela.plt offset into r1 ++ BRCL 15,-x # 6 bytes Jump to first PLT entry + .long ? # 4 bytes offset into .rela.plt + + Total = 32 bytes per PLT entry +@@ -1599,8 +1599,7 @@ allocate_dynrelocs (struct elf_link_hash + /* Make room for this entry. */ + s->size += PLT_ENTRY_SIZE; + +- /* We also need to make an entry in the .got.plt section, which +- will be placed in the .got section by the linker script. */ ++ /* We also need to make an entry in the .got.plt section. */ + htab->elf.sgotplt->size += GOT_ENTRY_SIZE; + + /* We also need to make an entry in the .rela.plt section. */ +@@ -1825,6 +1824,20 @@ elf_s390_size_dynamic_sections (bfd *out + } + } + ++ if (htab->elf.sgot && s390_gotplt_after_got_p (info)) ++ { ++ /* _bfd_elf_create_got_section adds the got header size always ++ to .got.plt but we need it in .got if this section comes ++ first. */ ++ htab->elf.sgot->size += 3 * GOT_ENTRY_SIZE; ++ htab->elf.sgotplt->size -= 3 * GOT_ENTRY_SIZE; ++ ++ /* Make the _GLOBAL_OFFSET_TABLE_ symbol point to the .got ++ instead of .got.plt. */ ++ htab->elf.hgot->root.u.def.section = htab->elf.sgot; ++ htab->elf.hgot->root.u.def.value = 0; ++ } ++ + /* Set up .got offsets for local syms, and space for local dynamic + relocs. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) +@@ -2125,7 +2138,6 @@ elf_s390_relocate_section (bfd *output_b + bfd_boolean unresolved_reloc; + bfd_reloc_status_type r; + int tls_type; +- asection *base_got = htab->elf.sgot; + bfd_boolean resolved_to_zero; + + r_type = ELF64_R_TYPE (rel->r_info); +@@ -2166,7 +2178,7 @@ elf_s390_relocate_section (bfd *output_b + case R_390_PLTOFF16: + case R_390_PLTOFF32: + case R_390_PLTOFF64: +- relocation -= htab->elf.sgot->output_section->vma; ++ relocation -= s390_got_pointer (info); + break; + case R_390_GOTPLT12: + case R_390_GOTPLT16: +@@ -2186,10 +2198,10 @@ elf_s390_relocate_section (bfd *output_b + htab->elf.sgot->contents + + local_got_offsets[r_symndx]); + relocation = (local_got_offsets[r_symndx] + +- htab->elf.sgot->output_offset); ++ s390_got_offset (info)); + + if (r_type == R_390_GOTENT || r_type == R_390_GOTPLTENT) +- relocation += htab->elf.sgot->output_section->vma; ++ relocation += s390_got_pointer (info); + break; + } + default: +@@ -2248,25 +2260,23 @@ elf_s390_relocate_section (bfd *output_b + + if (s390_is_ifunc_symbol_p (h)) + { ++ /* Entry indices of .iplt and .igot.plt match ++ 1:1. No magic PLT first entry here. */ + plt_index = h->plt.offset / PLT_ENTRY_SIZE; +- relocation = (plt_index * GOT_ENTRY_SIZE + +- htab->elf.igotplt->output_offset); +- if (r_type == R_390_GOTPLTENT) +- relocation += htab->elf.igotplt->output_section->vma; ++ relocation = (plt_index * GOT_ENTRY_SIZE ++ + s390_gotplt_offset (info) ++ + htab->elf.igotplt->output_offset); + } + else + { +- /* Calc. index no. +- Current offset - size first entry / entry size. */ +- plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / +- PLT_ENTRY_SIZE; +- +- /* Offset in GOT is PLT index plus GOT headers(3) +- times 8, addr & GOT addr. */ +- relocation = (plt_index + 3) * GOT_ENTRY_SIZE; +- if (r_type == R_390_GOTPLTENT) +- relocation += htab->elf.sgot->output_section->vma; ++ plt_index = ((h->plt.offset - PLT_FIRST_ENTRY_SIZE) ++ / PLT_ENTRY_SIZE); ++ ++ relocation = (plt_index * GOT_ENTRY_SIZE ++ + s390_gotplt_offset (info)); + } ++ if (r_type == R_390_GOTPLTENT) ++ relocation += s390_got_pointer (info); + unresolved_reloc = FALSE; + break; + } +@@ -2280,7 +2290,7 @@ elf_s390_relocate_section (bfd *output_b + case R_390_GOTENT: + /* Relocation is to the entry for this symbol in the global + offset table. */ +- if (base_got == NULL) ++ if (htab->elf.sgot == NULL) + abort (); + + if (h != NULL) +@@ -2297,8 +2307,19 @@ elf_s390_relocate_section (bfd *output_b + { + /* No explicit GOT usage so redirect to the + got.iplt slot. */ +- base_got = htab->elf.igotplt; +- off = h->plt.offset / PLT_ENTRY_SIZE * GOT_ENTRY_SIZE; ++ relocation = (s390_gotplt_offset (info) ++ + htab->elf.igotplt->output_offset ++ + (h->plt.offset / PLT_ENTRY_SIZE ++ * GOT_ENTRY_SIZE)); ++ ++ /* For @GOTENT the relocation is against the offset between ++ the instruction and the symbols entry in the GOT and not ++ between the start of the GOT and the symbols entry. We ++ add the vma of the GOT to get the correct value. */ ++ if (r_type == R_390_GOTENT || r_type == R_390_GOTPLTENT) ++ relocation += s390_got_pointer (info); ++ ++ break; + } + else + { +@@ -2331,7 +2352,7 @@ elf_s390_relocate_section (bfd *output_b + else + { + bfd_put_64 (output_bfd, relocation, +- base_got->contents + off); ++ htab->elf.sgot->contents + off); + h->got.offset |= 1; + } + +@@ -2413,7 +2434,7 @@ elf_s390_relocate_section (bfd *output_b + if (off >= (bfd_vma) -2) + abort (); + +- relocation = base_got->output_offset + off; ++ relocation = s390_got_offset (info) + off; + + /* For @GOTENT the relocation is against the offset between + the instruction and the symbols entry in the GOT and not +@@ -2421,7 +2442,7 @@ elf_s390_relocate_section (bfd *output_b + add the vma of the GOT to get the correct value. */ + if ( r_type == R_390_GOTENT + || r_type == R_390_GOTPLTENT) +- relocation += base_got->output_section->vma; ++ relocation += s390_got_pointer (info); + + break; + +@@ -2439,22 +2460,17 @@ elf_s390_relocate_section (bfd *output_b + relocation = (htab->elf.iplt->output_section->vma + + htab->elf.iplt->output_offset + + h->plt.offset +- - htab->elf.sgot->output_section->vma); ++ - s390_got_pointer (info)); + goto do_relocation; + } + +- /* Note that sgot->output_offset is not involved in this +- calculation. We always want the start of .got. If we +- defined _GLOBAL_OFFSET_TABLE in a different way, as is +- permitted by the ABI, we might have to change this +- calculation. */ +- relocation -= htab->elf.sgot->output_section->vma; ++ relocation -= s390_got_pointer (info); + break; + + case R_390_GOTPC: + case R_390_GOTPCDBL: + /* Use global offset table as symbol value. */ +- relocation = htab->elf.sgot->output_section->vma; ++ relocation = s390_got_pointer (info); + unresolved_reloc = FALSE; + break; + +@@ -2503,7 +2519,7 @@ elf_s390_relocate_section (bfd *output_b + || h->plt.offset == (bfd_vma) -1 + || (htab->elf.splt == NULL && !s390_is_ifunc_symbol_p (h))) + { +- relocation -= htab->elf.sgot->output_section->vma; ++ relocation -= s390_got_pointer (info); + break; + } + +@@ -2511,12 +2527,12 @@ elf_s390_relocate_section (bfd *output_b + relocation = (htab->elf.iplt->output_section->vma + + htab->elf.iplt->output_offset + + h->plt.offset +- - htab->elf.sgot->output_section->vma); ++ - s390_got_pointer (info)); + else + relocation = (htab->elf.splt->output_section->vma + + htab->elf.splt->output_offset + + h->plt.offset +- - htab->elf.sgot->output_section->vma); ++ - s390_got_pointer (info)); + unresolved_reloc = FALSE; + break; + +@@ -3289,7 +3305,7 @@ elf_s390_finish_dynamic_symbol (bfd *out + if (h->plt.offset != (bfd_vma) -1) + { + bfd_vma plt_index; +- bfd_vma got_offset; ++ bfd_vma gotplt_offset; + Elf_Internal_Rela rela; + bfd_byte *loc; + +@@ -3318,18 +3334,25 @@ elf_s390_finish_dynamic_symbol (bfd *out + Current offset - size first entry / entry size. */ + plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; + +- /* Offset in GOT is PLT index plus GOT headers(3) times 8, +- addr & GOT addr. */ +- got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; ++ /* The slots in the .got.plt correspond to the PLT slots in ++ the same order. */ ++ gotplt_offset = plt_index * GOT_ENTRY_SIZE; ++ ++ /* If .got.plt comes first it needs to contain the 3 header ++ entries. */ ++ if (!s390_gotplt_after_got_p (info)) ++ gotplt_offset += 3 * GOT_ENTRY_SIZE; + + /* Fill in the blueprint of a PLT. */ + memcpy (htab->elf.splt->contents + h->plt.offset, elf_s390x_plt_entry, + PLT_ENTRY_SIZE); + +- /* Fixup the relative address to the GOT entry */ ++ /* The first instruction in the PLT entry is a LARL loading ++ the address of the GOT slot. We write the 4 byte ++ immediate operand of the LARL instruction here. */ + bfd_put_32 (output_bfd, + (htab->elf.sgotplt->output_section->vma + +- htab->elf.sgotplt->output_offset + got_offset ++ htab->elf.sgotplt->output_offset + gotplt_offset + - (htab->elf.splt->output_section->vma + + htab->elf.splt->output_offset + + h->plt.offset))/2, +@@ -3349,12 +3372,12 @@ elf_s390_finish_dynamic_symbol (bfd *out + + htab->elf.splt->output_offset + + h->plt.offset + + 14), +- htab->elf.sgotplt->contents + got_offset); ++ htab->elf.sgotplt->contents + gotplt_offset); + + /* Fill in the entry in the .rela.plt section. */ + rela.r_offset = (htab->elf.sgotplt->output_section->vma + + htab->elf.sgotplt->output_offset +- + got_offset); ++ + gotplt_offset); + rela.r_info = ELF64_R_INFO (h->dynindx, R_390_JMP_SLOT); + rela.r_addend = 0; + loc = htab->elf.srelplt->contents + plt_index * +@@ -3561,8 +3584,8 @@ elf_s390_finish_dynamic_sections (bfd *o + continue; + + case DT_PLTGOT: +- s = htab->elf.sgotplt; +- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; ++ /* DT_PLTGOT matches _GLOBAL_OFFSET_TABLE_ */ ++ dyn.d_un.d_ptr = s390_got_pointer (info); + break; + + case DT_JMPREL: +@@ -3599,10 +3622,11 @@ elf_s390_finish_dynamic_sections (bfd *o + /* fill in blueprint for plt 0 entry */ + memcpy (htab->elf.splt->contents, elf_s390x_first_plt_entry, + PLT_FIRST_ENTRY_SIZE); +- /* Fixup relative address to start of GOT */ ++ /* The second instruction in the first PLT entry is a LARL ++ loading the GOT pointer. Fill in the LARL immediate ++ address. */ + bfd_put_32 (output_bfd, +- (htab->elf.sgotplt->output_section->vma +- + htab->elf.sgotplt->output_offset ++ (s390_got_pointer (info) + - htab->elf.splt->output_section->vma + - htab->elf.splt->output_offset - 6)/2, + htab->elf.splt->contents + 8); +@@ -3612,21 +3636,22 @@ elf_s390_finish_dynamic_sections (bfd *o + = PLT_ENTRY_SIZE; + } + +- if (htab->elf.sgotplt) ++ if (htab->elf.hgot && htab->elf.hgot->root.u.def.section) + { + /* Fill in the first three entries in the global offset table. */ +- if (htab->elf.sgotplt->size > 0) ++ if (htab->elf.hgot->root.u.def.section->size > 0) + { + bfd_put_64 (output_bfd, + (sdyn == NULL ? (bfd_vma) 0 + : sdyn->output_section->vma + sdyn->output_offset), +- htab->elf.sgotplt->contents); ++ htab->elf.hgot->root.u.def.section->contents); + /* One entry for shared object struct ptr. */ +- bfd_put_64 (output_bfd, (bfd_vma) 0, htab->elf.sgotplt->contents + 8); ++ bfd_put_64 (output_bfd, (bfd_vma) 0, ++ htab->elf.hgot->root.u.def.section->contents + 8); + /* One entry for _dl_runtime_resolve. */ +- bfd_put_64 (output_bfd, (bfd_vma) 0, htab->elf.sgotplt->contents + 16); ++ bfd_put_64 (output_bfd, (bfd_vma) 0, ++ htab->elf.hgot->root.u.def.section->contents + 16); + } +- + elf_section_data (htab->elf.sgot->output_section) + ->this_hdr.sh_entsize = 8; + } +diff -rup binutils.orig/bfd/elf-s390-common.c binutils-2.30/bfd/elf-s390-common.c +--- binutils.orig/bfd/elf-s390-common.c 2019-03-11 14:41:06.444546938 +0000 ++++ binutils-2.30/bfd/elf-s390-common.c 2019-03-11 14:45:42.065369580 +0000 +@@ -30,6 +30,87 @@ s390_is_ifunc_symbol_p (struct elf_link_ + return h->type == STT_GNU_IFUNC || eh->ifunc_resolver_address != 0; + } + ++/* Return true if .got.plt is supposed to be emitted after .got. */ ++ ++static inline bfd_boolean ++s390_gotplt_after_got_p (struct bfd_link_info *info) ++{ ++ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info); ++ ++ if (!htab->elf.sgot || !htab->elf.sgotplt) ++ return TRUE; ++ ++ if (htab->elf.sgot->output_section == htab->elf.sgotplt->output_section) ++ { ++ if (htab->elf.sgot->output_offset < htab->elf.sgotplt->output_offset) ++ return TRUE; ++ } ++ else ++ { ++ if (htab->elf.sgot->output_section->vma ++ <= htab->elf.sgotplt->output_section->vma) ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++/* Return the value of the _GLOBAL_OFFSET_TABLE_ symbol. */ ++ ++static inline bfd_vma ++s390_got_pointer (struct bfd_link_info *info) ++{ ++ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info); ++ bfd_vma got_pointer; ++ ++ BFD_ASSERT (htab && htab->elf.hgot); ++ ++ got_pointer = (htab->elf.hgot->root.u.def.section->output_section->vma ++ + htab->elf.hgot->root.u.def.section->output_offset); ++ /* Our ABI requires the GOT pointer to point at the very beginning ++ of the global offset table. */ ++ BFD_ASSERT (got_pointer ++ <= (htab->elf.sgot->output_section->vma ++ + htab->elf.sgot->output_offset)); ++ BFD_ASSERT (got_pointer ++ <= (htab->elf.sgotplt->output_section->vma ++ + htab->elf.sgotplt->output_offset)); ++ ++ return got_pointer; ++} ++ ++ ++/* Return the offset of the .got versus _GLOBAL_OFFSET_TABLE_. */ ++ ++static inline bfd_vma ++s390_got_offset (struct bfd_link_info *info) ++{ ++ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info); ++ ++ /* The absolute address of the .got in the target image. */ ++ bfd_vma got_address = (htab->elf.sgot->output_section->vma ++ + htab->elf.sgot->output_offset); ++ ++ /* GOT offset must not be negative. */ ++ BFD_ASSERT (s390_got_pointer (info) <= got_address); ++ return got_address - s390_got_pointer (info); ++} ++ ++/* Return the offset of the .got.plt versus _GLOBAL_OFFSET_TABLE_. */ ++ ++static inline bfd_vma ++s390_gotplt_offset (struct bfd_link_info *info) ++{ ++ struct elf_s390_link_hash_table *htab = elf_s390_hash_table (info); ++ ++ /* The absolute address of the .got.plt in the target image. */ ++ bfd_vma gotplt_address = (htab->elf.sgotplt->output_section->vma ++ + htab->elf.sgotplt->output_offset); ++ ++ /* GOT offset must not be negative. */ ++ BFD_ASSERT (s390_got_pointer (info) <= gotplt_address); ++ return gotplt_address - s390_got_pointer (info); ++} ++ + /* Create sections needed by STT_GNU_IFUNC symbol. */ + + static bfd_boolean +diff -rup binutils.orig/ld/emulparams/elf64_s390.sh binutils-2.30/ld/emulparams/elf64_s390.sh +--- binutils.orig/ld/emulparams/elf64_s390.sh 2019-03-11 14:41:05.978550619 +0000 ++++ binutils-2.30/ld/emulparams/elf64_s390.sh 2019-03-11 14:45:42.066369572 +0000 +@@ -11,9 +11,12 @@ NOP=0x07070707 + TEMPLATE_NAME=elf32 + GENERATE_SHLIB_SCRIPT=yes + GENERATE_PIE_SCRIPT=yes ++GENERATE_RELRO_SCRIPT=yes + NO_SMALL_DATA=yes + EXTRA_EM_FILE=s390 + IREL_IN_PLT= ++SEPARATE_GOTPLT=0 ++test -z "$RELRO" && unset SEPARATE_GOTPLT + + # Treat a host that matches the target with the possible exception of "x" + # in the name as if it were native. +diff -rup binutils.orig/ld/emultempl/elf32.em binutils-2.30/ld/emultempl/elf32.em +--- binutils.orig/ld/emultempl/elf32.em 2019-03-11 14:41:05.971550675 +0000 ++++ binutils-2.30/ld/emultempl/elf32.em 2019-03-11 14:45:42.064369587 +0000 +@@ -2406,17 +2406,41 @@ echo ' && link_info.combrelo + echo ' && link_info.relro' >> e${EMULATION_NAME}.c + echo ' && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xdw >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c ++echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c ++echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xdceo >> e${EMULATION_NAME}.c ++fi + echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c + echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c + echo ' && link_info.combreloc) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xdce >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c ++echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xdco >> e${EMULATION_NAME}.c ++fi + echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c + echo ' && link_info.combreloc) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xdc >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c ++echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xdeo >> e${EMULATION_NAME}.c ++fi + fi + echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c + echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xde >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (bfd_link_pie (&link_info)' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xdo >> e${EMULATION_NAME}.c ++fi + echo ' ; else if (bfd_link_pie (&link_info)) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xd >> e${EMULATION_NAME}.c + fi +@@ -2432,17 +2456,41 @@ echo ' && link_info.combrelo + echo ' && link_info.relro' >> e${EMULATION_NAME}.c + echo ' && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xsw >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c ++echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c ++echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xsceo >> e${EMULATION_NAME}.c ++fi + echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c + echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c + echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xsce >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c ++echo ' && link_info.combreloc' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xsco >> e${EMULATION_NAME}.c ++fi + echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c + echo ' && link_info.combreloc) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xsc >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c ++echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xseo >> e${EMULATION_NAME}.c ++fi + fi + echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c + echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xse >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (bfd_link_dll (&link_info)' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xso >> e${EMULATION_NAME}.c ++fi + echo ' ; else if (bfd_link_dll (&link_info)) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c + fi +@@ -2455,14 +2503,34 @@ echo ' ; else if (link_info.combreloc' + echo ' && link_info.relro' >> e${EMULATION_NAME}.c + echo ' && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xw >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (link_info.combreloc' >> e${EMULATION_NAME}.c ++echo ' && link_info.separate_code' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xceo >> e${EMULATION_NAME}.c ++fi + echo ' ; else if (link_info.combreloc' >> e${EMULATION_NAME}.c + echo ' && link_info.separate_code) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xce >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (link_info.combreloc' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xco >> e${EMULATION_NAME}.c ++fi + echo ' ; else if (link_info.combreloc) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xc >> e${EMULATION_NAME}.c + fi +-echo ' ; else if (link_info.separate_code) return' >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (link_info.separate_code' >> e${EMULATION_NAME}.c ++echo ' && link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xeo >> e${EMULATION_NAME}.c ++fi ++echo ' ; else if (link_info.separate_code) return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.xe >> e${EMULATION_NAME}.c ++if test -n "$GENERATE_RELRO_SCRIPT" ; then ++echo ' ; else if (link_info.relro) return' >> e${EMULATION_NAME}.c ++sed $sc ldscripts/${EMULATION_NAME}.xo >> e${EMULATION_NAME}.c ++fi + echo ' ; else return' >> e${EMULATION_NAME}.c + sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c + echo '; }' >> e${EMULATION_NAME}.c +@@ -2501,6 +2569,21 @@ fragment < ldscripts/${EMULATION_NAME}.xe + ++if test -n "$GENERATE_RELRO_SCRIPT"; then ++ LD_FLAG= ++ RELRO=" " ++ ( echo "/* Script for -z relo: generate normal executables with separate code segment */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xo ++ LD_FLAG=textonly ++ ( echo "/* Script for -z separate-code -z relo: generate normal executables with separate code segment */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xeo ++ unset RELRO ++fi + LD_FLAG=n + DATA_ALIGNMENT=${DATA_ALIGNMENT_n} + ( echo "/* Script for -n: mix text and data on same page */" +@@ -351,6 +365,25 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; + rm -f ${COMBRELOC} + COMBRELOC= + unset RELRO_NOW ++ if test -n "$GENERATE_RELRO_SCRIPT"; then ++ LD_FLAG=c ++ RELRO=" " ++ COMBRELOC=ldscripts/${EMULATION_NAME}.xco.tmp ++ ( echo "/* Script for -z combreloc -z relro: combine and sort reloc sections */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xco ++ rm -f ${COMBRELOC} ++ LD_FLAG=ctextonly ++ COMBRELOC=ldscripts/${EMULATION_NAME}.xceo.tmp ++ ( echo "/* Script for -z combreloc -z separate-code -z relro: combine and sort reloc sections */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xceo ++ rm -f ${COMBRELOC} ++ COMBRELOC= ++ unset RELRO ++ fi + fi + + if test -n "$GENERATE_SHLIB_SCRIPT"; then +@@ -368,6 +401,23 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; the + . ${CUSTOMIZER_SCRIPT} + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xse ++ ++ if test -n "$GENERATE_RELRO_SCRIPT"; then ++ RELRO=" " ++ LD_FLAG=shared ++ ( ++ echo "/* Script for ld --shared -z relro: link shared library */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xso ++ LD_FLAG=sharedtextonly ++ ( ++ echo "/* Script for ld --shared -z relro -z separate-code: link shared library with separate code segment */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xseo ++ unset RELRO ++ fi + if test -n "$GENERATE_COMBRELOC_SCRIPT"; then + DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} + LD_FLAG=cshared +@@ -399,8 +449,27 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; the + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xswe + rm -f ${COMBRELOC} +- COMBRELOC= + unset RELRO_NOW ++ ++ if test -n "$GENERATE_RELRO_SCRIPT"; then ++ LD_FLAG=wshared ++ RELRO=" " ++ COMBRELOC=ldscripts/${EMULATION_NAME}.xsco.tmp ++ ( echo "/* Script for --shared -z combreloc -z relro: shared library, combine & sort relocs with separate code segment */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsco ++ rm -f ${COMBRELOC} ++ LD_FLAG=wsharedtextonly ++ COMBRELOC=ldscripts/${EMULATION_NAME}.xsceo.tmp ++ ( echo "/* Script for --shared -z combreloc -z relro -z separate-code: shared library, combine & sort relocs with separate code segment */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsceo ++ rm -f ${COMBRELOC} ++ unset RELRO ++ fi ++ COMBRELOC= + fi + unset CREATE_SHLIB + fi +@@ -420,6 +489,22 @@ if test -n "$GENERATE_PIE_SCRIPT"; then + . ${CUSTOMIZER_SCRIPT} + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xde ++ if test -n "$GENERATE_RELRO_SCRIPT"; then ++ RELRO=" " ++ LD_FLAG=pie ++ ( ++ echo "/* Script for ld -pie -z relro: link position independent executable */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdo ++ LD_FLAG=pietextonly ++ ( ++ echo "/* Script for ld -pie -z relro -z separate-code: link position independent executable with separate code segment */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdeo ++ unset RELRO ++ fi + if test -n "$GENERATE_COMBRELOC_SCRIPT"; then + DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} + COMBRELOC=ldscripts/${EMULATION_NAME}.xdc.tmp +@@ -451,8 +536,28 @@ if test -n "$GENERATE_PIE_SCRIPT"; then + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdwe + rm -f ${COMBRELOC} +- COMBRELOC= + unset RELRO_NOW ++ ++ if test -n "$GENERATE_RELRO_SCRIPT"; then ++ LD_FLAG=wpie ++ RELRO=" " ++ COMBRELOC=ldscripts/${EMULATION_NAME}.xdco.tmp ++ ( echo "/* Script for -pie -z combreloc -z relro: position independent executable, combine & sort relocs with separate code segment */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdco ++ rm -f ${COMBRELOC} ++ LD_FLAG=wpietextonly ++ COMBRELOC=ldscripts/${EMULATION_NAME}.xdceo.tmp ++ ( echo "/* Script for -pie -z combreloc -z relro -z separate-code: position independent executable, combine & sort relocs with separate code segment */" ++ . ${CUSTOMIZER_SCRIPT} ++ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ++ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdceo ++ rm -f ${COMBRELOC} ++ ++ unset RELRO ++ fi ++ COMBRELOC= + fi + unset CREATE_PIE + fi +diff -rup binutils.orig/ld/testsuite/ld-s390/s390.exp binutils-2.30/ld/testsuite/ld-s390/s390.exp +--- binutils.orig/ld/testsuite/ld-s390/s390.exp 2019-03-11 14:41:06.029550216 +0000 ++++ binutils-2.30/ld/testsuite/ld-s390/s390.exp 2019-03-11 14:45:42.066369572 +0000 +@@ -70,10 +70,15 @@ set s390xtests { + {{readelf -WSsrl tlsbin_64.rd} {objdump -dzrj.text tlsbin_64.dd} + {objdump -sj.got tlsbin_64.sd} {objdump -sj.tdata tlsbin_64.td}} + "tlsbin_64"} +- {"GOT: symbol address load from got to larl" +- "-shared -melf64_s390 --hash-style=sysv --version-script=gotreloc-1.ver" "" ++ {"GOT: norelro symbol address load from got to larl" ++ "-shared -melf64_s390 -z norelro --hash-style=sysv --version-script=gotreloc-1.ver" "" + "-m64" {gotreloc-1.s} +- {{objdump -dzrj.text gotreloc_64-1.dd}} ++ {{objdump -dzrj.text gotreloc_64-norelro-1.dd}} ++ "gotreloc_64-1"} ++ {"GOT: relro symbol address load from got to larl" ++ "-shared -melf64_s390 -z relro --hash-style=sysv --version-script=gotreloc-1.ver" "" ++ "-m64" {gotreloc-1.s} ++ {{objdump -dzrj.text gotreloc_64-relro-1.dd}} + "gotreloc_64-1"} + {"PLT: offset test" + "-shared -m elf64_s390 -dT pltoffset-1.ld" "" +--- /dev/null 2019-03-11 08:49:22.227998809 +0000 ++++ binutils-2.30/ld/testsuite/ld-s390/gotreloc_64-relro-1.dd 2019-03-11 14:53:27.144667759 +0000 +@@ -0,0 +1,12 @@ ++tmpdir/gotreloc_64-1: file format elf64-s390 ++ ++Disassembly of section .text: ++ ++.* : ++.*: c0 10 00 00 00 0e [ ]*larl %r1,.* ++.*: c0 10 00 00 00 0b [ ]*larl %r1,.* ++.*: c4 1d 00 00 .. .. [ ]*lrl %r1,.* <_GLOBAL_OFFSET_TABLE_\+0x18> ++.*: 58 10 c0 18 [ ]*l %r1,24\(%r12\) ++.*: e3 10 c0 18 00 58 [ ]*ly %r1,24\(%r12\) ++.* : ++.*: 00 00 01 23 .long 0x00000123 +--- /dev/null 2019-03-11 08:49:22.227998809 +0000 ++++ binutils-2.30/ld/testsuite/ld-s390/gotreloc_64-norelro-1.dd 2019-03-11 14:45:42.066369572 +0000 +@@ -0,0 +1,12 @@ ++tmpdir/gotreloc_64-1: file format elf64-s390 ++ ++Disassembly of section .text: ++ ++.* : ++.*: c0 10 00 00 00 0e [ ]*larl %r1,.* ++.*: c0 10 00 00 00 0b [ ]*larl %r1,.* ++.*: c4 1d 00 00 08 86 [ ]*lrl %r1,.* <_GLOBAL_OFFSET_TABLE_\+0x18> ++.*: 58 10 c0 18 [ ]*l %r1,24\(%r12\) ++.*: e3 10 c0 18 00 58 [ ]*ly %r1,24\(%r12\) ++.* : ++.*: 00 00 01 23 .long 0x00000123 diff --git a/SOURCES/binutils-skip-dwo-search-if-not-needed.patch b/SOURCES/binutils-skip-dwo-search-if-not-needed.patch new file mode 100644 index 0000000..4369b78 --- /dev/null +++ b/SOURCES/binutils-skip-dwo-search-if-not-needed.patch @@ -0,0 +1,13 @@ +--- binutils.orig/binutils/dwarf.c 2018-02-08 10:49:07.154191536 +0000 ++++ binutils-2.30/binutils/dwarf.c 2018-02-08 12:53:32.649380368 +0000 +@@ -9851,6 +9851,10 @@ load_dwo_file (const char * main_filenam + void * + load_separate_debug_file (void * file, const char * filename) + { ++ /* Skip this operation if we are not interested in debug links. */ ++ if (! do_follow_links && ! do_debug_links) ++ return NULL; ++ + /* See if there is a dwo link. */ + if (load_debug_section (str, file) + && load_debug_section (abbrev, file) diff --git a/SOURCES/binutils-speed-up-objdump.patch b/SOURCES/binutils-speed-up-objdump.patch new file mode 100644 index 0000000..fe92635 --- /dev/null +++ b/SOURCES/binutils-speed-up-objdump.patch @@ -0,0 +1,97 @@ +--- binutils.orig/binutils/objdump.c 2018-03-05 17:04:19.901619738 +0000 ++++ binutils-2.29/binutils/objdump.c 2018-03-05 17:10:08.334643096 +0000 +@@ -664,9 +664,7 @@ slurp_dynamic_symtab (bfd *abfd) + static bfd_boolean + is_significant_symbol_name (const char * name) + { +- return strcmp (name, ".plt") == 0 +- || strcmp (name, ".got") == 0 +- || strcmp (name, ".plt.got") == 0; ++ return strncmp (name, ".plt", 4) == 0 || strcmp (name, ".got") == 0; + } + + /* Filter out (in place) symbols that are useless for disassembly. +@@ -937,6 +935,7 @@ find_symbol_for_address (bfd_vma vma, + asection *sec; + unsigned int opb; + bfd_boolean want_section; ++ long rel_count; + + if (sorted_symcount < 1) + return NULL; +@@ -1065,33 +1064,59 @@ find_symbol_for_address (bfd_vma vma, + and we have dynamic relocations available, then we can produce + a better result by matching a relocation to the address and + using the symbol associated with that relocation. */ ++ rel_count = aux->dynrelcount; + if (!want_section +- && aux->dynrelbuf != NULL + && sorted_syms[thisplace]->value != vma ++ && rel_count > 0 ++ && aux->dynrelbuf != NULL ++ && aux->dynrelbuf[0]->address <= vma ++ && aux->dynrelbuf[rel_count - 1]->address >= vma + /* If we have matched a synthetic symbol, then stick with that. */ + && (sorted_syms[thisplace]->flags & BSF_SYNTHETIC) == 0) + { +- long rel_count; +- arelent ** rel_pp; ++ arelent ** rel_low; ++ arelent ** rel_high; + +- for (rel_count = aux->dynrelcount, rel_pp = aux->dynrelbuf; +- rel_count--;) ++ rel_low = aux->dynrelbuf; ++ rel_high = rel_low + rel_count - 1; ++ while (rel_low <= rel_high) + { +- arelent * rel = rel_pp[rel_count]; ++ arelent ** rel_mid = &rel_low[(rel_high - rel_low) / 2]; ++ arelent * rel = *rel_mid; + +- if (rel->address == vma +- && rel->sym_ptr_ptr != NULL +- /* Absolute relocations do not provide a more helpful symbolic address. */ +- && ! bfd_is_abs_section ((* rel->sym_ptr_ptr)->section)) ++ if (rel->address == vma) + { +- if (place != NULL) +- * place = thisplace; +- return * rel->sym_ptr_ptr; ++ /* Absolute relocations do not provide a more helpful ++ symbolic address. Find a non-absolute relocation ++ with the same address. */ ++ ++ arelent **rel_vma = rel_mid; ++ ++ for (rel_mid--; ++ rel_mid >= rel_low && rel_mid[0]->address == vma; ++ rel_mid--) ++ rel_vma = rel_mid; ++ ++ for (; rel_vma <= rel_high && rel_vma[0]->address == vma; ++ rel_vma++) ++ { ++ rel = *rel_vma; ++ if (rel->sym_ptr_ptr != NULL ++ && ! bfd_is_abs_section ((* rel->sym_ptr_ptr)->section)) ++ { ++ if (place != NULL) ++ * place = thisplace; ++ return * rel->sym_ptr_ptr; ++ } ++ } ++ break; + } + +- /* We are scanning backwards, so if we go below the target address +- we have failed. */ +- if (rel_pp[rel_count]->address < vma) ++ if (vma < rel->address) ++ rel_high = rel_mid; ++ else if (vma >= rel_mid[1]->address) ++ rel_low = rel_mid + 1; ++ else + break; + } + } diff --git a/SOURCES/binutils-strip-unknown-relocs.patch b/SOURCES/binutils-strip-unknown-relocs.patch new file mode 100644 index 0000000..d8ecd84 --- /dev/null +++ b/SOURCES/binutils-strip-unknown-relocs.patch @@ -0,0 +1,107 @@ +diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.30/bfd/elf32-i386.c +--- binutils.orig/bfd/elf32-i386.c 2018-02-27 17:25:53.961140597 +0000 ++++ binutils-2.30/bfd/elf32-i386.c 2018-02-27 17:27:14.115133477 +0000 +@@ -383,7 +383,7 @@ elf_i386_rtype_to_howto (bfd *abfd, unsi + /* xgettext:c-format */ + _bfd_error_handler (_("%B: invalid relocation type %d"), + abfd, (int) r_type); +- indx = R_386_NONE; ++ return NULL; + } + /* PR 17512: file: 0f67f69d. */ + if (elf_howto_table [indx].type != r_type) +diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.30/bfd/elf64-ppc.c +--- binutils.orig/bfd/elf64-ppc.c 2018-02-27 17:25:53.969140496 +0000 ++++ binutils-2.30/bfd/elf64-ppc.c 2018-02-27 17:27:56.213604518 +0000 +@@ -2516,9 +2516,10 @@ ppc64_elf_info_to_howto (bfd *abfd, arel + /* xgettext:c-format */ + _bfd_error_handler (_("%B: invalid relocation type %d"), + abfd, (int) type); +- type = R_PPC64_NONE; ++ cache_ptr->howto = NULL; + } +- cache_ptr->howto = ppc64_elf_howto_table[type]; ++ else ++ cache_ptr->howto = ppc64_elf_howto_table[type]; + } + + /* Handle the R_PPC64_ADDR16_HA and similar relocs. */ +diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.30/bfd/elf64-s390.c +--- binutils.orig/bfd/elf64-s390.c 2018-02-27 17:25:53.968140509 +0000 ++++ binutils-2.30/bfd/elf64-s390.c 2018-02-27 17:28:24.632247443 +0000 +@@ -372,9 +372,10 @@ elf_s390_info_to_howto (bfd *abfd ATTRIB + /* xgettext:c-format */ + _bfd_error_handler (_("%B: invalid relocation type %d"), + abfd, (int) r_type); +- r_type = R_390_NONE; ++ cache_ptr->howto = NULL; + } +- cache_ptr->howto = &elf_howto_table[r_type]; ++ else ++ cache_ptr->howto = &elf_howto_table[r_type]; + } + } + +diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.30/bfd/elf64-x86-64.c +--- binutils.orig/bfd/elf64-x86-64.c 2018-02-27 17:25:53.964140559 +0000 ++++ binutils-2.30/bfd/elf64-x86-64.c 2018-02-27 17:29:12.554645307 +0000 +@@ -284,7 +284,7 @@ elf_x86_64_rtype_to_howto (bfd *abfd, un + /* xgettext:c-format */ + _bfd_error_handler (_("%B: invalid relocation type %d"), + abfd, (int) r_type); +- r_type = R_X86_64_NONE; ++ return NULL; + } + i = r_type; + } +@@ -347,8 +347,6 @@ elf_x86_64_info_to_howto (bfd *abfd ATTR + && r_type != (unsigned int) R_X86_64_GNU_VTENTRY) + r_type &= ~R_X86_64_converted_reloc_bit; + cache_ptr->howto = elf_x86_64_rtype_to_howto (abfd, r_type); +- +- BFD_ASSERT (r_type == cache_ptr->howto->type || cache_ptr->howto->type == R_X86_64_NONE); + } + + /* Support for core dump NOTE sections. */ +diff -rup binutils.orig/bfd/elfcode.h binutils-2.30/bfd/elfcode.h +--- binutils.orig/bfd/elfcode.h 2018-02-27 17:25:53.964140559 +0000 ++++ binutils-2.30/bfd/elfcode.h 2018-02-27 17:26:57.234345581 +0000 +@@ -1474,6 +1474,12 @@ elf_slurp_reloc_table_from_section (bfd + (*ebd->elf_info_to_howto) (abfd, relent, &rela); + else + (*ebd->elf_info_to_howto_rel) (abfd, relent, &rela); ++ ++ if (relent->howto == NULL) ++ { ++ bfd_set_error (bfd_error_bad_value); ++ goto error_return; ++ } + } + + if (allocated != NULL) +diff -rup binutils.orig/binutils/objcopy.c binutils-2.30/binutils/objcopy.c +--- binutils.orig/binutils/objcopy.c 2018-02-27 17:25:53.185150347 +0000 ++++ binutils-2.30/binutils/objcopy.c 2018-02-27 17:30:05.806976202 +0000 +@@ -3022,10 +3022,19 @@ copy_object (bfd *ibfd, bfd *obfd, const + haven't been set yet. mark_symbols_used_in_relocations will + ignore input sections which have no corresponding output + section. */ ++ bfd_set_error (bfd_error_no_error); + if (strip_symbols != STRIP_ALL) +- bfd_map_over_sections (ibfd, +- mark_symbols_used_in_relocations, +- isympp); ++ { ++ bfd_map_over_sections (ibfd, ++ mark_symbols_used_in_relocations, ++ isympp); ++ if (bfd_get_error () != bfd_error_no_error) ++ { ++ status = 1; ++ return FALSE; ++ } ++ } ++ + osympp = (asymbol **) xmalloc ((symcount + add_symbols + 1) * sizeof (asymbol *)); + symcount = filter_symbols (ibfd, obfd, osympp, isympp, symcount); + } diff --git a/SOURCES/binutils-x86-IBT-and-missing-notes.patch b/SOURCES/binutils-x86-IBT-and-missing-notes.patch new file mode 100644 index 0000000..e44fe43 --- /dev/null +++ b/SOURCES/binutils-x86-IBT-and-missing-notes.patch @@ -0,0 +1,210 @@ +# Do not enable IBT when an object file contains code but no GNU Property notes. (#1687774) + +diff -rup binutils.orig/bfd/elfxx-x86.c binutils-2.30/bfd/elfxx-x86.c +--- binutils.orig/bfd/elfxx-x86.c 2019-03-13 10:19:07.715406452 +0000 ++++ binutils-2.30/bfd/elfxx-x86.c 2019-03-13 10:20:01.255975385 +0000 +@@ -2377,6 +2377,9 @@ _bfd_x86_elf_merge_gnu_properties (struc + } + else + { ++ /* There should be no AND properties since some input doesn't ++ have them. Set IBT and SHSTK properties for -z ibt and -z ++ shstk if needed. */ + features = 0; + if (info->ibt) + features = GNU_PROPERTY_X86_FEATURE_1_IBT; +@@ -2384,18 +2387,15 @@ _bfd_x86_elf_merge_gnu_properties (struc + features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK; + if (features) + { +- /* Add GNU_PROPERTY_X86_FEATURE_1_IBT and +- GNU_PROPERTY_X86_FEATURE_1_SHSTK. */ + if (aprop != NULL) + { +- number = aprop->u.number; +- aprop->u.number = number | features; +- updated = number != (unsigned int) aprop->u.number; ++ updated = features != (unsigned int) aprop->u.number; ++ aprop->u.number = features; + } + else + { +- bprop->u.number |= features; + updated = TRUE; ++ bprop->u.number = features; + } + } + else if (aprop != NULL) +diff -rup binutils.orig/ld/testsuite/ld-i386/i386.exp binutils-2.30/ld/testsuite/ld-i386/i386.exp +--- binutils.orig/ld/testsuite/ld-i386/i386.exp 2019-03-13 10:19:07.258410131 +0000 ++++ binutils-2.30/ld/testsuite/ld-i386/i386.exp 2019-03-13 10:20:32.995719837 +0000 +@@ -473,6 +473,8 @@ run_dump_test "pr18815" + run_dump_test "pr19939a" + run_dump_test "pr19939b" + run_dump_test "tlsdesc2" ++run_dump_test "pr24322a" ++run_dump_test "pr24322b" + + proc undefined_weak {cflags ldflags} { + set testname "Undefined weak symbol" +diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp +--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2019-03-13 10:19:07.323409608 +0000 ++++ binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp 2019-03-13 10:21:11.938406302 +0000 +@@ -593,6 +593,10 @@ run_dump_test "pr20253-5a" + run_dump_test "pr20253-5b" + run_dump_test "tlsdesc2" + run_dump_test "pr22048" ++run_dump_test "pr24322a" ++run_dump_test "pr24322a-x32" ++run_dump_test "pr24322b" ++run_dump_test "pr24322b-x32" + + proc undefined_weak {cflags ldflags} { + set testname "Undefined weak symbol" +--- /dev/null 2019-03-13 08:01:41.976955507 +0000 ++++ binutils-2.30/ld/testsuite/ld-i386/pr24322a.d 2019-03-13 11:05:58.557068529 +0000 +@@ -0,0 +1,11 @@ ++#source: ../ld-x86-64/pr24322a.s ++#source: ../ld-x86-64/pr24322b.s ++#as: --32 ++#ld: -z shstk -m elf_i386 ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++ Owner Data size Description ++ GNU 0x000000.. NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: SHSTK ++ +--- /dev/null 2019-03-13 08:01:41.976955507 +0000 ++++ binutils-2.30/ld/testsuite/ld-i386/pr24322b.d 2019-03-13 11:07:19.837414751 +0000 +@@ -0,0 +1,11 @@ ++#source: ../ld-x86-64/pr24322c.s ++#source: ../ld-x86-64/pr24322b.s ++#as: --32 ++#ld: -z shstk -m elf_i386 ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++ Owner Data size Description ++ GNU 0x000000.. NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: SHSTK ++ +--- /dev/null 2019-03-13 08:01:41.976955507 +0000 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr24322a.s 2019-03-13 10:20:01.256975377 +0000 +@@ -0,0 +1,27 @@ ++ .section ".note.gnu.property", "a" ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++ .long 1f - 0f /* name length */ ++ .long 5f - 2f /* data length */ ++ .long 5 /* note type */ ++0: .asciz "GNU" /* vendor name */ ++1: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++2: .long 0xc0000002 /* pr_type. */ ++ .long 4f - 3f /* pr_datasz. */ ++3: ++ .long 0x3 ++4: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++5: +--- /dev/null 2019-03-13 08:01:41.976955507 +0000 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr24322a.d 2019-03-13 11:07:47.228194433 +0000 +@@ -0,0 +1,10 @@ ++#source: pr24322a.s ++#source: pr24322b.s ++#as: --64 -defsym __64_bit__=1 ++#ld: -z shstk -melf_x86_64 ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++ Owner Data size Description ++ GNU 0x000000.. NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: SHSTK +--- /dev/null 2019-03-13 08:01:41.976955507 +0000 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr24322a-x32.d 2019-03-13 11:10:46.635235620 +0000 +@@ -0,0 +1,10 @@ ++#source: pr24322a.s ++#source: pr24322b.s ++#as: --x32 ++#ld: -z shstk -m elf32_x86_64 ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++ Owner Data size Description ++ GNU 0x000000.. NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: SHSTK +--- /dev/null 2019-03-13 08:01:41.976955507 +0000 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr24322b.s 2019-03-13 10:20:01.257975369 +0000 +@@ -0,0 +1,4 @@ ++ .text ++ .global _start ++_start: ++ ret +--- /dev/null 2019-03-13 08:01:41.976955507 +0000 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr24322b.d 2019-03-13 11:08:03.948059948 +0000 +@@ -0,0 +1,10 @@ ++#source: pr24322c.s ++#source: pr24322b.s ++#as: --64 -defsym __64_bit__=1 ++#ld: -z shstk -melf_x86_64 ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++ Owner Data size Description ++ GNU 0x000000.. NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: SHSTK +--- /dev/null 2019-03-13 08:01:41.976955507 +0000 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr24322b-x32.d 2019-03-13 11:13:13.626524410 +0000 +@@ -0,0 +1,10 @@ ++#source: pr24322c.s ++#source: pr24322b.s ++#as: --x32 ++#ld: -z shstk -m elf32_x86_64 ++#readelf: -n ++ ++Displaying notes found in: .note.gnu.property ++ Owner Data size Description ++ GNU 0x000000.. NT_GNU_PROPERTY_TYPE_0 ++ Properties: x86 feature: SHSTK +--- /dev/null 2019-03-13 08:01:41.976955507 +0000 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr24322c.s 2019-03-13 10:20:01.257975369 +0000 +@@ -0,0 +1,27 @@ ++ .section ".note.gnu.property", "a" ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++ .long 1f - 0f /* name length */ ++ .long 5f - 2f /* data length */ ++ .long 5 /* note type */ ++0: .asciz "GNU" /* vendor name */ ++1: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++2: .long 0xc0000002 /* pr_type. */ ++ .long 4f - 3f /* pr_datasz. */ ++3: ++ .long 0x0 ++4: ++.ifdef __64_bit__ ++ .p2align 3 ++.else ++ .p2align 2 ++.endif ++5: diff --git a/SOURCES/binutils-x86-local-relocs.patch b/SOURCES/binutils-x86-local-relocs.patch new file mode 100644 index 0000000..ffc74ee --- /dev/null +++ b/SOURCES/binutils-x86-local-relocs.patch @@ -0,0 +1,64 @@ +--- binutils.orig/bfd/elfxx-x86.c 2018-05-14 12:22:29.149657093 +0100 ++++ binutils-2.30/bfd/elfxx-x86.c 2018-05-14 12:25:16.244700009 +0100 +@@ -839,6 +839,33 @@ _bfd_x86_elf_compare_relocs (const void + return 0; + } + ++/* Mark symbol, NAME, as locally defined by linker if it is referenced ++ and not defined in a relocatable object file. */ ++ ++static void ++elf_x86_linker_defined (struct bfd_link_info *info, const char *name) ++{ ++ struct elf_link_hash_entry *h; ++ ++ h = elf_link_hash_lookup (elf_hash_table (info), name, ++ FALSE, FALSE, FALSE); ++ if (h == NULL) ++ return; ++ ++ while (h->root.type == bfd_link_hash_indirect) ++ h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ ++ if (h->root.type == bfd_link_hash_new ++ || h->root.type == bfd_link_hash_undefined ++ || h->root.type == bfd_link_hash_undefweak ++ || h->root.type == bfd_link_hash_common ++ || (!h->def_regular && h->def_dynamic)) ++ { ++ elf_x86_hash_entry (h)->local_ref = 2; ++ elf_x86_hash_entry (h)->linker_def = 1; ++ } ++} ++ + bfd_boolean + _bfd_x86_elf_link_check_relocs (bfd *abfd, struct bfd_link_info *info) + { +@@ -869,18 +896,16 @@ _bfd_x86_elf_link_check_relocs (bfd *abf + + /* "__ehdr_start" will be defined by linker as a hidden symbol + later if it is referenced and not defined. */ +- h = elf_link_hash_lookup (elf_hash_table (info), +- "__ehdr_start", +- FALSE, FALSE, FALSE); +- if (h != NULL +- && (h->root.type == bfd_link_hash_new +- || h->root.type == bfd_link_hash_undefined +- || h->root.type == bfd_link_hash_undefweak +- || h->root.type == bfd_link_hash_common)) ++ elf_x86_linker_defined (info, "__ehdr_start"); ++ ++ if (bfd_link_executable (info)) + { +- elf_x86_hash_entry (h)->local_ref = 2; +- elf_x86_hash_entry (h)->linker_def = 1; +- } ++ /* References to __bss_start, _end and _edata should be ++ locally resolved within executables. */ ++ elf_x86_linker_defined (info, "__bss_start"); ++ elf_x86_linker_defined (info, "_end"); ++ elf_x86_linker_defined (info, "_edata"); ++ } + } + } + diff --git a/SOURCES/binutils-x86-local-version.patch b/SOURCES/binutils-x86-local-version.patch new file mode 100644 index 0000000..8005120 --- /dev/null +++ b/SOURCES/binutils-x86-local-version.patch @@ -0,0 +1,58 @@ +diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c +--- binutils.orig/bfd/elf.c 2018-06-01 09:10:37.866552789 +0100 ++++ binutils-2.30/bfd/elf.c 2018-06-01 09:16:23.159605609 +0100 +@@ -707,11 +707,23 @@ setup_group (bfd *abfd, Elf_Internal_Shd + |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; + break; + } +- if (idx >= shnum) ++ if (idx < shnum) ++ { ++ dest->shdr = elf_elfsections (abfd)[idx]; ++ /* PR binutils/23199: All sections in a ++ section group should be marked with ++ SHF_GROUP. But some tools generate ++ broken objects without SHF_GROUP. Fix ++ them up here. */ ++ dest->shdr->sh_flags |= SHF_GROUP; ++ } ++ if (idx >= shnum ++ || dest->shdr->sh_type == SHT_GROUP) + { + _bfd_error_handler +- (_("%B: invalid SHT_GROUP entry"), abfd); +- idx = 0; ++ (_("%B: invalid entry in SHT_GROUP section [%u]"), ++ abfd, i); ++ dest->shdr = NULL; + } + dest->shdr = elf_elfsections (abfd)[idx]; + } +@@ -779,7 +791,8 @@ setup_group (bfd *abfd, Elf_Internal_Shd + idx = (Elf_Internal_Group *) shdr->contents; + n_elt = shdr->sh_size / 4; + while (--n_elt != 0) +- if ((s = (++idx)->shdr->bfd_section) != NULL ++ if ((++idx)->shdr != NULL ++ && (s = idx->shdr->bfd_section) != NULL + && elf_next_in_group (s) != NULL) + break; + if (n_elt != 0) +diff -rup binutils.orig/bfd/elfxx-x86.c binutils-2.30/bfd/elfxx-x86.c +--- binutils.orig/bfd/elfxx-x86.c 2018-06-01 09:10:37.854552926 +0100 ++++ binutils-2.30/bfd/elfxx-x86.c 2018-06-01 09:21:10.570323575 +0100 +@@ -1976,7 +1976,13 @@ _bfd_x86_elf_link_symbol_references_loca + return TRUE; + } + +- eh->local_ref = 1; ++ /* Symbols created by HIDDEN and PROVIDE_HIDDEN assignments in linker ++ script aren't forced local here yet. bfd_hide_sym_by_version ++ can't be used to check if a versioned symbol is hidden. It has to ++ be syncd with _bfd_elf_link_assign_sym_version to get the correct ++ answer. */ ++ if (!h->root.ldscript_def && h->versioned == unversioned) ++ eh->local_ref = 1; + return FALSE; + } + diff --git a/SOURCES/binutils-x86_64-disable-PLT-elision.patch b/SOURCES/binutils-x86_64-disable-PLT-elision.patch new file mode 100644 index 0000000..c82934f --- /dev/null +++ b/SOURCES/binutils-x86_64-disable-PLT-elision.patch @@ -0,0 +1,137 @@ +--- binutils.orig/bfd/elfxx-x86.c 2018-09-05 14:08:23.331182323 +0100 ++++ binutils-2.30/bfd/elfxx-x86.c 2018-09-05 16:14:15.331921741 +0100 +@@ -108,6 +108,7 @@ elf_x86_allocate_dynrelocs (struct elf_l + + resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); + ++#if 0 /* Never optimize away PLT entries. They are needed by tools like rtld-audit and ltrace. */ + /* 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,6 +126,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. */ +diff -rup binutils.orig/ld/testsuite/ld-i386/i386.exp binutils-2.30/ld/testsuite/ld-i386/i386.exp +--- binutils.orig/ld/testsuite/ld-i386/i386.exp 2018-09-12 15:59:03.969158148 +0100 ++++ binutils-2.30/ld/testsuite/ld-i386/i386.exp 2018-09-12 16:23:41.579837859 +0100 +@@ -1434,9 +1434,9 @@ run_ld_link_tests [list \ + ] + + # Linux only tests +-run_dump_test "pltgot-1" +-run_dump_test "pltgot-2" +-run_dump_test "pr20830" ++# run_dump_test "pltgot-1" ++# run_dump_test "pltgot-2" ++# run_dump_test "pr20830" + run_dump_test "ibt-plt-1" + run_dump_test "ibt-plt-2a" + run_dump_test "ibt-plt-2b" +diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.30/ld/testsuite/ld-i386/pr19636-2d.d +--- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d 2018-09-12 15:59:03.968158156 +0100 ++++ binutils-2.30/ld/testsuite/ld-i386/pr19636-2d.d 2018-09-12 16:20:30.046301550 +0100 +@@ -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.30/ld/testsuite/ld-i386/pr19636-2e.d +--- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d 2018-09-12 15:59:03.966158171 +0100 ++++ binutils-2.30/ld/testsuite/ld-i386/pr19636-2e.d 2018-09-12 16:20:18.301391306 +0100 +@@ -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/plt-main-bnd.dd binutils-2.30/ld/testsuite/ld-x86-64/plt-main-bnd.dd +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2018-09-12 15:59:04.038157619 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2018-09-12 16:43:58.243317284 +0100 +@@ -1,3 +1,4 @@ ++#pass + #... + Disassembly of section .plt.got: + +diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd binutils-2.30/ld/testsuite/ld-x86-64/plt-main-ibt.dd +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2018-09-12 15:59:04.027157703 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2018-09-12 16:46:42.417060121 +0100 +@@ -1,3 +1,4 @@ ++#pass + #... + Disassembly of section .plt.got: + +diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.30/ld/testsuite/ld-x86-64/plt-main.rd +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2018-09-12 15:59:04.037157626 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/plt-main.rd 2018-09-12 16:34:34.950619373 +0100 +@@ -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/pr19636-2e.d binutils-2.30/ld/testsuite/ld-x86-64/pr19636-2e.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr19636-2e.d 2018-09-12 15:59:04.034157649 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/pr19636-2e.d 2018-09-12 16:17:08.687840318 +0100 +@@ -11,7 +11,7 @@ Relocation section '\.rela\.dyn' at offs + Relocation section '\.rela\.plt' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend + [0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +0+ +func3 \+ 0 +- ++#... + Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name + #... +diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp +--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2018-09-12 15:59:04.023157734 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/x86-64.exp 2018-09-12 16:47:08.880857470 +0100 +@@ -59,7 +59,7 @@ set x86_64tests { + "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" "" + "--64 -mrelax-relocations=yes" + {tlspic3.s tlspic2.s} +- {{readelf -WSsrl tlspic2.rd} {objdump -drj.text\ -Mintel64 tlspic2.dd} ++ {{objdump -drj.text\ -Mintel64 tlspic2.dd} + {objdump -sj.got tlspic2.sd} {objdump -sj.tdata tlspic2.td}} + "libtlspic2.so"} + {"TLS descriptor -fpic -shared transitions" +@@ -1837,18 +1837,18 @@ if { "$LD_CLASS" == "64bit" } then { + # This test needs 64-bit linker. + run_dump_test "pr17618" + } +-run_dump_test "pltgot-1" +-run_dump_test "pltgot-2" +-run_dump_test "pr20830a" +-run_dump_test "pr20830b" +-run_dump_test "pr21038a" +-run_dump_test "pr21038b" +-run_dump_test "pr21038c" +-run_dump_test "pr20830a-now" +-run_dump_test "pr20830b-now" +-run_dump_test "pr21038a-now" +-run_dump_test "pr21038b-now" +-run_dump_test "pr21038c-now" ++# run_dump_test "pltgot-1" ++# run_dump_test "pltgot-2" ++# run_dump_test "pr20830a" ++# run_dump_test "pr20830b" ++# run_dump_test "pr21038a" ++# run_dump_test "pr21038b" ++# run_dump_test "pr21038c" ++# run_dump_test "pr20830a-now" ++# run_dump_test "pr20830b-now" ++# run_dump_test "pr21038a-now" ++# run_dump_test "pr21038b-now" ++# run_dump_test "pr21038c-now" + run_dump_test "ibt-plt-1" + run_dump_test "ibt-plt-1-x32" + run_dump_test "ibt-plt-2a" diff --git a/SOURCES/binutils-x86_64-ibt-enabled-tlsdesc.patch b/SOURCES/binutils-x86_64-ibt-enabled-tlsdesc.patch new file mode 100644 index 0000000..d9ee5c4 --- /dev/null +++ b/SOURCES/binutils-x86_64-ibt-enabled-tlsdesc.patch @@ -0,0 +1,77 @@ +diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.30/bfd/elf64-x86-64.c +--- binutils.orig/bfd/elf64-x86-64.c 2018-10-08 15:24:17.980797510 +0100 ++++ binutils-2.30/bfd/elf64-x86-64.c 2018-10-08 15:25:02.643458607 +0100 +@@ -4399,15 +4399,23 @@ elf_x86_64_finish_dynamic_sections (bfd + + if (htab->tlsdesc_plt) + { ++ /* The TLSDESC entry in a lazy procedure linkage table. */ ++ static const bfd_byte tlsdesc_plt_entry[LAZY_PLT_ENTRY_SIZE] = ++ { ++ 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */ ++ 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */ ++ 0xff, 0x25, 16, 0, 0, 0 /* jmpq *GOT+TDG(%rip) */ ++ }; ++ + bfd_put_64 (output_bfd, (bfd_vma) 0, + htab->elf.sgot->contents + htab->tlsdesc_got); + + memcpy (htab->elf.splt->contents + htab->tlsdesc_plt, +- htab->lazy_plt->plt0_entry, +- htab->lazy_plt->plt0_entry_size); ++ tlsdesc_plt_entry, LAZY_PLT_ENTRY_SIZE); + +- /* Add offset for pushq GOT+8(%rip), since the +- instruction uses 6 bytes subtract this value. */ ++ /* Add offset for pushq GOT+8(%rip), since ENDBR64 uses 4 ++ bytes and the instruction uses 6 bytes, subtract these ++ values. */ + bfd_put_32 (output_bfd, + (htab->elf.sgotplt->output_section->vma + + htab->elf.sgotplt->output_offset +@@ -4415,14 +4423,13 @@ elf_x86_64_finish_dynamic_sections (bfd + - htab->elf.splt->output_section->vma + - htab->elf.splt->output_offset + - htab->tlsdesc_plt +- - 6), ++ - 4 - 6), + (htab->elf.splt->contents + + htab->tlsdesc_plt +- + htab->lazy_plt->plt0_got1_offset)); +- /* Add offset for the PC-relative instruction accessing +- GOT+TDG, where TDG stands for htab->tlsdesc_got, +- subtracting the offset to the end of that +- instruction. */ ++ + 4 + 2)); ++ /* Add offset for indirect branch via GOT+TDG, where TDG ++ stands for htab->tlsdesc_got, subtracting the offset ++ to the end of that instruction. */ + bfd_put_32 (output_bfd, + (htab->elf.sgot->output_section->vma + + htab->elf.sgot->output_offset +@@ -4430,10 +4437,9 @@ elf_x86_64_finish_dynamic_sections (bfd + - htab->elf.splt->output_section->vma + - htab->elf.splt->output_offset + - htab->tlsdesc_plt +- - htab->lazy_plt->plt0_got2_insn_end), ++ - 4 - 6 - 6), + (htab->elf.splt->contents +- + htab->tlsdesc_plt +- + htab->lazy_plt->plt0_got2_offset)); ++ + htab->tlsdesc_plt + 4 + 6 + 2)); + } + } + +Only in binutils-2.30/bfd: elf64-x86-64.c.orig +diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlsdesc.pd binutils-2.30/ld/testsuite/ld-x86-64/tlsdesc.pd +--- binutils.orig/ld/testsuite/ld-x86-64/tlsdesc.pd 2018-10-08 15:24:17.293802722 +0100 ++++ binutils-2.30/ld/testsuite/ld-x86-64/tlsdesc.pd 2018-10-08 15:25:07.515421664 +0100 +@@ -13,7 +13,7 @@ Disassembly of section .plt: + [0-9a-f]+: ff 35 .. .. 20 00 pushq .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> + [0-9a-f]+: ff 25 .. .. 20 00 jmpq \*.*\(%rip\) # 201360 <_GLOBAL_OFFSET_TABLE_\+0x10> + [0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\) ++ [0-9a-f]+: f3 0f 1e fa endbr64 + [0-9a-f]+: ff 35 .. .. 20 00 pushq .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> + [0-9a-f]+: ff 25 .. .. 20 00 jmpq \*.*\(%rip\) # 201348 <.*> +- [0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\) + diff --git a/SOURCES/binutils-x86_JCC_Erratum.patch b/SOURCES/binutils-x86_JCC_Erratum.patch new file mode 100644 index 0000000..3c42d33 --- /dev/null +++ b/SOURCES/binutils-x86_JCC_Erratum.patch @@ -0,0 +1,3733 @@ +diff -rupN binutils.orig/gas/config/tc-i386.c binutils-2.30/gas/config/tc-i386.c +--- binutils.orig/gas/config/tc-i386.c 2019-11-20 10:59:21.586883777 +0000 ++++ binutils-2.30/gas/config/tc-i386.c 2019-11-20 15:25:34.197910787 +0000 +@@ -392,6 +392,9 @@ struct _i386_insn + + /* Error message. */ + enum i386_error error; ++ ++ /* Has GOTPC relocation. */ ++ bfd_boolean has_gotpc_reloc; + }; + + typedef struct _i386_insn i386_insn; +@@ -521,6 +524,8 @@ static enum flag_code flag_code; + static unsigned int object_64bit; + static unsigned int disallow_64bit_reloc; + static int use_rela_relocations = 0; ++/* __tls_get_addr/___tls_get_addr symbol for TLS. */ ++static const char *tls_get_addr; + + #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \ + || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) \ +@@ -584,6 +589,21 @@ static int omit_lock_prefix = 0; + "lock addl $0, (%{re}sp)". */ + static int avoid_fence = 0; + ++/* Type of the previous instruction. */ ++static struct ++{ ++ segT seg; ++ const char *file; ++ const char *name; ++ unsigned int line; ++ enum last_insn_kind ++ { ++ last_insn_other = 0, ++ last_insn_directive, ++ last_insn_prefix ++ } kind; ++} last_insn; ++ + /* 1 if the assembler should generate relax relocations. */ + + static int generate_relax_relocations +@@ -597,6 +617,31 @@ static enum check_kind + } + sse_check, operand_check = check_warning; + ++/* Non-zero if branches should be aligned within power of 2 boundary. */ ++static int align_branch_power = 0; ++ ++/* Types of branches to align. */ ++enum align_branch_kind ++ { ++ align_branch_none = 0, ++ align_branch_jcc = 1 << 0, ++ align_branch_fused = 1 << 1, ++ align_branch_jmp = 1 << 2, ++ align_branch_call = 1 << 3, ++ align_branch_indirect = 1 << 4, ++ align_branch_ret = 1 << 5 ++ }; ++ ++static unsigned int align_branch = (align_branch_jcc ++ | align_branch_fused ++ | align_branch_jmp); ++ ++/* The maximum padding size for fused jcc. */ ++#define MAX_FUSED_JCC_PADDING_SIZE 20 ++ ++/* The maximum number of prefixes added for an instruction. */ ++static unsigned int align_branch_prefix_size = 5; ++ + /* Register prefix used for error message. */ + static const char *register_prefix = "%"; + +@@ -677,12 +722,19 @@ int x86_cie_data_alignment; + /* Interface to relax_segment. + There are 3 major relax states for 386 jump insns because the + different types of jumps add different sizes to frags when we're +- figuring out what sort of jump to choose to reach a given label. */ ++ figuring out what sort of jump to choose to reach a given label. ++ ++ BRANCH_PADDING, BRANCH_PREFIX and FUSED_JCC_PADDING are used to align ++ branches which are handled by md_estimate_size_before_relax() and ++ i386_generic_table_relax_frag(). */ + + /* Types. */ + #define UNCOND_JUMP 0 + #define COND_JUMP 1 + #define COND_JUMP86 2 ++#define BRANCH_PADDING 3 ++#define BRANCH_PREFIX 4 ++#define FUSED_JCC_PADDING 5 + + /* Sizes. */ + #define CODE16 1 +@@ -1402,7 +1454,9 @@ i386_align_code (fragS *fragP, int count + patt [padding - 1], padding); + } + } +- fragP->fr_var = count; ++ ++ if (fragP->fr_type != rs_machine_dependent) ++ fragP->fr_var = count; + } + + static INLINE int +@@ -2807,6 +2861,11 @@ md_begin (void) + x86_dwarf2_return_column = 8; + x86_cie_data_alignment = -4; + } ++ ++ /* NB: FUSED_JCC_PADDING frag must have sufficient room so that it ++ can be turned into BRANCH_PREFIX frag. */ ++ if (align_branch_prefix_size > MAX_FUSED_JCC_PADDING_SIZE) ++ abort (); + } + + void +@@ -3929,6 +3988,17 @@ md_assemble (char *line) + + /* We are ready to output the insn. */ + output_insn (); ++ ++ last_insn.seg = now_seg; ++ ++ if (i.tm.opcode_modifier.isprefix) ++ { ++ last_insn.kind = last_insn_prefix; ++ last_insn.name = i.tm.name; ++ last_insn.file = as_where (&last_insn.line); ++ } ++ else ++ last_insn.kind = last_insn_other; + } + + static char * +@@ -7162,11 +7232,202 @@ output_interseg_jump (void) + md_number_to_chars (p + size, (valueT) i.op[0].imms->X_add_number, 2); + } + ++/* Return TRUE for test, and, cmp, add, sub, inc and dec which may ++ be macro-fused with conditional jumps. */ ++ ++static bfd_boolean ++maybe_fused_with_jcc_p (void) ++{ ++ /* No RIP address. */ ++ if (i.base_reg && i.base_reg->reg_num == RegRip) ++ return FALSE; ++ ++ /* and, add, sub with destination register. */ ++ if (!strcmp (i.tm.name, "and") ++ || !strcmp (i.tm.name, "add") ++ || !strcmp (i.tm.name, "sub")) ++ return i.types[1].bitfield.reg; ++ ++ /* test, cmp with any register. */ ++ if (!strcmp (i.tm.name, "test") || !strcmp (i.tm.name, "cmp")) ++ return (i.types[0].bitfield.reg ++ || i.types[1].bitfield.reg); ++ ++ /* inc, dec with 16/32/64-bit register. */ ++ if (!strcmp (i.tm.name, "inc") || !strcmp (i.tm.name, "dec")) ++ return i.types[0].bitfield.reg; ++ ++ return FALSE; ++} ++ ++/* Return TRUE if a FUSED_JCC_PADDING frag should be generated. */ ++ ++static bfd_boolean ++add_fused_jcc_padding_frag_p (void) ++{ ++ if (!align_branch_power ++ || now_seg == absolute_section ++ || !cpu_arch_flags.bitfield.cpui386 ++ || !(align_branch & align_branch_fused)) ++ return FALSE; ++ ++ if (maybe_fused_with_jcc_p ()) ++ { ++ if (last_insn.kind != last_insn_other ++ && last_insn.seg == now_seg) ++ { ++ if (flag_debug) ++ as_warn_where (last_insn.file, last_insn.line, ++ _("`%s` skips -malign-branch-boundary on `%s`"), ++ last_insn.name, i.tm.name); ++ return FALSE; ++ } ++ return TRUE; ++ } ++ ++ return FALSE; ++} ++ ++/* Return TRUE if a BRANCH_PREFIX frag should be generated. */ ++ ++static bfd_boolean ++add_branch_prefix_frag_p (void) ++{ ++ if (!align_branch_power ++ || now_seg == absolute_section ++ || i.tm.cpu_flags.bitfield.cpupadlock ++ || !cpu_arch_flags.bitfield.cpui386) ++ return FALSE; ++ ++ /* Don't add prefix if it is a prefix or there is no operand. */ ++ if (!i.operands || i.tm.opcode_modifier.isprefix) ++ return FALSE; ++ ++ if (last_insn.kind != last_insn_other ++ && last_insn.seg == now_seg) ++ { ++ if (flag_debug) ++ as_warn_where (last_insn.file, last_insn.line, ++ _("`%s` skips -malign-branch-boundary on `%s`"), ++ last_insn.name, i.tm.name); ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++/* Return TRUE if a BRANCH_PADDING frag should be generated. */ ++ ++static int ++add_branch_padding_frag_p (enum align_branch_kind *branch_p) ++{ ++ bfd_boolean add_padding; ++ ++ if (!align_branch_power ++ || now_seg == absolute_section ++ || !cpu_arch_flags.bitfield.cpui386) ++ return FALSE; ++ ++ add_padding = FALSE; ++ ++ /* Check for jcc and direct jmp. */ ++ if (i.tm.opcode_modifier.jump) ++ { ++ if (i.tm.base_opcode == JUMP_PC_RELATIVE) ++ { ++ *branch_p = align_branch_jmp; ++ add_padding = align_branch & align_branch_jmp; ++ } ++ else ++ { ++ *branch_p = align_branch_jcc; ++ if ((align_branch & align_branch_jcc)) ++ add_padding = TRUE; ++ } ++ } ++ else if (i.tm.base_opcode == 0xc2 ++ || i.tm.base_opcode == 0xc3 ++ || i.tm.base_opcode == 0xca ++ || i.tm.base_opcode == 0xcb) ++ { ++ *branch_p = align_branch_ret; ++ if ((align_branch & align_branch_ret)) ++ add_padding = TRUE; ++ } ++ else ++ { ++ if (i.tm.base_opcode == 0xe8) ++ { ++ *branch_p = align_branch_call; ++ if ((align_branch & align_branch_call)) ++ add_padding = TRUE; ++ } ++ else if (i.tm.base_opcode == 0xff ++ && (i.rm.reg == 2 || i.rm.reg == 4)) ++ { ++ *branch_p = align_branch_indirect; ++ if ((align_branch & align_branch_indirect)) ++ add_padding = TRUE; ++ } ++ ++ /* Check for indirect jmp, direct and indirect calls. */ ++ if (add_padding ++ && i.disp_operands ++ && tls_get_addr ++ && (i.op[0].disps->X_op == O_symbol ++ || (i.op[0].disps->X_op == O_subtract ++ && i.op[0].disps->X_op_symbol == GOT_symbol))) ++ { ++ symbolS *s = i.op[0].disps->X_add_symbol; ++ /* No padding to call to global or undefined tls_get_addr. */ ++ if ((S_IS_EXTERNAL (s) || !S_IS_DEFINED (s)) ++ && strcmp (S_GET_NAME (s), tls_get_addr) == 0) ++ return FALSE; ++ } ++ } ++ ++ if (add_padding ++ && last_insn.kind != last_insn_other ++ && last_insn.seg == now_seg) ++ { ++ if (flag_debug) ++ as_warn_where (last_insn.file, last_insn.line, ++ _("`%s` skips -malign-branch-boundary on `%s`"), ++ last_insn.name, i.tm.name); ++ return FALSE; ++ } ++ ++ return add_padding; ++} ++ ++static unsigned int ++encoding_length (const fragS *start_frag, offsetT start_off, ++ const char *frag_now_ptr) ++{ ++ unsigned int len = 0; ++ ++ if (start_frag != frag_now) ++ { ++ const fragS *fr = start_frag; ++ ++ do ++ { ++ len += fr->fr_fix; ++ fr = fr->fr_next; ++ } ++ while (fr && fr != frag_now); ++ } ++ ++ return len - start_off + (frag_now_ptr - frag_now->fr_literal); ++} ++ + static void + output_insn (void) + { + fragS *insn_start_frag; + offsetT insn_start_off; ++ fragS *fragP = NULL; ++ enum align_branch_kind branch = align_branch_none; + + /* Tie dwarf2 debug info to the address at the start of the insn. + We can't do this after the insn has been output as the current +@@ -7176,6 +7437,30 @@ output_insn (void) + insn_start_frag = frag_now; + insn_start_off = frag_now_fix (); + ++ if (add_branch_padding_frag_p (&branch)) ++ { ++ char *p; ++ unsigned int max_branch_padding_size = 14; ++ ++ /* Align section to boundary. */ ++ record_alignment (now_seg, align_branch_power); ++ ++ /* Make room for padding. */ ++ frag_grow (max_branch_padding_size); ++ ++ /* Start of the padding. */ ++ p = frag_more (0); ++ ++ fragP = frag_now; ++ ++ frag_var (rs_machine_dependent, max_branch_padding_size, 0, ++ ENCODE_RELAX_STATE (BRANCH_PADDING, 0), ++ NULL, 0, p); ++ ++ fragP->tc_frag_data.branch_type = branch; ++ fragP->tc_frag_data.max_bytes = max_branch_padding_size; ++ } ++ + /* Output jumps. */ + if (i.tm.opcode_modifier.jump) + output_branch (); +@@ -7217,6 +7502,44 @@ output_insn (void) + i.prefix[LOCK_PREFIX] = 0; + } + ++ if (branch) ++ /* Skip if this is a branch. */ ++ ; ++ else if (add_fused_jcc_padding_frag_p ()) ++ { ++ unsigned int max_fused_padding_size ++ = MAX_FUSED_JCC_PADDING_SIZE; ++ ++ /* Make room for padding. */ ++ frag_grow (max_fused_padding_size); ++ p = frag_more (0); ++ ++ fragP = frag_now; ++ ++ frag_var (rs_machine_dependent, max_fused_padding_size, 0, ++ ENCODE_RELAX_STATE (FUSED_JCC_PADDING, 0), ++ NULL, 0, p); ++ ++ fragP->tc_frag_data.branch_type = align_branch_fused; ++ fragP->tc_frag_data.max_bytes = max_fused_padding_size; ++ } ++ else if (add_branch_prefix_frag_p ()) ++ { ++ unsigned int max_prefix_size = align_branch_prefix_size; ++ ++ /* Make room for padding. */ ++ frag_grow (max_prefix_size); ++ p = frag_more (0); ++ ++ fragP = frag_now; ++ ++ frag_var (rs_machine_dependent, max_prefix_size, 0, ++ ENCODE_RELAX_STATE (BRANCH_PREFIX, 0), ++ NULL, 0, p); ++ ++ fragP->tc_frag_data.max_bytes = max_prefix_size; ++ } ++ + /* Since the VEX/EVEX prefix contains the implicit prefix, we + don't need the explicit prefix. */ + if (!i.tm.opcode_modifier.vex && !i.tm.opcode_modifier.evex) +@@ -7358,6 +7681,83 @@ check_prefix: + + if (i.imm_operands) + output_imm (insn_start_frag, insn_start_off); ++ ++ if (now_seg != absolute_section) ++ { ++ j = encoding_length (insn_start_frag, insn_start_off, frag_more (0)); ++ if (fragP) ++ { ++ /* NB: Don't add prefix with GOTPC relocation since ++ output_disp() above depends on the fixed encoding ++ length. */ ++ unsigned int max = i.has_gotpc_reloc ? 0 : 15 - j; ++ /* Prefix count on the current instruction. */ ++ unsigned int count = 0; ++ unsigned int k; ++ for (k = 0; k < ARRAY_SIZE (i.prefix); k++) ++ if (i.prefix[k]) ++ count++; ++ ++ /* NB: prefix count + instruction size must be <= 15. */ ++ if (j > 15) ++ as_fatal (_("instruction length of %u bytes exceeds the limit of 15"), ++ j); ++ ++ if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) ++ == BRANCH_PREFIX) ++ { ++ /* Set the maximum prefix size in BRANCH_PREFIX ++ frag. */ ++ if (fragP->tc_frag_data.max_bytes > max) ++ fragP->tc_frag_data.max_bytes = max; ++ if (fragP->tc_frag_data.max_bytes > count) ++ fragP->tc_frag_data.max_bytes -= count; ++ else ++ fragP->tc_frag_data.max_bytes = 0; ++ } ++ else ++ { ++ /* Remember the maximum prefix size in FUSED_JCC_PADDING ++ frag. */ ++ unsigned int max_prefix_size; ++ if (align_branch_prefix_size > max) ++ max_prefix_size = max; ++ else ++ max_prefix_size = align_branch_prefix_size; ++ if (max_prefix_size > count) ++ fragP->tc_frag_data.max_prefix_length ++ = max_prefix_size - count; ++ } ++ ++ /* Use existing segment prefix if possible. Use CS ++ segment prefix in 64-bit mode. In 32-bit mode, use SS ++ segment prefix with ESP/EBP base register and use DS ++ segment prefix without ESP/EBP base register. */ ++ if (i.prefix[SEG_PREFIX]) ++ fragP->tc_frag_data.default_prefix = i.prefix[SEG_PREFIX]; ++ else if (flag_code == CODE_64BIT) ++ fragP->tc_frag_data.default_prefix = CS_PREFIX_OPCODE; ++ else if (i.base_reg ++ && (i.base_reg->reg_num == 4 ++ || i.base_reg->reg_num == 5)) ++ fragP->tc_frag_data.default_prefix = SS_PREFIX_OPCODE; ++ else ++ fragP->tc_frag_data.default_prefix = DS_PREFIX_OPCODE; ++ } ++ else if (j > 15) ++ as_warn (_("instruction length of %u bytes exceeds the limit of 15"), ++ j); ++ } ++ } ++ ++ if (align_branch_power ++ && now_seg != absolute_section ++ && cpu_arch_flags.bitfield.cpui386) ++ { ++ /* Terminate each frag so that we can add prefix and check for ++ fused jcc. */ ++ frag_wane (frag_now); ++ frag_new (0); + } + + #ifdef DEBUG386 +@@ -7484,6 +7884,7 @@ output_disp (fragS *insn_start_frag, off + { + reloc_type = BFD_RELOC_386_GOTPC; + i.op[n].imms->X_add_number += add; ++ i.has_gotpc_reloc = TRUE; + } + else if (reloc_type == BFD_RELOC_64) + reloc_type = BFD_RELOC_X86_64_GOTPC64; +@@ -7649,6 +8050,7 @@ output_imm (fragS *insn_start_frag, offs + reloc_type = BFD_RELOC_X86_64_GOTPC32; + else if (size == 8) + reloc_type = BFD_RELOC_X86_64_GOTPC64; ++ i.has_gotpc_reloc = TRUE; + i.op[n].imms->X_add_number += add; + } + fix_new_exp (frag_now, p - frag_now->fr_literal, size, +@@ -9264,6 +9666,355 @@ elf_symbol_resolved_in_segment_p (symbol + } + #endif + ++/* Return the next non-empty frag. */ ++ ++static fragS * ++i386_next_non_empty_frag (fragS *fragP) ++{ ++ /* There may be a frag with a ".fill 0" when there is no room in ++ the current frag for frag_grow in output_insn. */ ++ for (fragP = fragP->fr_next; ++ (fragP != NULL ++ && fragP->fr_type == rs_fill ++ && fragP->fr_fix == 0); ++ fragP = fragP->fr_next) ++ ; ++ return fragP; ++} ++ ++/* Return the next jcc frag after BRANCH_PADDING. */ ++ ++static fragS * ++i386_next_jcc_frag (fragS *fragP) ++{ ++ if (!fragP) ++ return NULL; ++ ++ if (fragP->fr_type == rs_machine_dependent ++ && (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) ++ == BRANCH_PADDING)) ++ { ++ fragP = i386_next_non_empty_frag (fragP); ++ if (fragP->fr_type != rs_machine_dependent) ++ return NULL; ++ if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == COND_JUMP) ++ return fragP; ++ } ++ ++ return NULL; ++} ++ ++/* Classify BRANCH_PADDING, BRANCH_PREFIX and FUSED_JCC_PADDING frags. */ ++ ++static void ++i386_classify_machine_dependent_frag (fragS *fragP) ++{ ++ fragS *cmp_fragP; ++ fragS *pad_fragP; ++ fragS *branch_fragP; ++ fragS *next_fragP; ++ unsigned int max_prefix_length; ++ ++ if (fragP->tc_frag_data.classified) ++ return; ++ ++ /* First scan for BRANCH_PADDING and FUSED_JCC_PADDING. Convert ++ FUSED_JCC_PADDING and merge BRANCH_PADDING. */ ++ for (next_fragP = fragP; ++ next_fragP != NULL; ++ next_fragP = next_fragP->fr_next) ++ { ++ next_fragP->tc_frag_data.classified = 1; ++ if (next_fragP->fr_type == rs_machine_dependent) ++ switch (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype)) ++ { ++ case BRANCH_PADDING: ++ /* The BRANCH_PADDING frag must be followed by a branch ++ frag. */ ++ branch_fragP = i386_next_non_empty_frag (next_fragP); ++ next_fragP->tc_frag_data.u.branch_fragP = branch_fragP; ++ break; ++ case FUSED_JCC_PADDING: ++ /* Check if this is a fused jcc: ++ FUSED_JCC_PADDING ++ CMP ++ BRANCH_PADDING ++ COND_JUMP ++ */ ++ cmp_fragP = i386_next_non_empty_frag (next_fragP); ++ pad_fragP = i386_next_non_empty_frag (cmp_fragP); ++ branch_fragP = i386_next_jcc_frag (pad_fragP); ++ if (branch_fragP) ++ { ++ /* The BRANCH_PADDING frag is merged with the ++ FUSED_JCC_PADDING frag. */ ++ next_fragP->tc_frag_data.u.branch_fragP = branch_fragP; ++ /* CMP instruction size. */ ++ next_fragP->tc_frag_data.cmp_size = cmp_fragP->fr_fix; ++ frag_wane (pad_fragP); ++ /* Skip to branch_fragP. */ ++ next_fragP = branch_fragP; ++ } ++ else if (next_fragP->tc_frag_data.max_prefix_length) ++ { ++ /* Turn FUSED_JCC_PADDING into BRANCH_PREFIX if it isn't ++ a fused jcc. */ ++ next_fragP->fr_subtype ++ = ENCODE_RELAX_STATE (BRANCH_PREFIX, 0); ++ next_fragP->tc_frag_data.max_bytes ++ = next_fragP->tc_frag_data.max_prefix_length; ++ /* This will be updated in the BRANCH_PREFIX scan. */ ++ next_fragP->tc_frag_data.max_prefix_length = 0; ++ } ++ else ++ frag_wane (next_fragP); ++ break; ++ } ++ } ++ ++ /* Scan for BRANCH_PREFIX. */ ++ for (; fragP != NULL; fragP = fragP->fr_next) ++ if (fragP->fr_type == rs_machine_dependent ++ && (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) ++ == BRANCH_PREFIX)) ++ { ++ /* Count all BRANCH_PREFIX frags before BRANCH_PADDING and ++ COND_JUMP_PREFIX. */ ++ max_prefix_length = 0; ++ for (next_fragP = fragP; ++ next_fragP != NULL; ++ next_fragP = next_fragP->fr_next) ++ { ++ if (next_fragP->fr_type == rs_fill) ++ /* Skip rs_fill frags. */ ++ ; ++ else if (next_fragP->fr_type == rs_machine_dependent) ++ { ++ if (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype) ++ == BRANCH_PREFIX) ++ { ++ /* Count BRANCH_PREFIX frags. */ ++ if (max_prefix_length >= MAX_FUSED_JCC_PADDING_SIZE) ++ { ++ max_prefix_length = MAX_FUSED_JCC_PADDING_SIZE; ++ frag_wane (next_fragP); ++ } ++ else ++ max_prefix_length ++ += next_fragP->tc_frag_data.max_bytes; ++ } ++ else if ((TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype) ++ == BRANCH_PADDING) ++ || (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype) ++ == FUSED_JCC_PADDING)) ++ { ++ /* Stop at BRANCH_PADDING and FUSED_JCC_PADDING. */ ++ fragP->tc_frag_data.u.padding_fragP = next_fragP; ++ break; ++ } ++ else ++ /* Stop for other rs_machine_dependent frags. */ ++ break; ++ } ++ else ++ /* Stop for all other frags. */ ++ break; ++ } ++ ++ fragP->tc_frag_data.max_prefix_length = max_prefix_length; ++ ++ /* Skip to the next frag. */ ++ fragP = next_fragP; ++ } ++} ++ ++/* Compute padding size for ++ ++ FUSED_JCC_PADDING ++ CMP ++ BRANCH_PADDING ++ COND_JUMP/UNCOND_JUMP ++ ++ or ++ ++ BRANCH_PADDING ++ COND_JUMP/UNCOND_JUMP ++ */ ++ ++static int ++i386_branch_padding_size (fragS *fragP, offsetT address) ++{ ++ unsigned int offset, size, padding_size; ++ fragS *branch_fragP = fragP->tc_frag_data.u.branch_fragP; ++ ++ /* The start address of the BRANCH_PADDING or FUSED_JCC_PADDING frag. */ ++ if (!address) ++ address = fragP->fr_address; ++ address += fragP->fr_fix; ++ ++ /* CMP instrunction size. */ ++ size = fragP->tc_frag_data.cmp_size; ++ ++ /* The base size of the branch frag. */ ++ size += branch_fragP->fr_fix; ++ ++ /* Add opcode and displacement bytes for the rs_machine_dependent ++ branch frag. */ ++ if (branch_fragP->fr_type == rs_machine_dependent) ++ size += md_relax_table[branch_fragP->fr_subtype].rlx_length; ++ ++ /* Check if branch is within boundary and doesn't end at the last ++ byte. */ ++ offset = address & ((1U << align_branch_power) - 1); ++ if ((offset + size) >= (1U << align_branch_power)) ++ /* Padding needed to avoid crossing boundary. */ ++ padding_size = (1 << align_branch_power) - offset; ++ else ++ /* No padding needed. */ ++ padding_size = 0; ++ ++ if (!fits_in_signed_byte (padding_size)) ++ abort (); ++ ++ return padding_size; ++} ++ ++/* i386_generic_table_relax_frag() ++ ++ Handle BRANCH_PADDING, BRANCH_PREFIX and FUSED_JCC_PADDING frags to ++ grow/shrink padding to align branch frags. Hand others to ++ relax_frag(). */ ++ ++long ++i386_generic_table_relax_frag (segT segment, fragS *fragP, long stretch) ++{ ++ if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PADDING ++ || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == FUSED_JCC_PADDING) ++ { ++ long padding_size = i386_branch_padding_size (fragP, 0); ++ long grow = padding_size - fragP->tc_frag_data.length; ++ ++ /* When the BRANCH_PREFIX frag is used, the computed address ++ must match the actual address and there should be no padding. */ ++ if (fragP->tc_frag_data.padding_address ++ && (fragP->tc_frag_data.padding_address != fragP->fr_address ++ || padding_size)) ++ abort (); ++ ++ /* Update the padding size. */ ++ if (grow) ++ fragP->tc_frag_data.length = padding_size; ++ ++ return grow; ++ } ++ else if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PREFIX) ++ { ++ fragS *padding_fragP, *next_fragP; ++ long padding_size, left_size, last_size; ++ ++ padding_fragP = fragP->tc_frag_data.u.padding_fragP; ++ if (!padding_fragP) ++ /* Use the padding set by the leading BRANCH_PREFIX frag. */ ++ return (fragP->tc_frag_data.length ++ - fragP->tc_frag_data.last_length); ++ ++ /* Compute the relative address of the padding frag in the very ++ first time where the BRANCH_PREFIX frag sizes are zero. */ ++ if (!fragP->tc_frag_data.padding_address) ++ fragP->tc_frag_data.padding_address ++ = padding_fragP->fr_address - (fragP->fr_address - stretch); ++ ++ /* First update the last length from the previous interation. */ ++ left_size = fragP->tc_frag_data.prefix_length; ++ for (next_fragP = fragP; ++ next_fragP != padding_fragP; ++ next_fragP = next_fragP->fr_next) ++ if (next_fragP->fr_type == rs_machine_dependent ++ && (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype) ++ == BRANCH_PREFIX)) ++ { ++ if (left_size) ++ { ++ int max = next_fragP->tc_frag_data.max_bytes; ++ if (max) ++ { ++ int size; ++ if (max > left_size) ++ size = left_size; ++ else ++ size = max; ++ left_size -= size; ++ next_fragP->tc_frag_data.last_length = size; ++ } ++ } ++ else ++ next_fragP->tc_frag_data.last_length = 0; ++ } ++ ++ /* Check the padding size for the padding frag. */ ++ padding_size = i386_branch_padding_size ++ (padding_fragP, (fragP->fr_address ++ + fragP->tc_frag_data.padding_address)); ++ ++ last_size = fragP->tc_frag_data.prefix_length; ++ /* Check if there is change from the last interation. */ ++ if (padding_size == last_size) ++ { ++ /* Update the expected address of the padding frag. */ ++ padding_fragP->tc_frag_data.padding_address ++ = (fragP->fr_address + padding_size ++ + fragP->tc_frag_data.padding_address); ++ return 0; ++ } ++ ++ if (padding_size > fragP->tc_frag_data.max_prefix_length) ++ { ++ /* No padding if there is no sufficient room. Clear the ++ expected address of the padding frag. */ ++ padding_fragP->tc_frag_data.padding_address = 0; ++ padding_size = 0; ++ } ++ else ++ /* Store the expected address of the padding frag. */ ++ padding_fragP->tc_frag_data.padding_address ++ = (fragP->fr_address + padding_size ++ + fragP->tc_frag_data.padding_address); ++ ++ fragP->tc_frag_data.prefix_length = padding_size; ++ ++ /* Update the length for the current interation. */ ++ left_size = padding_size; ++ for (next_fragP = fragP; ++ next_fragP != padding_fragP; ++ next_fragP = next_fragP->fr_next) ++ if (next_fragP->fr_type == rs_machine_dependent ++ && (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype) ++ == BRANCH_PREFIX)) ++ { ++ if (left_size) ++ { ++ int max = next_fragP->tc_frag_data.max_bytes; ++ if (max) ++ { ++ int size; ++ if (max > left_size) ++ size = left_size; ++ else ++ size = max; ++ left_size -= size; ++ next_fragP->tc_frag_data.length = size; ++ } ++ } ++ else ++ next_fragP->tc_frag_data.length = 0; ++ } ++ ++ return (fragP->tc_frag_data.length ++ - fragP->tc_frag_data.last_length); ++ } ++ return relax_frag (segment, fragP, stretch); ++} ++ + /* md_estimate_size_before_relax() + + Called just before relax() for rs_machine_dependent frags. The x86 +@@ -9280,6 +10031,14 @@ elf_symbol_resolved_in_segment_p (symbol + int + md_estimate_size_before_relax (fragS *fragP, segT segment) + { ++ if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PADDING ++ || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PREFIX ++ || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == FUSED_JCC_PADDING) ++ { ++ i386_classify_machine_dependent_frag (fragP); ++ return fragP->tc_frag_data.length; ++ } ++ + /* We've already got fragP->fr_subtype right; all we have to do is + check for un-relaxable symbols. On an ELF system, we can't relax + an externally visible symbol, because it may be overridden by a +@@ -9409,6 +10168,109 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNU + unsigned int extension = 0; + offsetT displacement_from_opcode_start; + ++ if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PADDING ++ || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == FUSED_JCC_PADDING ++ || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PREFIX) ++ { ++ /* Generate nop padding. */ ++ unsigned int size = fragP->tc_frag_data.length; ++ ++ if (size == 0) ++ return; ++ ++ if (size > fragP->tc_frag_data.max_bytes) ++ abort (); ++ ++ if (flag_debug) ++ { ++ const char *msg; ++ const char *branch = "branch"; ++ const char *prefix = ""; ++ fragS *padding_fragP; ++ ++ if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) ++ == BRANCH_PREFIX) ++ { ++ padding_fragP = fragP->tc_frag_data.u.padding_fragP; ++ switch (fragP->tc_frag_data.default_prefix) ++ { ++ default: ++ abort (); ++ break; ++ case CS_PREFIX_OPCODE: ++ prefix = " cs"; ++ break; ++ case DS_PREFIX_OPCODE: ++ prefix = " ds"; ++ break; ++ case ES_PREFIX_OPCODE: ++ prefix = " es"; ++ break; ++ case FS_PREFIX_OPCODE: ++ prefix = " fs"; ++ break; ++ case GS_PREFIX_OPCODE: ++ prefix = " gs"; ++ break; ++ case SS_PREFIX_OPCODE: ++ prefix = " ss"; ++ break; ++ } ++ if (padding_fragP) ++ msg = _("%s:%u: add %d%s at 0x%llx to align " ++ "%s within %d-byte boundary\n"); ++ else ++ msg = _("%s:%u: add additional %d%s at 0x%llx to " ++ "align %s within %d-byte boundary\n"); ++ } ++ else ++ { ++ padding_fragP = fragP; ++ msg = _("%s:%u: add %d%s-byte nop at 0x%llx to align " ++ "%s within %d-byte boundary\n"); ++ } ++ ++ if (padding_fragP) ++ switch (padding_fragP->tc_frag_data.branch_type) ++ { ++ case align_branch_jcc: ++ branch = "jcc"; ++ break; ++ case align_branch_fused: ++ branch = "fused jcc"; ++ break; ++ case align_branch_jmp: ++ branch = "jmp"; ++ break; ++ case align_branch_call: ++ branch = "call"; ++ break; ++ case align_branch_indirect: ++ branch = "indiret branch"; ++ break; ++ case align_branch_ret: ++ branch = "ret"; ++ break; ++ default: ++ break; ++ } ++ ++ fprintf (stdout, msg, ++ fragP->fr_file, fragP->fr_line, size, prefix, ++ (long long) fragP->fr_address, branch, ++ 1 << align_branch_power); ++ } ++ ++ if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PREFIX) ++ memset (fragP->fr_opcode, ++ fragP->tc_frag_data.default_prefix, size); ++ else ++ i386_align_code (fragP, size); ++ fragP->fr_fix += size; ++ ++ return; ++ } ++ + opcode = (unsigned char *) fragP->fr_opcode; + + /* Address we want to reach in file space. */ +@@ -9963,6 +10825,10 @@ const char *md_shortopts = "qn"; + #define OPTION_MINTEL64 (OPTION_MD_BASE + 23) + #define OPTION_MFENCE_AS_LOCK_ADD (OPTION_MD_BASE + 24) + #define OPTION_MRELAX_RELOCATIONS (OPTION_MD_BASE + 25) ++#define OPTION_MALIGN_BRANCH_BOUNDARY (OPTION_MD_BASE + 27) ++#define OPTION_MALIGN_BRANCH_PREFIX_SIZE (OPTION_MD_BASE + 28) ++#define OPTION_MALIGN_BRANCH (OPTION_MD_BASE + 29) ++#define OPTION_MBRANCHES_WITH_32B_BOUNDARIES (OPTION_MD_BASE + 30) + + struct option md_longopts[] = + { +@@ -9997,6 +10863,10 @@ struct option md_longopts[] = + {"mfence-as-lock-add", required_argument, NULL, OPTION_MFENCE_AS_LOCK_ADD}, + {"mrelax-relocations", required_argument, NULL, OPTION_MRELAX_RELOCATIONS}, + {"mevexrcig", required_argument, NULL, OPTION_MEVEXRCIG}, ++ {"malign-branch-boundary", required_argument, NULL, OPTION_MALIGN_BRANCH_BOUNDARY}, ++ {"malign-branch-prefix-size", required_argument, NULL, OPTION_MALIGN_BRANCH_PREFIX_SIZE}, ++ {"malign-branch", required_argument, NULL, OPTION_MALIGN_BRANCH}, ++ {"mbranches-within-32B-boundaries", no_argument, NULL, OPTION_MBRANCHES_WITH_32B_BOUNDARIES}, + {"mamd64", no_argument, NULL, OPTION_MAMD64}, + {"mintel64", no_argument, NULL, OPTION_MINTEL64}, + {NULL, no_argument, NULL, 0} +@@ -10007,7 +10877,7 @@ int + md_parse_option (int c, const char *arg) + { + unsigned int j; +- char *arch, *next, *saved; ++ char *arch, *next, *saved, *type; + + switch (c) + { +@@ -10110,6 +10980,82 @@ md_parse_option (int c, const char *arg) + #endif + break; + ++ case OPTION_MALIGN_BRANCH_BOUNDARY: ++ { ++ char *end; ++ int align = strtoul (arg, &end, 0); ++ ++ if (*end == '\0') ++ { ++ if (align == 0) ++ { ++ align_branch_power = 0; ++ break; ++ } ++ else if (align >= 32) ++ { ++ int align_power; ++ ++ for (align_power = 0; ++ (align & 1) == 0; ++ align >>= 1, align_power++) ++ continue; ++ ++ if (align == 1) ++ { ++ align_branch_power = align_power; ++ break; ++ } ++ } ++ } ++ as_fatal (_("invalid -malign-branch-boundary= value: %s"), arg); ++ } ++ break; ++ ++ case OPTION_MALIGN_BRANCH_PREFIX_SIZE: ++ { ++ char *end; ++ int align = strtoul (arg, &end, 0); ++ ++ if (*end == '\0' && align >= 0 && align < 6) ++ { ++ align_branch_prefix_size = align; ++ break; ++ } ++ as_fatal (_("invalid -malign-branch-prefix-size= value: %s"), ++ arg); ++ } ++ break; ++ ++ case OPTION_MALIGN_BRANCH: ++ align_branch = 0; ++ saved = xstrdup (arg); ++ type = saved; ++ do ++ { ++ next = strchr (type, '+'); ++ if (next) ++ *next++ = '\0'; ++ if (strcasecmp (type, "jcc") == 0) ++ align_branch |= align_branch_jcc; ++ else if (strcasecmp (type, "fused") == 0) ++ align_branch |= align_branch_fused; ++ else if (strcasecmp (type, "jmp") == 0) ++ align_branch |= align_branch_jmp; ++ else if (strcasecmp (type, "call") == 0) ++ align_branch |= align_branch_call; ++ else if (strcasecmp (type, "ret") == 0) ++ align_branch |= align_branch_ret; ++ else if (strcasecmp (type, "indirect") == 0) ++ align_branch |= align_branch_indirect; ++ else ++ as_fatal (_("invalid -malign-branch= option: `%s'"), arg); ++ type = next; ++ } ++ while (next != NULL); ++ free (saved); ++ break; ++ + case OPTION_MARCH: + saved = xstrdup (arg); + arch = saved; +@@ -10363,6 +11309,14 @@ md_parse_option (int c, const char *arg) + as_fatal (_("invalid -mrelax-relocations= option: `%s'"), arg); + break; + ++ case OPTION_MBRANCHES_WITH_32B_BOUNDARIES: ++ align_branch_power = 5; ++ align_branch_prefix_size = 5; ++ align_branch = (align_branch_jcc ++ | align_branch_fused ++ | align_branch_jmp); ++ break; ++ + case OPTION_MAMD64: + intel64 = 0; + break; +@@ -10567,6 +11521,20 @@ md_show_usage (FILE *stream) + -mrelax-relocations=[no|yes]\n\ + generate relax relocations\n")); + fprintf (stream, _("\ ++ -malign-branch-boundary=NUM (default: 0)\n\ ++ align branches within NUM byte boundary\n")); ++ fprintf (stream, _("\ ++ -malign-branch=TYPE[+TYPE...] (default: jcc+fused+jmp)\n\ ++ TYPE is combination of jcc, fused, jmp, call, ret,\n\ ++ indirect\n\ ++ specify types of branches to align\n")); ++ fprintf (stream, _("\ ++ -malign-branch-prefix-size=NUM (default: 5)\n\ ++ align branches with NUM prefixes per instruction\n")); ++ fprintf (stream, _("\ ++ -mbranches-within-32B-boundaries\n\ ++ align branches within 32 byte boundary\n")); ++ fprintf (stream, _("\ + -mamd64 accept only AMD64 ISA\n")); + fprintf (stream, _("\ + -mintel64 accept only Intel64 ISA\n")); +@@ -10650,17 +11618,26 @@ i386_target_format (void) + { + default: + format = ELF_TARGET_FORMAT; ++#ifndef TE_SOLARIS ++ tls_get_addr = "___tls_get_addr"; ++#endif + break; + case X86_64_ABI: + use_rela_relocations = 1; + object_64bit = 1; + format = ELF_TARGET_FORMAT64; ++#ifndef TE_SOLARIS ++ tls_get_addr = "__tls_get_addr"; ++#endif + break; + case X86_64_X32_ABI: + use_rela_relocations = 1; + object_64bit = 1; + disallow_64bit_reloc = 1; + format = ELF_TARGET_FORMAT32; ++#ifndef TE_SOLARIS ++ tls_get_addr = "__tls_get_addr"; ++#endif + break; + } + if (cpu_arch_isa == PROCESSOR_L1OM) +@@ -10775,6 +11752,21 @@ s_bss (int ignore ATTRIBUTE_UNUSED) + + #endif + ++/* Remember constant diretive. */ ++ ++void ++i386_cons_worker (int ignore ATTRIBUTE_UNUSED) ++{ ++ if (last_insn.kind != last_insn_directive ++ && (bfd_get_section_flags (NULL, now_seg) & SEC_CODE)) ++ { ++ last_insn.seg = now_seg; ++ last_insn.kind = last_insn_directive; ++ last_insn.name = "constant diretive"; ++ last_insn.file = as_where (&last_insn.line); ++ } ++} ++ + void + i386_validate_fix (fixS *fixp) + { +diff -rupN binutils.orig/gas/config/tc-i386.h binutils-2.30/gas/config/tc-i386.h +--- binutils.orig/gas/config/tc-i386.h 2019-11-20 10:59:21.585883785 +0000 ++++ binutils-2.30/gas/config/tc-i386.h 2019-11-20 15:24:24.677440688 +0000 +@@ -215,12 +215,19 @@ if (fragP->fr_type == rs_align_code) + - fragP->fr_address \ + - fragP->fr_fix)); + ++extern void i386_cons_worker (int); ++#define md_cons_align(nbytes) i386_cons_worker (nbytes) ++ + void i386_print_statistics (FILE *); + #define tc_print_statistics i386_print_statistics + + extern unsigned int i386_frag_max_var (fragS *); + #define md_frag_max_var i386_frag_max_var + ++extern long i386_generic_table_relax_frag (segT, fragS *, long); ++#define md_generic_table_relax_frag(segment, fragP, stretch) \ ++ i386_generic_table_relax_frag (segment, fragP, stretch) ++ + #define md_number_to_chars number_to_chars_littleendian + + enum processor_type +@@ -255,9 +262,24 @@ extern i386_cpu_flags cpu_arch_isa_flags + + struct i386_tc_frag_data + { ++ union ++ { ++ fragS *padding_fragP; ++ fragS *branch_fragP; ++ } u; ++ addressT padding_address; + enum processor_type isa; + i386_cpu_flags isa_flags; ++ unsigned int max_bytes; + enum processor_type tune; ++ signed char length; ++ signed char last_length; ++ signed char max_prefix_length; ++ signed char prefix_length; ++ signed char default_prefix; ++ signed char cmp_size; ++ unsigned int classified : 1; ++ unsigned int branch_type : 7; + }; + + /* We need to emit the right NOP pattern in .align frags. This is +@@ -268,9 +290,20 @@ struct i386_tc_frag_data + #define TC_FRAG_INIT(FRAGP) \ + do \ + { \ ++ (FRAGP)->tc_frag_data.u.padding_fragP = NULL; \ ++ (FRAGP)->tc_frag_data.padding_address = 0; \ + (FRAGP)->tc_frag_data.isa = cpu_arch_isa; \ + (FRAGP)->tc_frag_data.isa_flags = cpu_arch_isa_flags; \ + (FRAGP)->tc_frag_data.tune = cpu_arch_tune; \ ++ (FRAGP)->tc_frag_data.length = 0; \ ++ (FRAGP)->tc_frag_data.max_bytes = max_chars; \ ++ (FRAGP)->tc_frag_data.last_length = 0; \ ++ (FRAGP)->tc_frag_data.max_prefix_length = 0; \ ++ (FRAGP)->tc_frag_data.prefix_length = 0; \ ++ (FRAGP)->tc_frag_data.default_prefix = 0; \ ++ (FRAGP)->tc_frag_data.cmp_size = 0; \ ++ (FRAGP)->tc_frag_data.classified = 0; \ ++ (FRAGP)->tc_frag_data.branch_type = 0; \ + } \ + while (0) + +diff -rupN binutils.orig/gas/doc/c-i386.texi binutils-2.30/gas/doc/c-i386.texi +--- binutils.orig/gas/doc/c-i386.texi 2019-11-20 10:59:21.590883746 +0000 ++++ binutils-2.30/gas/doc/c-i386.texi 2019-11-20 15:08:24.874736461 +0000 +@@ -389,6 +389,43 @@ R_X86_64_REX_GOTPCRELX, in 64-bit mode. + relocations. The default can be controlled by a configure option + @option{--enable-x86-relax-relocations}. + ++@cindex @samp{-malign-branch-boundary=} option, i386 ++@cindex @samp{-malign-branch-boundary=} option, x86-64 ++@item -malign-branch-boundary=@var{NUM} ++This option controls how the assembler should align branches with segment ++prefixes or NOP. @var{NUM} must be a power of 2. It should be 0 or ++no less than 32. Branches will be aligned within @var{NUM} byte ++boundary. @option{-malign-branch-boundary=0}, which is the default, ++doesn't align branches. ++ ++@cindex @samp{-malign-branch=} option, i386 ++@cindex @samp{-malign-branch=} option, x86-64 ++@item -malign-branch=@var{TYPE}[+@var{TYPE}...] ++This option specifies types of branches to align. @var{TYPE} is ++combination of @samp{jcc}, which aligns conditional jumps, ++@samp{fused}, which aligns fused conditional jumps, @samp{jmp}, ++which aligns unconditional jumps, @samp{call} which aligns calls, ++@samp{ret}, which aligns rets, @samp{indirect}, which aligns indirect ++jumps and calls. The default is @option{-malign-branch=jcc+fused+jmp}. ++ ++@cindex @samp{-malign-branch-prefix-size=} option, i386 ++@cindex @samp{-malign-branch-prefix-size=} option, x86-64 ++@item -malign-branch-prefix-size=@var{NUM} ++This option specifies the maximum number of prefixes on an instruction ++to align branches. @var{NUM} should be between 0 and 5. The default ++@var{NUM} is 5. ++ ++@cindex @samp{-mbranches-within-32B-boundaries} option, i386 ++@cindex @samp{-mbranches-within-32B-boundaries} option, x86-64 ++@item -mbranches-within-32B-boundaries ++This option aligns conditional jumps, fused conditional jumps and ++unconditional jumps within 32 byte boundary with up to 5 segment prefixes ++on an instruction. It is equivalent to ++@option{-malign-branch-boundary=32} ++@option{-malign-branch=jcc+fused+jmp} ++@option{-malign-branch-prefix-size=5}. ++The default doesn't align branches. ++ + @cindex @samp{-mevexrcig=} option, i386 + @cindex @samp{-mevexrcig=} option, x86-64 + @item -mevexrcig=@var{rne} +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1a.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1a.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-1a.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1a.d 2019-11-20 14:09:25.593915106 +0000 +@@ -0,0 +1,77 @@ ++#source: align-branch-1.s ++#as: -malign-branch-boundary=32 ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 65 65 65 a3 01 00 00 00 gs gs mov %eax,%gs:0x1 ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 55 push %ebp ++ b: 55 push %ebp ++ c: 89 e5 mov %esp,%ebp ++ e: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 20: 39 c5 cmp %eax,%ebp ++ 22: 74 5e je 82 ++ 24: 3e 89 73 f4 mov %esi,%ds:-0xc\(%ebx\) ++ 28: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2b: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3d: 5d pop %ebp ++ 3e: 5d pop %ebp ++ 3f: 5d pop %ebp ++ 40: 74 40 je 82 ++ 42: 5d pop %ebp ++ 43: 74 3d je 82 ++ 45: 36 89 44 24 fc mov %eax,%ss:-0x4\(%esp\) ++ 4a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 4d: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 50: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 53: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 56: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 59: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5f: 5d pop %ebp ++ 60: eb 26 jmp 88 ++ 62: eb 24 jmp 88 ++ 64: eb 22 jmp 88 ++ 66: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 69: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 6c: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 6f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 72: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 75: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 78: 5d pop %ebp ++ 79: 5d pop %ebp ++ 7a: 39 c5 cmp %eax,%ebp ++ 7c: 74 04 je 82 ++ 7e: 66 90 xchg %ax,%ax ++ 80: eb 06 jmp 88 ++ 82: 8b 45 f4 mov -0xc\(%ebp\),%eax ++ 85: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 9a: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ a0: 89 75 0c mov %esi,0xc\(%ebp\) ++ a3: e9 [0-9a-f ]+ jmp .* ++ a8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ae: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b4: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ba: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ c0: 89 75 00 mov %esi,0x0\(%ebp\) ++ c3: 74 c3 je 88 ++ c5: 74 c1 je 88 ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1b.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1b.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-1b.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1b.d 2019-11-20 14:09:25.593915106 +0000 +@@ -0,0 +1,77 @@ ++#source: align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 65 65 65 a3 01 00 00 00 gs gs mov %eax,%gs:0x1 ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 55 push %ebp ++ b: 55 push %ebp ++ c: 89 e5 mov %esp,%ebp ++ e: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 20: 39 c5 cmp %eax,%ebp ++ 22: 74 5e je 82 ++ 24: 3e 89 73 f4 mov %esi,%ds:-0xc\(%ebx\) ++ 28: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2b: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3d: 5d pop %ebp ++ 3e: 5d pop %ebp ++ 3f: 5d pop %ebp ++ 40: 74 40 je 82 ++ 42: 5d pop %ebp ++ 43: 74 3d je 82 ++ 45: 36 89 44 24 fc mov %eax,%ss:-0x4\(%esp\) ++ 4a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 4d: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 50: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 53: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 56: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 59: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5f: 5d pop %ebp ++ 60: eb 26 jmp 88 ++ 62: eb 24 jmp 88 ++ 64: eb 22 jmp 88 ++ 66: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 69: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 6c: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 6f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 72: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 75: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 78: 5d pop %ebp ++ 79: 5d pop %ebp ++ 7a: 39 c5 cmp %eax,%ebp ++ 7c: 74 04 je 82 ++ 7e: 66 90 xchg %ax,%ax ++ 80: eb 06 jmp 88 ++ 82: 8b 45 f4 mov -0xc\(%ebp\),%eax ++ 85: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 9a: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ a0: 89 75 0c mov %esi,0xc\(%ebp\) ++ a3: e9 [0-9a-f ]+ jmp .* ++ a8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ae: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b4: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ba: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ c0: 89 75 00 mov %esi,0x0\(%ebp\) ++ c3: 74 c3 je 88 ++ c5: 74 c1 je 88 ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1c.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1c.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-1c.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1c.d 2019-11-20 14:09:25.594915098 +0000 +@@ -0,0 +1,77 @@ ++#source: align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch-prefix-size=1 ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 65 a3 01 00 00 00 mov %eax,%gs:0x1 ++ 6: 3e 55 ds push %ebp ++ 8: 3e 55 ds push %ebp ++ a: 55 push %ebp ++ b: 55 push %ebp ++ c: 89 e5 mov %esp,%ebp ++ e: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 20: 39 c5 cmp %eax,%ebp ++ 22: 74 5e je 82 ++ 24: 3e 89 73 f4 mov %esi,%ds:-0xc\(%ebx\) ++ 28: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2b: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3d: 5d pop %ebp ++ 3e: 5d pop %ebp ++ 3f: 5d pop %ebp ++ 40: 74 40 je 82 ++ 42: 5d pop %ebp ++ 43: 74 3d je 82 ++ 45: 36 89 44 24 fc mov %eax,%ss:-0x4\(%esp\) ++ 4a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 4d: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 50: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 53: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 56: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 59: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5f: 5d pop %ebp ++ 60: eb 26 jmp 88 ++ 62: eb 24 jmp 88 ++ 64: eb 22 jmp 88 ++ 66: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 69: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 6c: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 6f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 72: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 75: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 78: 5d pop %ebp ++ 79: 5d pop %ebp ++ 7a: 39 c5 cmp %eax,%ebp ++ 7c: 74 04 je 82 ++ 7e: 66 90 xchg %ax,%ax ++ 80: eb 06 jmp 88 ++ 82: 8b 45 f4 mov -0xc\(%ebp\),%eax ++ 85: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 9a: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ a0: 89 75 0c mov %esi,0xc\(%ebp\) ++ a3: e9 [0-9a-f ]+ jmp .* ++ a8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ae: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b4: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ba: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ c0: 89 75 00 mov %esi,0x0\(%ebp\) ++ c3: 74 c3 je 88 ++ c5: 74 c1 je 88 ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1d.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1d.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-1d.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1d.d 2019-11-20 14:09:25.594915098 +0000 +@@ -0,0 +1,76 @@ ++#source: align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch=fused+jcc ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 65 65 65 a3 01 00 00 00 gs gs mov %eax,%gs:0x1 ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 55 push %ebp ++ b: 55 push %ebp ++ c: 89 e5 mov %esp,%ebp ++ e: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 20: 39 c5 cmp %eax,%ebp ++ 22: 74 5b je 7f ++ 24: 3e 89 73 f4 mov %esi,%ds:-0xc\(%ebx\) ++ 28: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2b: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3d: 5d pop %ebp ++ 3e: 5d pop %ebp ++ 3f: 5d pop %ebp ++ 40: 74 3d je 7f ++ 42: 5d pop %ebp ++ 43: 74 3a je 7f ++ 45: 89 44 24 fc mov %eax,-0x4\(%esp\) ++ 49: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 4c: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 4f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 52: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5e: 5d pop %ebp ++ 5f: eb 24 jmp 85 ++ 61: eb 22 jmp 85 ++ 63: eb 20 jmp 85 ++ 65: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 68: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 6b: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 6e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 71: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 74: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 77: 5d pop %ebp ++ 78: 5d pop %ebp ++ 79: 39 c5 cmp %eax,%ebp ++ 7b: 74 02 je 7f ++ 7d: eb 06 jmp 85 ++ 7f: 8b 45 f4 mov -0xc\(%ebp\),%eax ++ 82: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 85: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 8b: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 91: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 97: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 9d: 89 75 0c mov %esi,0xc\(%ebp\) ++ a0: e9 [0-9a-f ]+ jmp .* ++ a5: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ab: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b1: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b7: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ bd: 89 75 00 mov %esi,0x0\(%ebp\) ++ c0: 74 c3 je 85 ++ c2: 74 c1 je 85 ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1e.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1e.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-1e.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1e.d 2019-11-20 14:09:25.594915098 +0000 +@@ -0,0 +1,77 @@ ++#source: align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch=jcc ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 65 a3 01 00 00 00 mov %eax,%gs:0x1 ++ 6: 55 push %ebp ++ 7: 55 push %ebp ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 89 e5 mov %esp,%ebp ++ c: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 12: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 15: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 18: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1e: 39 c5 cmp %eax,%ebp ++ 20: 74 5a je 7c ++ 22: 89 73 f4 mov %esi,-0xc\(%ebx\) ++ 25: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 28: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 2b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 5d pop %ebp ++ 3b: 5d pop %ebp ++ 3c: 5d pop %ebp ++ 3d: 74 3d je 7c ++ 3f: 5d pop %ebp ++ 40: 74 3a je 7c ++ 42: 89 44 24 fc mov %eax,-0x4\(%esp\) ++ 46: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 49: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 4c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 4f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 52: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5b: 5d pop %ebp ++ 5c: eb 24 jmp 82 ++ 5e: eb 22 jmp 82 ++ 60: eb 20 jmp 82 ++ 62: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 65: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 68: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 6b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 6e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 71: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 74: 5d pop %ebp ++ 75: 5d pop %ebp ++ 76: 39 c5 cmp %eax,%ebp ++ 78: 74 02 je 7c ++ 7a: eb 06 jmp 82 ++ 7c: 8b 45 f4 mov -0xc\(%ebp\),%eax ++ 7f: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 82: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 9a: 89 75 0c mov %esi,0xc\(%ebp\) ++ 9d: e9 [0-9a-f ]+ jmp .* ++ a2: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ a8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ae: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b4: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ba: 89 75 00 mov %esi,0x0\(%ebp\) ++ bd: 74 c3 je 82 ++ bf: 90 nop ++ c0: 74 c0 je 82 ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1f.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1f.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-1f.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1f.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,77 @@ ++#source: align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch=jcc+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 65 a3 01 00 00 00 mov %eax,%gs:0x1 ++ 6: 55 push %ebp ++ 7: 55 push %ebp ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 89 e5 mov %esp,%ebp ++ c: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 12: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 15: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 18: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1e: 39 c5 cmp %eax,%ebp ++ 20: 74 5c je 7e ++ 22: 89 73 f4 mov %esi,-0xc\(%ebx\) ++ 25: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 28: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 2b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 5d pop %ebp ++ 3b: 5d pop %ebp ++ 3c: 5d pop %ebp ++ 3d: 74 3f je 7e ++ 3f: 5d pop %ebp ++ 40: 74 3c je 7e ++ 42: 89 44 24 fc mov %eax,-0x4\(%esp\) ++ 46: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 49: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 4c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 4f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 52: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5b: 5d pop %ebp ++ 5c: eb 27 jmp 85 ++ 5e: 66 90 xchg %ax,%ax ++ 60: eb 23 jmp 85 ++ 62: eb 21 jmp 85 ++ 64: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 67: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 6a: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 6d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 70: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 73: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 76: 5d pop %ebp ++ 77: 5d pop %ebp ++ 78: 39 c5 cmp %eax,%ebp ++ 7a: 74 02 je 7e ++ 7c: eb 07 jmp 85 ++ 7e: 36 8b 45 f4 mov %ss:-0xc\(%ebp\),%eax ++ 82: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 85: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 8b: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 91: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 97: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 9d: 89 75 0c mov %esi,0xc\(%ebp\) ++ a0: e9 [0-9a-f ]+ jmp .* ++ a5: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ab: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b1: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b7: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ bd: 89 75 00 mov %esi,0x0\(%ebp\) ++ c0: 74 c3 je 85 ++ c2: 74 c1 je 85 ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1g.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1g.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-1g.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1g.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,77 @@ ++#source: align-branch-1.s ++#as: -mbranches-within-32B-boundaries ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 65 65 65 a3 01 00 00 00 gs gs mov %eax,%gs:0x1 ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 55 push %ebp ++ b: 55 push %ebp ++ c: 89 e5 mov %esp,%ebp ++ e: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 20: 39 c5 cmp %eax,%ebp ++ 22: 74 5e je 82 ++ 24: 3e 89 73 f4 mov %esi,%ds:-0xc\(%ebx\) ++ 28: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2b: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3d: 5d pop %ebp ++ 3e: 5d pop %ebp ++ 3f: 5d pop %ebp ++ 40: 74 40 je 82 ++ 42: 5d pop %ebp ++ 43: 74 3d je 82 ++ 45: 36 89 44 24 fc mov %eax,%ss:-0x4\(%esp\) ++ 4a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 4d: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 50: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 53: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 56: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 59: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5f: 5d pop %ebp ++ 60: eb 26 jmp 88 ++ 62: eb 24 jmp 88 ++ 64: eb 22 jmp 88 ++ 66: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 69: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 6c: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 6f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 72: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 75: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 78: 5d pop %ebp ++ 79: 5d pop %ebp ++ 7a: 39 c5 cmp %eax,%ebp ++ 7c: 74 04 je 82 ++ 7e: 66 90 xchg %ax,%ax ++ 80: eb 06 jmp 88 ++ 82: 8b 45 f4 mov -0xc\(%ebp\),%eax ++ 85: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 9a: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ a0: 89 75 0c mov %esi,0xc\(%ebp\) ++ a3: e9 [0-9a-f ]+ jmp .* ++ a8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ae: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b4: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ba: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ c0: 89 75 00 mov %esi,0x0\(%ebp\) ++ c3: 74 c3 je 88 ++ c5: 74 c1 je 88 ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1h.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1h.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-1h.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1h.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,76 @@ ++#source: align-branch-1.s ++#as: -mbranches-within-32B-boundaries -malign-branch-boundary=0 ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 65 a3 01 00 00 00 mov %eax,%gs:0x1 ++ 6: 55 push %ebp ++ 7: 55 push %ebp ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 89 e5 mov %esp,%ebp ++ c: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 12: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 15: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 18: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1e: 39 c5 cmp %eax,%ebp ++ 20: 74 5a je 7c ++ 22: 89 73 f4 mov %esi,-0xc\(%ebx\) ++ 25: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 28: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 2b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 5d pop %ebp ++ 3b: 5d pop %ebp ++ 3c: 5d pop %ebp ++ 3d: 74 3d je 7c ++ 3f: 5d pop %ebp ++ 40: 74 3a je 7c ++ 42: 89 44 24 fc mov %eax,-0x4\(%esp\) ++ 46: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 49: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 4c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 4f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 52: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5b: 5d pop %ebp ++ 5c: eb 24 jmp 82 ++ 5e: eb 22 jmp 82 ++ 60: eb 20 jmp 82 ++ 62: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 65: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 68: 89 7d f8 mov %edi,-0x8\(%ebp\) ++ 6b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 6e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 71: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 74: 5d pop %ebp ++ 75: 5d pop %ebp ++ 76: 39 c5 cmp %eax,%ebp ++ 78: 74 02 je 7c ++ 7a: eb 06 jmp 82 ++ 7c: 8b 45 f4 mov -0xc\(%ebp\),%eax ++ 7f: 89 45 fc mov %eax,-0x4\(%ebp\) ++ 82: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ 9a: 89 75 0c mov %esi,0xc\(%ebp\) ++ 9d: e9 [0-9a-f ]+ jmp .* ++ a2: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ a8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ae: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ b4: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%ebp\) ++ ba: 89 75 00 mov %esi,0x0\(%ebp\) ++ bd: 74 c3 je 82 ++ bf: 74 c1 je 82 ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1.s binutils-2.30/gas/testsuite/gas/i386/align-branch-1.s +--- binutils.orig/gas/testsuite/gas/i386/align-branch-1.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1.s 2019-11-20 14:09:25.592915114 +0000 +@@ -0,0 +1,72 @@ ++ .text ++ .globl foo ++ .p2align 4 ++foo: ++ movl %eax, %gs:0x1 ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ movl %esp, %ebp ++ movl %edi, -8(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ cmp %eax, %ebp ++ je .L_2 ++ movl %esi, -12(%ebx) ++ movl %esi, -12(%ebp) ++ movl %edi, -8(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ popl %ebp ++ popl %ebp ++ popl %ebp ++ je .L_2 ++ popl %ebp ++ je .L_2 ++ movl %eax, -4(%esp) ++ movl %esi, -12(%ebp) ++ movl %edi, -8(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ popl %ebp ++ jmp .L_3 ++ jmp .L_3 ++ jmp .L_3 ++ movl %eax, -4(%ebp) ++ movl %esi, -12(%ebp) ++ movl %edi, -8(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ popl %ebp ++ popl %ebp ++ cmp %eax, %ebp ++ je .L_2 ++ jmp .L_3 ++.L_2: ++ movl -12(%ebp), %eax ++ movl %eax, -4(%ebp) ++.L_3: ++ movl %esi, -1200(%ebp) ++ movl %esi, -1200(%ebp) ++ movl %esi, -1200(%ebp) ++ movl %esi, -1200(%ebp) ++ movl %esi, 12(%ebp) ++ jmp bar ++ movl %esi, -1200(%ebp) ++ movl %esi, -1200(%ebp) ++ movl %esi, -1200(%ebp) ++ movl %esi, -1200(%ebp) ++ movl %esi, (%ebp) ++ je .L_3 ++ je .L_3 +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-2a.d binutils-2.30/gas/testsuite/gas/i386/align-branch-2a.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-2a.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-2a.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,55 @@ ++#source: align-branch-2.s ++#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 6: 55 push %ebp ++ 7: 55 push %ebp ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 89 e5 mov %esp,%ebp ++ c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 12: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 15: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 18: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1e: ff e0 jmp \*%eax ++ 20: 55 push %ebp ++ 21: 55 push %ebp ++ 22: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 28: 89 e5 mov %esp,%ebp ++ 2a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 30: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 33: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 36: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 39: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3c: ff d0 call \*%eax ++ 3e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 41: 55 push %ebp ++ 42: 55 push %ebp ++ 43: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 49: 89 e5 mov %esp,%ebp ++ 4b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 4e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 51: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 54: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 57: e8 [0-9a-f ]+ call .* ++ 5c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5f: 55 push %ebp ++ 60: 55 push %ebp ++ 61: 55 push %ebp ++ 62: 55 push %ebp ++ 63: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 69: 89 e5 mov %esp,%ebp ++ 6b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 6e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 71: ff 15 00 00 00 00 call \*0x0 ++ 77: 55 push %ebp ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-2b.d binutils-2.30/gas/testsuite/gas/i386/align-branch-2b.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-2b.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-2b.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,55 @@ ++#source: align-branch-2.s ++#as: -malign-branch-boundary=32 -malign-branch=indirect ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 64 a3 01 00 00 00 fs fs mov %eax,%fs:0x1 ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 55 push %ebp ++ b: 55 push %ebp ++ c: 89 e5 mov %esp,%ebp ++ e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 20: ff e0 jmp \*%eax ++ 22: 3e 3e 55 ds ds push %ebp ++ 25: 55 push %ebp ++ 26: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 2c: 89 e5 mov %esp,%ebp ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 40: ff d0 call \*%eax ++ 42: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 45: 55 push %ebp ++ 46: 55 push %ebp ++ 47: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 4d: 89 e5 mov %esp,%ebp ++ 4f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 52: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5b: e8 [0-9a-f ]+ call .* ++ 60: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 63: 55 push %ebp ++ 64: 55 push %ebp ++ 65: 55 push %ebp ++ 66: 55 push %ebp ++ 67: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 6d: 89 e5 mov %esp,%ebp ++ 6f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 72: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 75: ff 15 00 00 00 00 call \*0x0 ++ 7b: 55 push %ebp ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-2c.d binutils-2.30/gas/testsuite/gas/i386/align-branch-2c.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-2c.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-2c.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,55 @@ ++#source: align-branch-2.s ++#as: -malign-branch-boundary=32 -malign-branch=indirect+call ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 64 a3 01 00 00 00 fs fs mov %eax,%fs:0x1 ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 55 push %ebp ++ b: 55 push %ebp ++ c: 89 e5 mov %esp,%ebp ++ e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 20: ff e0 jmp \*%eax ++ 22: 3e 3e 55 ds ds push %ebp ++ 25: 55 push %ebp ++ 26: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 2c: 89 e5 mov %esp,%ebp ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 40: ff d0 call \*%eax ++ 42: 36 36 36 36 36 89 75 f4 ss ss ss ss mov %esi,%ss:-0xc\(%ebp\) ++ 4a: 55 push %ebp ++ 4b: 55 push %ebp ++ 4c: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 52: 89 e5 mov %esp,%ebp ++ 54: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 57: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 5d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 60: e8 [0-9a-f ]+ call .* ++ 65: 36 36 36 36 36 89 75 f4 ss ss ss ss mov %esi,%ss:-0xc\(%ebp\) ++ 6d: 3e 55 ds push %ebp ++ 6f: 55 push %ebp ++ 70: 55 push %ebp ++ 71: 55 push %ebp ++ 72: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 78: 89 e5 mov %esp,%ebp ++ 7a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 7d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 80: ff 15 00 00 00 00 call \*0x0 ++ 86: 55 push %ebp ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-2.s binutils-2.30/gas/testsuite/gas/i386/align-branch-2.s +--- binutils.orig/gas/testsuite/gas/i386/align-branch-2.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-2.s 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,49 @@ ++ .text ++ .globl foo ++ .p2align 4 ++foo: ++ movl %eax, %fs:0x1 ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ movl %esp, %ebp ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ jmp *%eax ++ pushl %ebp ++ pushl %ebp ++ movl %eax, %fs:0x1 ++ movl %esp, %ebp ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ call *%eax ++ movl %esi, -12(%ebp) ++ pushl %ebp ++ pushl %ebp ++ movl %eax, %fs:0x1 ++ movl %esp, %ebp ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ call foo ++ movl %esi, -12(%ebp) ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ movl %eax, %fs:0x1 ++ movl %esp, %ebp ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ call *foo ++ pushl %ebp +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-3.d binutils-2.30/gas/testsuite/gas/i386/align-branch-3.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-3.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-3.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,33 @@ ++#as: -malign-branch-boundary=32 -malign-branch=indirect+call ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 6: 55 push %ebp ++ 7: 55 push %ebp ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 89 e5 mov %esp,%ebp ++ c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 12: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 15: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 18: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1b: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1e: e8 fc ff ff ff call 1f ++ 23: 55 push %ebp ++ 24: 55 push %ebp ++ 25: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 2b: 89 e5 mov %esp,%ebp ++ 2d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 30: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 33: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 36: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 39: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3c: ff 91 00 00 00 00 call \*0x0\(%ecx\) ++ 42: 89 75 f4 mov %esi,-0xc\(%ebp\) ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-3.s binutils-2.30/gas/testsuite/gas/i386/align-branch-3.s +--- binutils.orig/gas/testsuite/gas/i386/align-branch-3.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-3.s 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,28 @@ ++ .text ++ .globl foo ++ .p2align 4 ++foo: ++ movl %eax, %fs:0x1 ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ movl %esp, %ebp ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ call ___tls_get_addr ++ pushl %ebp ++ pushl %ebp ++ movl %eax, %fs:0x1 ++ movl %esp, %ebp ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ call *___tls_get_addr@GOT(%ecx) ++ movl %esi, -12(%ebp) +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-4a.d binutils-2.30/gas/testsuite/gas/i386/align-branch-4a.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-4a.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-4a.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,36 @@ ++#source: align-branch-4.s ++#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 6: 55 push %ebp ++ 7: 55 push %ebp ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 55 push %ebp ++ b: 89 e5 mov %esp,%ebp ++ d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 10: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 13: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 16: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 19: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1c: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1f: c3 ret ++ 20: 55 push %ebp ++ 21: 55 push %ebp ++ 22: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 28: 89 e5 mov %esp,%ebp ++ 2a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 2d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 30: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 33: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 36: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 39: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3c: c2 1e 00 ret \$0x1e ++ 3f: 89 75 f4 mov %esi,-0xc\(%ebp\) ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-4b.d binutils-2.30/gas/testsuite/gas/i386/align-branch-4b.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-4b.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-4b.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,36 @@ ++#source: align-branch-4.s ++#as: -malign-branch-boundary=32 -malign-branch=ret ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 a3 01 00 00 00 fs mov %eax,%fs:0x1 ++ 7: 55 push %ebp ++ 8: 55 push %ebp ++ 9: 55 push %ebp ++ a: 55 push %ebp ++ b: 55 push %ebp ++ c: 89 e5 mov %esp,%ebp ++ e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 20: c3 ret ++ 21: 3e 3e 3e 55 ds ds ds push %ebp ++ 25: 55 push %ebp ++ 26: 64 a3 01 00 00 00 mov %eax,%fs:0x1 ++ 2c: 89 e5 mov %esp,%ebp ++ 2e: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 3d: 89 75 f4 mov %esi,-0xc\(%ebp\) ++ 40: c2 1e 00 ret \$0x1e ++ 43: 89 75 f4 mov %esi,-0xc\(%ebp\) ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-4.s binutils-2.30/gas/testsuite/gas/i386/align-branch-4.s +--- binutils.orig/gas/testsuite/gas/i386/align-branch-4.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-4.s 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,30 @@ ++ .text ++ .globl foo ++ .p2align 4 ++foo: ++ movl %eax, %fs:0x1 ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ pushl %ebp ++ movl %esp, %ebp ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ ret ++ pushl %ebp ++ pushl %ebp ++ movl %eax, %fs:0x1 ++ movl %esp, %ebp ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ movl %esi, -12(%ebp) ++ ret $30 ++ movl %esi, -12(%ebp) +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-5.d binutils-2.30/gas/testsuite/gas/i386/align-branch-5.d +--- binutils.orig/gas/testsuite/gas/i386/align-branch-5.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-5.d 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,36 @@ ++#as: -malign-branch-boundary=32 -malign-branch=jcc+fused+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: c1 e9 02 shr \$0x2,%ecx ++ 3: c1 e9 02 shr \$0x2,%ecx ++ 6: c1 e9 02 shr \$0x2,%ecx ++ 9: 89 d1 mov %edx,%ecx ++ b: 31 c0 xor %eax,%eax ++ d: c1 e9 02 shr \$0x2,%ecx ++ 10: c1 e9 02 shr \$0x2,%ecx ++ 13: c1 e9 02 shr \$0x2,%ecx ++ 16: c1 e9 02 shr \$0x2,%ecx ++ 19: c1 e9 02 shr \$0x2,%ecx ++ 1c: c1 e9 02 shr \$0x2,%ecx ++ 1f: f6 c2 02 test \$0x2,%dl ++ 22: f3 ab rep stos %eax,%es:\(%edi\) ++ 24: 75 dd jne 3 ++ 26: 31 c0 xor %eax,%eax ++ 28: c1 e9 02 shr \$0x2,%ecx ++ 2b: c1 e9 02 shr \$0x2,%ecx ++ 2e: c1 e9 02 shr \$0x2,%ecx ++ 31: 89 d1 mov %edx,%ecx ++ 33: 31 c0 xor %eax,%eax ++ 35: c1 e9 02 shr \$0x2,%ecx ++ 38: c1 e9 02 shr \$0x2,%ecx ++ 3b: c1 e9 02 shr \$0x2,%ecx ++ 3e: f6 c2 02 test \$0x2,%dl ++ 41: e8 [0-9a-f ]+ call .* ++ 46: 75 e3 jne 2b ++ 48: 31 c0 xor %eax,%eax ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-5.s binutils-2.30/gas/testsuite/gas/i386/align-branch-5.s +--- binutils.orig/gas/testsuite/gas/i386/align-branch-5.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/align-branch-5.s 2019-11-20 14:09:25.595915091 +0000 +@@ -0,0 +1,32 @@ ++ .text ++ .p2align 4,,15 ++foo: ++ shrl $2, %ecx ++.L1: ++ shrl $2, %ecx ++ shrl $2, %ecx ++ movl %edx, %ecx ++ xorl %eax, %eax ++ shrl $2, %ecx ++ shrl $2, %ecx ++ shrl $2, %ecx ++ shrl $2, %ecx ++ shrl $2, %ecx ++ shrl $2, %ecx ++ testb $2, %dl ++ rep stosl ++ jne .L1 ++ xorl %eax, %eax ++ shrl $2, %ecx ++.L2: ++ shrl $2, %ecx ++ shrl $2, %ecx ++ movl %edx, %ecx ++ xorl %eax, %eax ++ shrl $2, %ecx ++ shrl $2, %ecx ++ shrl $2, %ecx ++ testb $2, %dl ++ call bar ++ jne .L2 ++ xorl %eax, %eax +diff -rupN binutils.orig/gas/testsuite/gas/i386/i386.exp binutils-2.30/gas/testsuite/gas/i386/i386.exp +--- binutils.orig/gas/testsuite/gas/i386/i386.exp 2019-11-20 10:59:21.657883233 +0000 ++++ binutils-2.30/gas/testsuite/gas/i386/i386.exp 2019-11-20 14:09:39.865805050 +0000 +@@ -425,6 +425,20 @@ if [expr ([istarget "i*86-*-*"] || [ist + run_dump_test "align-1a" + run_dump_test "align-1b" + run_list_test "inval-pseudo" "-al" ++ run_dump_test "align-branch-1a" ++ run_dump_test "align-branch-1b" ++ run_dump_test "align-branch-1c" ++ run_dump_test "align-branch-1d" ++ run_dump_test "align-branch-1e" ++ run_dump_test "align-branch-1f" ++ run_dump_test "align-branch-1g" ++ run_dump_test "align-branch-1h" ++ run_dump_test "align-branch-2a" ++ run_dump_test "align-branch-2b" ++ run_dump_test "align-branch-2c" ++ run_dump_test "align-branch-4a" ++ run_dump_test "align-branch-4b" ++ run_dump_test "align-branch-5" + + # These tests require support for 8 and 16 bit relocs, + # so we only run them for ELF and COFF targets. +@@ -489,6 +503,10 @@ if [expr ([istarget "i*86-*-*"] || [ist + + run_dump_test "addend" + ++ if {[istarget "*-*-linux*"]} then { ++ run_dump_test "align-branch-3" ++ } ++ + if { [gas_64_check] } then { + run_dump_test "att-regs" + run_dump_test "intel-regs" +@@ -892,6 +910,20 @@ if [expr ([istarget "i*86-*-*"] || [ista + run_list_test "x86-64-notrackbad" "-al" + run_dump_test "x86-64-movd" + run_dump_test "x86-64-movd-intel" ++ run_dump_test "x86-64-align-branch-1a" ++ run_dump_test "x86-64-align-branch-1b" ++ run_dump_test "x86-64-align-branch-1c" ++ run_dump_test "x86-64-align-branch-1d" ++ run_dump_test "x86-64-align-branch-1e" ++ run_dump_test "x86-64-align-branch-1f" ++ run_dump_test "x86-64-align-branch-1g" ++ run_dump_test "x86-64-align-branch-1h" ++ run_dump_test "x86-64-align-branch-2a" ++ run_dump_test "x86-64-align-branch-2b" ++ run_dump_test "x86-64-align-branch-2c" ++ run_dump_test "x86-64-align-branch-4a" ++ run_dump_test "x86-64-align-branch-4b" ++ run_dump_test "x86-64-align-branch-5" + + if { ![istarget "*-*-aix*"] + && ![istarget "*-*-beos*"] +@@ -949,6 +981,10 @@ if [expr ([istarget "i*86-*-*"] || [ista + run_dump_test "x86-64-gotpcrel-no-relax" + + run_dump_test "x86-64-addend" ++ ++ if {[istarget "*-*-linux*"]} then { ++ run_dump_test "x86-64-align-branch-3" ++ } + } + + set ASFLAGS "$old_ASFLAGS" +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1a.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1a.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1a.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1a.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,75 @@ ++#source: x86-64-align-branch-1.s ++#as: -malign-branch-boundary=32 ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 64 64 89 04 25 01 00 00 00 fs fs fs mov %eax,%fs:0x1 ++ b: 55 push %rbp ++ c: 55 push %rbp ++ d: 55 push %rbp ++ e: 48 89 e5 mov %rsp,%rbp ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 20: 48 39 c5 cmp %rax,%rbp ++ 23: 74 5d je 82 ++ 25: 2e 89 75 f4 mov %esi,%cs:-0xc\(%rbp\) ++ 29: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 2c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 2f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 32: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 35: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 38: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3e: 5d pop %rbp ++ 3f: 5d pop %rbp ++ 40: 74 40 je 82 ++ 42: 5d pop %rbp ++ 43: 74 3d je 82 ++ 45: 2e 89 45 fc mov %eax,%cs:-0x4\(%rbp\) ++ 49: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 4c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 4f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 52: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5e: 5d pop %rbp ++ 5f: 5d pop %rbp ++ 60: eb 26 jmp 88 ++ 62: eb 24 jmp 88 ++ 64: eb 22 jmp 88 ++ 66: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 69: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 6c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 6f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 72: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 75: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 78: 5d pop %rbp ++ 79: 5d pop %rbp ++ 7a: 48 39 c5 cmp %rax,%rbp ++ 7d: 74 03 je 82 ++ 7f: 90 nop ++ 80: eb 06 jmp 88 ++ 82: 8b 45 f4 mov -0xc\(%rbp\),%eax ++ 85: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 9a: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a0: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a6: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ ac: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b2: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ be: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ c4: eb c2 jmp 88 ++ c6: 5d pop %rbp ++ c7: c3 retq ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1b.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1b.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1b.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1b.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,75 @@ ++#source: x86-64-align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 64 64 89 04 25 01 00 00 00 fs fs fs mov %eax,%fs:0x1 ++ b: 55 push %rbp ++ c: 55 push %rbp ++ d: 55 push %rbp ++ e: 48 89 e5 mov %rsp,%rbp ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 20: 48 39 c5 cmp %rax,%rbp ++ 23: 74 5d je 82 ++ 25: 2e 89 75 f4 mov %esi,%cs:-0xc\(%rbp\) ++ 29: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 2c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 2f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 32: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 35: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 38: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3e: 5d pop %rbp ++ 3f: 5d pop %rbp ++ 40: 74 40 je 82 ++ 42: 5d pop %rbp ++ 43: 74 3d je 82 ++ 45: 2e 89 45 fc mov %eax,%cs:-0x4\(%rbp\) ++ 49: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 4c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 4f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 52: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5e: 5d pop %rbp ++ 5f: 5d pop %rbp ++ 60: eb 26 jmp 88 ++ 62: eb 24 jmp 88 ++ 64: eb 22 jmp 88 ++ 66: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 69: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 6c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 6f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 72: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 75: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 78: 5d pop %rbp ++ 79: 5d pop %rbp ++ 7a: 48 39 c5 cmp %rax,%rbp ++ 7d: 74 03 je 82 ++ 7f: 90 nop ++ 80: eb 06 jmp 88 ++ 82: 8b 45 f4 mov -0xc\(%rbp\),%eax ++ 85: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 9a: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a0: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a6: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ ac: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b2: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ be: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ c4: eb c2 jmp 88 ++ c6: 5d pop %rbp ++ c7: c3 retq ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1c.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1c.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1c.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1c.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,75 @@ ++#source: x86-64-align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch-prefix-size=1 ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 8: 2e 55 cs push %rbp ++ a: 2e 55 cs push %rbp ++ c: 2e 55 cs push %rbp ++ e: 48 89 e5 mov %rsp,%rbp ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 20: 48 39 c5 cmp %rax,%rbp ++ 23: 74 5d je 82 ++ 25: 2e 89 75 f4 mov %esi,%cs:-0xc\(%rbp\) ++ 29: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 2c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 2f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 32: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 35: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 38: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3e: 5d pop %rbp ++ 3f: 5d pop %rbp ++ 40: 74 40 je 82 ++ 42: 5d pop %rbp ++ 43: 74 3d je 82 ++ 45: 2e 89 45 fc mov %eax,%cs:-0x4\(%rbp\) ++ 49: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 4c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 4f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 52: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5e: 5d pop %rbp ++ 5f: 5d pop %rbp ++ 60: eb 26 jmp 88 ++ 62: eb 24 jmp 88 ++ 64: eb 22 jmp 88 ++ 66: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 69: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 6c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 6f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 72: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 75: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 78: 5d pop %rbp ++ 79: 5d pop %rbp ++ 7a: 48 39 c5 cmp %rax,%rbp ++ 7d: 74 03 je 82 ++ 7f: 90 nop ++ 80: eb 06 jmp 88 ++ 82: 8b 45 f4 mov -0xc\(%rbp\),%eax ++ 85: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 9a: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a0: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a6: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ ac: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b2: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ be: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ c4: eb c2 jmp 88 ++ c6: 5d pop %rbp ++ c7: c3 retq ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1d.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1d.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1d.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1d.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,74 @@ ++#source: x86-64-align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch=fused+jcc ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 64 64 89 04 25 01 00 00 00 fs fs fs mov %eax,%fs:0x1 ++ b: 55 push %rbp ++ c: 55 push %rbp ++ d: 55 push %rbp ++ e: 48 89 e5 mov %rsp,%rbp ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 20: 48 39 c5 cmp %rax,%rbp ++ 23: 74 5b je 80 ++ 25: 2e 89 75 f4 mov %esi,%cs:-0xc\(%rbp\) ++ 29: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 2c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 2f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 32: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 35: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 38: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3e: 5d pop %rbp ++ 3f: 5d pop %rbp ++ 40: 74 3e je 80 ++ 42: 5d pop %rbp ++ 43: 74 3b je 80 ++ 45: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 48: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 4b: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 4e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 51: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 54: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 57: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5d: 5d pop %rbp ++ 5e: 5d pop %rbp ++ 5f: eb 25 jmp 86 ++ 61: eb 23 jmp 86 ++ 63: eb 21 jmp 86 ++ 65: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 68: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 6b: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 6e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 71: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 74: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 77: 5d pop %rbp ++ 78: 5d pop %rbp ++ 79: 48 39 c5 cmp %rax,%rbp ++ 7c: 74 02 je 80 ++ 7e: eb 06 jmp 86 ++ 80: 8b 45 f4 mov -0xc\(%rbp\),%eax ++ 83: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 86: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 8c: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 92: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 98: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 9e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a4: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ aa: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b0: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b6: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ bc: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ c2: eb c2 jmp 86 ++ c4: 5d pop %rbp ++ c5: c3 retq ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1e.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1e.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1e.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1e.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,74 @@ ++#source: x86-64-align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch=jcc ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 8: 55 push %rbp ++ 9: 55 push %rbp ++ a: 55 push %rbp ++ b: 48 89 e5 mov %rsp,%rbp ++ e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 48 39 c5 cmp %rax,%rbp ++ 20: 74 5b je 7d ++ 22: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 25: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 28: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 2b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3a: 5d pop %rbp ++ 3b: 5d pop %rbp ++ 3c: 74 3f je 7d ++ 3e: 2e 5d cs pop %rbp ++ 40: 74 3b je 7d ++ 42: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 45: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 48: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 4b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 4e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 51: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 54: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 57: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5a: 5d pop %rbp ++ 5b: 5d pop %rbp ++ 5c: eb 25 jmp 83 ++ 5e: eb 23 jmp 83 ++ 60: eb 21 jmp 83 ++ 62: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 65: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 68: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 6b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 6e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 71: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 74: 5d pop %rbp ++ 75: 5d pop %rbp ++ 76: 48 39 c5 cmp %rax,%rbp ++ 79: 74 02 je 7d ++ 7b: eb 06 jmp 83 ++ 7d: 8b 45 f4 mov -0xc\(%rbp\),%eax ++ 80: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 83: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 89: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 8f: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 95: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 9b: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a1: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a7: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ ad: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b3: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b9: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ bf: eb c2 jmp 83 ++ c1: 5d pop %rbp ++ c2: c3 retq ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1f.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1f.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1f.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1f.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,75 @@ ++#source: x86-64-align-branch-1.s ++#as: -malign-branch-boundary=32 -malign-branch=jcc+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 8: 55 push %rbp ++ 9: 55 push %rbp ++ a: 55 push %rbp ++ b: 48 89 e5 mov %rsp,%rbp ++ e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 48 39 c5 cmp %rax,%rbp ++ 20: 74 5d je 7f ++ 22: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 25: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 28: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 2b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3a: 5d pop %rbp ++ 3b: 5d pop %rbp ++ 3c: 74 41 je 7f ++ 3e: 2e 5d cs pop %rbp ++ 40: 74 3d je 7f ++ 42: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 45: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 48: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 4b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 4e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 51: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 54: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 57: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5a: 5d pop %rbp ++ 5b: 5d pop %rbp ++ 5c: eb 27 jmp 85 ++ 5e: 66 90 xchg %ax,%ax ++ 60: eb 23 jmp 85 ++ 62: eb 21 jmp 85 ++ 64: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 67: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 6a: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 6d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 70: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 73: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 76: 5d pop %rbp ++ 77: 5d pop %rbp ++ 78: 48 39 c5 cmp %rax,%rbp ++ 7b: 74 02 je 7f ++ 7d: eb 06 jmp 85 ++ 7f: 8b 45 f4 mov -0xc\(%rbp\),%eax ++ 82: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 85: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 8b: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 91: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 97: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 9d: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a3: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a9: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ af: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b5: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ bb: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ c1: eb c2 jmp 85 ++ c3: 5d pop %rbp ++ c4: c3 retq ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1g.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1g.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1g.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1g.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,75 @@ ++#source: x86-64-align-branch-1.s ++#as: -mbranches-within-32B-boundaries ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 64 64 89 04 25 01 00 00 00 fs fs fs mov %eax,%fs:0x1 ++ b: 55 push %rbp ++ c: 55 push %rbp ++ d: 55 push %rbp ++ e: 48 89 e5 mov %rsp,%rbp ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 20: 48 39 c5 cmp %rax,%rbp ++ 23: 74 5d je 82 ++ 25: 2e 89 75 f4 mov %esi,%cs:-0xc\(%rbp\) ++ 29: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 2c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 2f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 32: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 35: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 38: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3e: 5d pop %rbp ++ 3f: 5d pop %rbp ++ 40: 74 40 je 82 ++ 42: 5d pop %rbp ++ 43: 74 3d je 82 ++ 45: 2e 89 45 fc mov %eax,%cs:-0x4\(%rbp\) ++ 49: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 4c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 4f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 52: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5e: 5d pop %rbp ++ 5f: 5d pop %rbp ++ 60: eb 26 jmp 88 ++ 62: eb 24 jmp 88 ++ 64: eb 22 jmp 88 ++ 66: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 69: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 6c: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 6f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 72: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 75: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 78: 5d pop %rbp ++ 79: 5d pop %rbp ++ 7a: 48 39 c5 cmp %rax,%rbp ++ 7d: 74 03 je 82 ++ 7f: 90 nop ++ 80: eb 06 jmp 88 ++ 82: 8b 45 f4 mov -0xc\(%rbp\),%eax ++ 85: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 9a: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a0: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a6: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ ac: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b2: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ be: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ c4: eb c2 jmp 88 ++ c6: 5d pop %rbp ++ c7: c3 retq ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1h.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1h.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1h.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1h.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,74 @@ ++#source: x86-64-align-branch-1.s ++#as: -mbranches-within-32B-boundaries -malign-branch-boundary=0 ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 8: 55 push %rbp ++ 9: 55 push %rbp ++ a: 55 push %rbp ++ b: 48 89 e5 mov %rsp,%rbp ++ e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 48 39 c5 cmp %rax,%rbp ++ 20: 74 5a je 7c ++ 22: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 25: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 28: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 2b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3a: 5d pop %rbp ++ 3b: 5d pop %rbp ++ 3c: 74 3e je 7c ++ 3e: 5d pop %rbp ++ 3f: 74 3b je 7c ++ 41: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 44: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 47: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 4a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 4d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 50: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 53: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 56: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 59: 5d pop %rbp ++ 5a: 5d pop %rbp ++ 5b: eb 25 jmp 82 ++ 5d: eb 23 jmp 82 ++ 5f: eb 21 jmp 82 ++ 61: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 64: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 67: 89 7d f8 mov %edi,-0x8\(%rbp\) ++ 6a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 6d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 70: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 73: 5d pop %rbp ++ 74: 5d pop %rbp ++ 75: 48 39 c5 cmp %rax,%rbp ++ 78: 74 02 je 7c ++ 7a: eb 06 jmp 82 ++ 7c: 8b 45 f4 mov -0xc\(%rbp\),%eax ++ 7f: 89 45 fc mov %eax,-0x4\(%rbp\) ++ 82: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 88: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 8e: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 94: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ 9a: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a0: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ a6: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ ac: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b2: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ b8: 89 b5 50 fb ff ff mov %esi,-0x4b0\(%rbp\) ++ be: eb c2 jmp 82 ++ c0: 5d pop %rbp ++ c1: c3 retq ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1.s binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1.s +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1.s 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,70 @@ ++ .text ++ .globl foo ++ .p2align 4 ++foo: ++ movl %eax, %fs:0x1 ++ pushq %rbp ++ pushq %rbp ++ pushq %rbp ++ movq %rsp, %rbp ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ cmp %rax, %rbp ++ je .L_2 ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %edi, -8(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ popq %rbp ++ popq %rbp ++ je .L_2 ++ popq %rbp ++ je .L_2 ++ movl %eax, -4(%rbp) ++ movl %esi, -12(%rbp) ++ movl %edi, -8(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ popq %rbp ++ popq %rbp ++ jmp .L_3 ++ jmp .L_3 ++ jmp .L_3 ++ movl %eax, -4(%rbp) ++ movl %esi, -12(%rbp) ++ movl %edi, -8(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ popq %rbp ++ popq %rbp ++ cmp %rax, %rbp ++ je .L_2 ++ jmp .L_3 ++.L_2: ++ movl -12(%rbp), %eax ++ movl %eax, -4(%rbp) ++.L_3: ++ movl %esi, -1200(%rbp) ++ movl %esi, -1200(%rbp) ++ movl %esi, -1200(%rbp) ++ movl %esi, -1200(%rbp) ++ movl %esi, -1200(%rbp) ++ movl %esi, -1200(%rbp) ++ movl %esi, -1200(%rbp) ++ movl %esi, -1200(%rbp) ++ movl %esi, -1200(%rbp) ++ movl %esi, -1200(%rbp) ++ jmp .L_3 ++ popq %rbp ++ retq +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2a.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2a.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2a.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2a.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,50 @@ ++#source: x86-64-align-branch-2.s ++#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 8: 55 push %rbp ++ 9: 55 push %rbp ++ a: 55 push %rbp ++ b: 55 push %rbp ++ c: 48 89 e5 mov %rsp,%rbp ++ f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 12: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 15: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 18: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1e: ff e0 jmpq \*%rax ++ 20: 55 push %rbp ++ 21: 55 push %rbp ++ 22: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 2a: 48 89 e5 mov %rsp,%rbp ++ 2d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 30: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 33: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 36: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 39: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3c: ff d0 callq \*%rax ++ 3e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 41: 55 push %rbp ++ 42: 55 push %rbp ++ 43: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 4b: 48 89 e5 mov %rsp,%rbp ++ 4e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 51: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 54: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 57: e8 [0-9a-f ]+ callq .* ++ 5c: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5f: 55 push %rbp ++ 60: 55 push %rbp ++ 61: 55 push %rbp ++ 62: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 6a: 48 89 e5 mov %rsp,%rbp ++ 6d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 70: ff 14 25 00 00 00 00 callq \*0x0 ++ 77: 55 push %rbp ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2b.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2b.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2b.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2b.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,50 @@ ++#source: x86-64-align-branch-2.s ++#as: -malign-branch-boundary=32 -malign-branch=indirect ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 64 89 04 25 01 00 00 00 fs fs mov %eax,%fs:0x1 ++ a: 55 push %rbp ++ b: 55 push %rbp ++ c: 55 push %rbp ++ d: 55 push %rbp ++ e: 48 89 e5 mov %rsp,%rbp ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 20: ff e0 jmpq \*%rax ++ 22: 2e 2e 55 cs cs push %rbp ++ 25: 55 push %rbp ++ 26: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 2e: 48 89 e5 mov %rsp,%rbp ++ 31: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 40: ff d0 callq \*%rax ++ 42: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 45: 55 push %rbp ++ 46: 55 push %rbp ++ 47: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 4f: 48 89 e5 mov %rsp,%rbp ++ 52: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 55: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 58: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5b: e8 [0-9a-f ]+ callq .* ++ 60: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 63: 55 push %rbp ++ 64: 55 push %rbp ++ 65: 55 push %rbp ++ 66: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 6e: 48 89 e5 mov %rsp,%rbp ++ 71: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 74: ff 14 25 00 00 00 00 callq \*0x0 ++ 7b: 55 push %rbp ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2c.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2c.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2c.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2c.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,50 @@ ++#source: x86-64-align-branch-2.s ++#as: -malign-branch-boundary=32 -malign-branch=indirect+call ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 64 89 04 25 01 00 00 00 fs fs mov %eax,%fs:0x1 ++ a: 55 push %rbp ++ b: 55 push %rbp ++ c: 55 push %rbp ++ d: 55 push %rbp ++ e: 48 89 e5 mov %rsp,%rbp ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 20: ff e0 jmpq \*%rax ++ 22: 2e 2e 55 cs cs push %rbp ++ 25: 55 push %rbp ++ 26: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 2e: 48 89 e5 mov %rsp,%rbp ++ 31: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 40: ff d0 callq \*%rax ++ 42: 2e 2e 2e 2e 2e 89 75 f4 cs cs cs cs mov %esi,%cs:-0xc\(%rbp\) ++ 4a: 55 push %rbp ++ 4b: 55 push %rbp ++ 4c: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 54: 48 89 e5 mov %rsp,%rbp ++ 57: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 5d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 60: e8 [0-9a-f ]+ callq .* ++ 65: 2e 2e 2e 2e 2e 89 75 f4 cs cs cs cs mov %esi,%cs:-0xc\(%rbp\) ++ 6d: 2e 2e 55 cs cs push %rbp ++ 70: 55 push %rbp ++ 71: 55 push %rbp ++ 72: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 7a: 48 89 e5 mov %rsp,%rbp ++ 7d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 80: ff 14 25 00 00 00 00 callq \*0x0 ++ 87: 55 push %rbp ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2.s binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2.s +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2.s 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,44 @@ ++ .text ++ .globl foo ++ .p2align 4 ++foo: ++ movl %eax, %fs:0x1 ++ pushq %rbp ++ pushq %rbp ++ pushq %rbp ++ pushq %rbp ++ movq %rsp, %rbp ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ jmp *%rax ++ pushq %rbp ++ pushq %rbp ++ movl %eax, %fs:0x1 ++ movq %rsp, %rbp ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ call *%rax ++ movl %esi, -12(%rbp) ++ pushq %rbp ++ pushq %rbp ++ movl %eax, %fs:0x1 ++ movq %rsp, %rbp ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ call foo ++ movl %esi, -12(%rbp) ++ pushq %rbp ++ pushq %rbp ++ pushq %rbp ++ movl %eax, %fs:0x1 ++ movq %rsp, %rbp ++ movl %esi, -12(%rbp) ++ call *foo ++ pushq %rbp +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-3.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-3.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-3.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-3.d 2019-11-20 14:09:25.596915083 +0000 +@@ -0,0 +1,32 @@ ++#as: -malign-branch-boundary=32 -malign-branch=indirect+call ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 8: 55 push %rbp ++ 9: 55 push %rbp ++ a: 55 push %rbp ++ b: 55 push %rbp ++ c: 48 89 e5 mov %rsp,%rbp ++ f: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 12: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 15: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 18: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1e: e8 00 00 00 00 callq 23 ++ 23: 55 push %rbp ++ 24: 55 push %rbp ++ 25: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 2d: 48 89 e5 mov %rsp,%rbp ++ 30: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 33: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 36: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 39: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3c: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3f: ff 15 00 00 00 00 callq \*0x0\(%rip\) # 45 ++ 45: 89 75 f4 mov %esi,-0xc\(%rbp\) ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-3.s binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-3.s +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-3.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-3.s 2019-11-20 14:09:25.597915075 +0000 +@@ -0,0 +1,27 @@ ++ .text ++ .globl foo ++ .p2align 4 ++foo: ++ movl %eax, %fs:0x1 ++ pushq %rbp ++ pushq %rbp ++ pushq %rbp ++ pushq %rbp ++ movq %rsp, %rbp ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ call __tls_get_addr ++ pushq %rbp ++ pushq %rbp ++ movl %eax, %fs:0x1 ++ movq %rsp, %rbp ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ call *__tls_get_addr@GOTPCREL(%rip) ++ movl %esi, -12(%rbp) +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4a.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4a.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4a.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4a.d 2019-11-20 14:09:25.597915075 +0000 +@@ -0,0 +1,33 @@ ++#source: x86-64-align-branch-4.s ++#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 8: 55 push %rbp ++ 9: 55 push %rbp ++ a: 48 89 e5 mov %rsp,%rbp ++ d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 10: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 13: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 16: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 19: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1c: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1f: c3 retq ++ 20: 55 push %rbp ++ 21: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 29: 55 push %rbp ++ 2a: 55 push %rbp ++ 2b: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 2e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3d: c2 1e 00 retq \$0x1e ++ 40: 55 push %rbp ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4b.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4b.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4b.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4b.d 2019-11-20 14:09:25.597915075 +0000 +@@ -0,0 +1,33 @@ ++#source: x86-64-align-branch-4.s ++#as: -malign-branch-boundary=32 -malign-branch=ret ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: 64 64 89 04 25 01 00 00 00 fs mov %eax,%fs:0x1 ++ 9: 55 push %rbp ++ a: 55 push %rbp ++ b: 48 89 e5 mov %rsp,%rbp ++ e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 11: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 14: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 17: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 1d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 20: c3 retq ++ 21: 2e 2e 55 cs cs push %rbp ++ 24: 64 89 04 25 01 00 00 00 mov %eax,%fs:0x1 ++ 2c: 55 push %rbp ++ 2d: 55 push %rbp ++ 2e: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 31: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 34: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 37: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3a: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 3d: 89 75 f4 mov %esi,-0xc\(%rbp\) ++ 40: c2 1e 00 retq \$0x1e ++ 43: 55 push %rbp ++#pass +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4.s binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4.s +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4.s 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4.s 2019-11-20 14:09:25.597915075 +0000 +@@ -0,0 +1,27 @@ ++ .text ++ .globl foo ++ .p2align 4 ++foo: ++ movl %eax, %fs:0x1 ++ pushq %rbp ++ pushq %rbp ++ movq %rsp, %rbp ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ ret ++ pushq %rbp ++ movl %eax, %fs:0x1 ++ pushq %rbp ++ pushq %rbp ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ movl %esi, -12(%rbp) ++ ret $30 ++ pushq %rbp +diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-5.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-5.d +--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-5.d 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-5.d 2019-11-20 14:09:25.597915075 +0000 +@@ -0,0 +1,37 @@ ++#source: align-branch-5.s ++#as: -malign-branch-boundary=32 -malign-branch=jcc+fused+jmp ++#objdump: -dw ++ ++.*: +file format .* ++ ++Disassembly of section .text: ++ ++0+ : ++ 0: c1 e9 02 shr \$0x2,%ecx ++ 3: c1 e9 02 shr \$0x2,%ecx ++ 6: c1 e9 02 shr \$0x2,%ecx ++ 9: 89 d1 mov %edx,%ecx ++ b: 31 c0 xor %eax,%eax ++ d: c1 e9 02 shr \$0x2,%ecx ++ 10: c1 e9 02 shr \$0x2,%ecx ++ 13: c1 e9 02 shr \$0x2,%ecx ++ 16: c1 e9 02 shr \$0x2,%ecx ++ 19: c1 e9 02 shr \$0x2,%ecx ++ 1c: c1 e9 02 shr \$0x2,%ecx ++ 1f: f6 c2 02 test \$0x2,%dl ++ 22: f3 ab rep stos %eax,%es:\(%rdi\) ++ 24: 75 dd jne 3 ++ 26: 31 c0 xor %eax,%eax ++ 28: c1 e9 02 shr \$0x2,%ecx ++ 2b: c1 e9 02 shr \$0x2,%ecx ++ 2e: c1 e9 02 shr \$0x2,%ecx ++ 31: 89 d1 mov %edx,%ecx ++ 33: 31 c0 xor %eax,%eax ++ 35: c1 e9 02 shr \$0x2,%ecx ++ 38: c1 e9 02 shr \$0x2,%ecx ++ 3b: c1 e9 02 shr \$0x2,%ecx ++ 3e: f6 c2 02 test \$0x2,%dl ++ 41: e8 00 00 00 00 callq 46 ++ 46: 75 e3 jne 2b ++ 48: 31 c0 xor %eax,%eax ++#pass +diff -rupN binutils.orig/gas/write.c binutils-2.30/gas/write.c +--- binutils.orig/gas/write.c 2019-11-20 10:59:21.592883731 +0000 ++++ binutils-2.30/gas/write.c 2019-11-20 14:30:33.613133740 +0000 +@@ -2987,7 +2987,12 @@ relax_segment (struct frag *segment_frag + #ifdef TC_GENERIC_RELAX_TABLE + /* The default way to relax a frag is to look through + TC_GENERIC_RELAX_TABLE. */ ++#ifdef md_generic_table_relax_frag ++ growth = md_generic_table_relax_frag (segment, fragP, ++ stretch); ++#else + growth = relax_frag (segment, fragP, stretch); ++#endif /* md_generic_table_relax_frag */ + #endif /* TC_GENERIC_RELAX_TABLE */ + #endif + break; diff --git a/SPECS/binutils.spec b/SPECS/binutils.spec new file mode 100644 index 0000000..ab1a740 --- /dev/null +++ b/SPECS/binutils.spec @@ -0,0 +1,3259 @@ +# Binutils SPEC file. Can be invoked with the following parameters: + +# --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils. +# --with=bootstrap: Build with minimal dependencies. +# --with=debug: Build without optimizations and without splitting the debuginfo. +# --without=docs: Skip building documentation. +# --without=testsuite: Do not run the testsuite. Default is to run it. +# --with=testsuite: Run the testsuite. Default when --with=debug is not to run it. + +#---Start of Configure Options----------------------------------------------- + +# Do not create deterministic archives by default (cf: BZ 1195883) +%define enable_deterministic_archives 0 + +# Enable support for GCC LTO compilation. +%define enable_lto 1 + +# 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 + +#----End of Configure Options------------------------------------------------ + +# Default: Not bootstrapping. +%bcond_with bootstrap +# Default: Not debug +%bcond_with debug +# Default: Always build documentation. +%bcond_without docs +# Default: Always run the testsuite. +%bcond_without testsuite + +%if %{with bootstrap} +%undefine with_docs +%undefine with_testsuite +%endif + +%if %{with debug} +%undefine with_testsuite +%endif + +%if 0%{!?binutils_target:1} +%define binutils_target %{_target_platform} +%define isnative 1 +%define enable_shared 1 +%else +%define cross %{binutils_target}- +%define isnative 0 +%define enable_shared 0 +%endif + +#---------------------------------------------------------------------------- + +Summary: A GNU collection of binary utilities +Name: %{?cross}binutils%{?_with_debug:-debug} +Version: 2.30 +Release: 58%{?dist}.1 +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: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz + +Source2: binutils-2.19.50.0.1-output-format.sed + +%if %{with docs} +# Strictly speaking this next file is not part of the binutils distribution. +# But the emacs info system expects it to be present on any system where +# emacs is installed, and old binutils distributions used to include it by +# mistake. Since there is no suitable documentation files component to +# current RHEL releases, it is included here instead. In order to save time +# and complexity it is stored as a pre-built, compressed, info file. +# The upstream version of the original source file can be found here: +# http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=doc/standards.texi;hb=HEAD +# For more information see: https://bugzilla.redhat.com/show_bug.cgi?id=1467390 +Source3: standards.info.gz +%endif + +#---------------------------------------------------------------------------- + +# 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-2.22.52.0.1-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: Import H.J.Lu's Kernel LTO patch. +# Lifetime: Permanent, but needs continual updating. +# FIXME: Try removing.... +Patch05: binutils-2.26-lto.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. +Patch06: binutils-2.29-filename-in-error-messages.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 the rpmdiff tester insists that if both the i686 and +# x86_64 versions of binutils-devel are installed on the same +# machine, then they will have identical versions of the bfd.h +# header file. +# Lifetime: Permanent. +Patch07: binutils-2.25-set-long-long.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. +Patch08: 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. +Patch09: binutils-2.27-aarch64-ifunc.patch + +# Purpose: Remove support for inserting PowerPC Speculation Barrier +# instructions from the linker. (It has been deprecated in +# favour of a hardware fix). +# Lifetime: Fixed in 2.30.1 and/or 2.31. +Patch10: binutils-revert-PowerPC-speculation-barriers.patch + +# Purpose: Stop readelf/objdump for searching for DWO links unless +# explicitly requested by the user. +# Lifetime: Fixed in 2.30.1 and/or 2.31. +Patch11: binutils-skip-dwo-search-if-not-needed.patch + +# Purpose: Fix a bug in the BFD linker's layout algorithm which ended up +# placing executable and non-executable pages in the same segment. +# Lifetime: Fixed in 2.30.1 and/or 2.31. +Patch12: binutils-page-to-segment-assignment.patch + +# Purpose: Fix a bug in ld for linking against AARCH64 UEFI +# Lifetime: Fixed in 2.30.1 and/or 2.31 +Patch13: binutils-2.30-allow_R_AARCH64-symbols.patch + +# Purpose: Stop strip from replacing unknown relocs with null relocs. Make +# it return an error status and not strip the file instead. +# Lifetime: Fixed in 2.31. +Patch14: binutils-strip-unknown-relocs.patch + +# Purpose: Improves objdump's function for locating a symbol to match a +# given address, so that it uses a binary chop algorithm. +# Lifetime: Fixed in 2.31. +Patch15: binutils-speed-up-objdump.patch + +# Purpose: Ignore duplicate indirect symbols generated by GOLD. +# Lifetime: Permanent. +# FIXME: This problem needs to be resolved in the FSF sources, but the +# GOLD maintainers seem to be reluctant to address the issue. +Patch16: binutils-2.28-ignore-gold-duplicates.patch + +# Purpose: Treat relocs against STT_GNU_IFUNC symbols in note sections as +# if they were relocs against STT_FUNC symbols instead. +# Lifetime: Fixed in 2.31. +Patch17: binutils-ifunc-relocs-in-notes.patch + +# Purpose: Do not discard debug only object files created by GCC v8's +# LTO wrapper. +# Lifetime: Fixed in 2.31. +Patch18: binutils-debug-section-marking.patch + +# Purpose: Fix the GOLD linker's handling of PROTECTED symbols from the +# LLVM plugin. +# Lifetime: Fixed in 2.31 (probably - check...). +Patch19: binutils-gold-llvm-plugin.patch + +# Purpose: Enhance the assembler so that it will automatically generate +# GNU Build attribute notes if none are present in the inputs. +# Lifetime: Fixed in 2.31 +Patch20: binutils-gas-build-notes.patch + +# Purpose: Fix a seg-fault triggered by running objdump on a corrupt AOUT +# format file. +# Lifetime: Fixed in 2.31 +Patch21: binutils-CVE-2018-7642.patch + +# Purpose: Fix a seg-fault triggered by running readelf or objdump on a +# file containing corrupt DWARF debug information. +# Lifetime: Fixed in 2.31 +Patch22: binutils-CVE-2018-7643.patch + +# Purpose: Fix a seg-fault triggered by running objdump on a corrupt COFF +# format file. +# Lifetime: Fixed in 2.31 +Patch23: binutils-CVE-2018-7208.patch + +# Purpose: Fix a seg-fault triggered by running readelf or objdump on a +# file containing corrupt DWARF debug information. +# Lifetime: Fixed in 2.31 +Patch24: binutils-CVE-2018-10372.patch + +# Purpose: Fix another seg-fault triggered by running readelf or objdump on a +# file containing corrupt DWARF debug information. +# Lifetime: Fixed in 2.31 +Patch25: binutils-CVE-2018-10373.patch + +# Purpose: Fix a seg-fault triggered by running objcopy on a corrupt ELF +# file. +# Lifetime: Fixed in 2.31 +Patch26: binutils-CVE-2018-7570.patch + +# Purpose: Fix a seg-fault triggered by running objcopy on a large ELF +# file on a 32-bit host machine. +# Lifetime: Fixed in 2.31 +Patch27: binutils-CVE-2018-6323.patch + +# Purpose: Fix a seg-fault triggered by running nm on a corrupt ELF file. +# Lifetime: Fixed in 2.31 +Patch28: binutils-CVE-2018-6759.patch + +# Purpose: Fix a seg-fault triggered by running nm on a file containing +# corrupt DWARF information. +# Lifetime: Fixed in 2.31 +Patch29: binutils-CVE-2018-7569.patch + +# Purpose: Fix a seg-fault triggered by running nm on a file containing +# corrupt DWARF information. +# Lifetime: Fixed in 2.31 +Patch30: binutils-CVE-2018-7568.patch + +# Purpose: Fix a seg-fault triggered by running objcopy on a corrupt +# PE format file. +# Lifetime: Fixed in 2.31 +Patch31: binutils-CVE-2018-10534.patch + +# Purpose: Fix a seg-fault triggered by running objcopy on a corrupt +# ELF format file. +# Lifetime: Fixed in 2.31 +Patch32: binutils-CVE-2018-10535.patch + +# Purpose: Have the x86 linker resolve relocations against the _end, +# __bss_start and -edata symbols locally. +# Lifetime: Fixed in 2.31 +Patch33: binutils-x86-local-relocs.patch + +# Purpose: Stop the assembler from generating GNU build notes against +# linkonce sections. +# Lifetime: Fixed in 2.31 +Patch34: binutils-linkonce-notes.patch + +# Purpose: Fix a seg-fault triggered by running objcopy on a corrupt +# PE format file. +# Lifetime: Fixed in 2.31 +Patch35: binutils-CVE-2018-8945.patch + +# Purpose: Fix handling of local version symbols by the x86 linker. +# Lifetime: Fixed in 2.31 +Patch36: binutils-x86-local-version.patch + +# Purpose: Fix linker testsuite failures +# Lifetime: Fixed in 2.31 (probably) +Patch37: binutils-fix-testsuite-failures.patch + +# Purpose: Correct warning messages about incompatible PowerPC IEEE +# long double sizes in different binaries. +# Lifetime: Fixed in 2.31. +Patch38: binutils-PowerPC-IEEE-long-double-warnings.patch + +# Purpose: Fix the generation of relocations for assembler generated notes. +# Lifetime: Fixed in 2.31. +Patch39: binutils-missing-notes.patch + +# Purpose: Fix the gold linker so that it can handle note sections with +# relocs that refer to discarded code sections. +# Lifetime: Fixed in 2.32 (maybe). +Patch40: binutils-gold-ignore-discarded-note-relocs.patch + +# Purpose: Merge .gnu.build.attribute sections into a single section. +# Lifetime: Fixed in 2.32 +Patch41: binutils-merge-attribute-sections.patch + +# Purpose: Remove empty x86 property notes. +# Lifetime: Fixed in 2.31 +Patch42: binutils-remove-empty-ISA-properties.patch + +# Purpose: Improve objcopy's --merge-notes option. +# Lifetime: Fixed in 2.32 +Patch43: binutils-note-merge-improvements.patch + +# Purpose: Fix GOLDs creation of note segments. +# Lifetime: Fixed in 2.31 [Note - see chmod +x below for this patch]. +Patch44: binutils-gold-note-segment.patch + +# Purpose: Stop readelf's reports of gaps in build notes - they are unreliable. +# Lifetime: Unknown. +Patch45: binutils-disable-readelf-gap-reports.patch + +# Purpose: Stop the x86_64 linker from optimizing away PLT entries. +# Lifetime: Probably fixed by new configure option in 2.32 +Patch46: binutils-x86_64-disable-PLT-elision.patch + +# Purpose: Stop the binutils from statically linking with libstdc++. +# Lifetime: Permanent. +Patch47: 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. +Patch48: binutils-attach-to-group.patch + +# Purpose: Fix a potential buffer overrun when parsing a corrupt ELF file. +# Lifetime: Fixed in 2.32. +Patch49: binutils-CVE-2018-17358.patch + +# Purpose: Make the x86_64 linker produce IBT-enabled TLS stubs. +# Lifetime: Fixed in 2.32. +Patch50: binutils-x86_64-ibt-enabled-tlsdesc.patch + +# Purpose: Have the GOLD linker generate PT_NOTE segments with 8-byte alignment. +# Lifetime: Maybe fixed in 2.32. +Patch51: binutils-gold-8-byte-note-segments.patch + +# Purpose: Add support for disassembling NFP binaries. +# Lifetime: Fixed in 2.31. +Patch52: binutils-nfp.patch + +# Purpose: Add support for the arch13 extension to the s390x architecture. +# Lifetime: Fixed in 2.31. +Patch53: binutils-s390x-arch13.patch + +# Purpose: Add support for partially relocatable GOT sections on the s390x architecture. +# Lifetime: Fixed in 2.31. +Patch54: binutils-s390x-partial-relro.patch + +# Purpose: Do not enable IBT if an object file contains code but no GNU Property notes. +# Lifetime: Fixed in 2.33 +Patch55: binutils-x86-IBT-and-missing-notes.patch + +# Purpose: Fixes a problem with the AArch64 port of the GOLD linker. +# Lifetime: Fixed in 2.32 +Patch56: binutils-AArch64-gold.patch + +# Purpose: Stop the BFD library from complaining about files with multiple +# relocations against the same section. Allows examination of +# special kernel modules. +# Lifetime: Fixed in 2.33 +Patch57: binutils-multiple-relocs-for-same-section.patch + +# Purpose: Add a feature to the x86/64 assembler to create +# workarounds for the Intel Jcc Erratum. +# Lifetime: Fixed in 2.34 +Patch58: binutils-x86_JCC_Erratum.patch + +#---------------------------------------------------------------------------- + +Provides: bundled(libiberty) + +%define gold_arches %{ix86} x86_64 %{arm} aarch64 %{power64} s390x + +%if %{with bootstrap} +%define build_gold no +%else +%ifarch %gold_arches +%define build_gold both +%else +%define build_gold no +%endif +%endif + +%if %{with debug} +# Define this if you want to skip the strip step and preserve debug info. +# Useful for testing. +%define __debug_install_post : > %{_builddir}/%{?buildsubdir}/debugfiles.list +%define debug_package %{nil} +%endif + +Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +# Perl, sed and touch are all used in the %%prep section of this spec file. +BuildRequires: gcc, perl, sed, coreutils + +# Gold needs bison in order to build gold/yyscript.c. +# Bison needs m4. +%if "%{build_gold}" == "both" +BuildRequires: bison, m4, gcc-c++ +%endif + +%if %{without bootstrap} +BuildRequires: gettext, flex, zlib-devel +%endif + +%if %{with docs} +BuildRequires: texinfo >= 4.0 +# BZ 920545: We need pod2man in order to build the manual pages. +BuildRequires: /usr/bin/pod2man +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info +%else +BuildRequires: findutils +%endif + +# Required for: ld-bootstrap/bootstrap.exp bootstrap with --static +# It should not be required for: ld-elf/elf.exp static {preinit,init,fini} array +%if %{with testsuite} +# relro_test.sh uses dc which is part of the bc rpm, hence its inclusion here. +BuildRequires: dejagnu, zlib-static, glibc-static, sharutils, bc +%if "%{build_gold}" == "both" +# The GOLD testsuite needs a static libc++ +BuildRequires: libstdc++-static +%endif +%endif + +Conflicts: gcc-c++ < 4.0.0 + +# The higher of these two numbers determines the default ld. +%{!?ld_bfd_priority: %global ld_bfd_priority 50} +%{!?ld_gold_priority:%global ld_gold_priority 30} + +%if "%{build_gold}" == "both" +Requires(post): coreutils +Requires(post): %{_sbindir}/alternatives +Requires(preun): %{_sbindir}/alternatives +%endif + +# On ARM EABI systems, we do want -gnueabi to be part of the +# target triple. +%ifnarch %{arm} +%define _gnu %{nil} +%endif + +#---------------------------------------------------------------------------- + +%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 devel +Summary: BFD and opcodes static and dynamic libraries and header files +Provides: binutils-static = %{version}-%{release} +%if %{with docs} +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info +%endif +Requires: zlib-devel +Requires: binutils = %{version}-%{release} +# BZ 1215242: We need touch... +Requires: coreutils + +%description devel +This package contains BFD and opcodes static and dynamic libraries. + +The dynamic libraries are in this package, rather than a separate +base package because they are actually linker scripts that force +the use of the static libraries. This is because the API of the +BFD library is too unstable to be used dynamically. + +The static libraries are here because they are now needed by the +dynamic libraries. + +Developers starting new projects are strongly encouraged to consider +using libelf instead of BFD. + +#---------------------------------------------------------------------------- + +%prep +%setup -q -n binutils-%{version} +%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 +%patch44 -p1 +%patch45 -p1 +%patch46 -p1 +%patch47 -p1 +%patch48 -p1 +%patch49 -p1 +%patch50 -p1 +%patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 +%patch55 -p1 +%patch56 -p1 +%patch57 -p1 +%patch58 -p1 + +# We cannot run autotools as there is an exact requirement of autoconf-2.59. +# FIXME - this is no longer true. Maybe try reinstating autotool use ? + +# 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 +# Touch the .info files so that they are newer then the .texi files and +# hence do not need to be rebuilt. This eliminates the need for makeinfo. +# The -print is there just to confirm that the command is working. +%if %{without docs} + find . -name *.info -print -exec touch {} \; +%endif + +# Not sure how this should be done. The file is created by +# patch44. +chmod +x gold/testsuite/gnu_property_test.sh + +%ifarch %{power64} +%define _target_platform %{_arch}-%{_vendor}-%{_host_os} +%endif + +#---------------------------------------------------------------------------- + +%build +echo target is %{binutils_target} + +%ifarch %{power64} +export CFLAGS="$RPM_OPT_FLAGS -Wno-error" +%else +export CFLAGS="$RPM_OPT_FLAGS" +%endif + +CARGS= + +case %{binutils_target} in i?86*|sparc*|ppc*|s390*|sh*|arm*|aarch64*) + CARGS="$CARGS --enable-64-bit-bfd" + ;; +esac + +case %{binutils_target} in ia64*) + CARGS="$CARGS --enable-targets=i386-linux" + ;; +esac + +case %{binutils_target} in ppc*|ppc64*) + CARGS="$CARGS --enable-targets=spu" + ;; +esac + +case %{binutils_target} in ppc64-*) + CARGS="$CARGS --enable-targets=powerpc64le-linux" + ;; +esac + +case %{binutils_target} in ppc64le*) + CARGS="$CARGS --enable-targets=powerpc-linux" + ;; +esac + +case %{binutils_target} in x86_64*|i?86*|arm*|aarch64*) + CARGS="$CARGS --enable-targets=x86_64-pep" + ;; +esac + +%if %{default_relro} + CARGS="$CARGS --enable-relro=yes" +%else + CARGS="$CARGS --enable-relro=no" +%endif + +%if 0%{?_with_debug:1} +CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0" +%define enable_shared 0 +%endif + +# BZ 1541027 - include the linker flags from redhat-rpm-config as well. +export LDFLAGS=$RPM_LD_FLAGS + +# We could optimize the cross builds size by --enable-shared but the produced +# binaries may be less convenient in the embedded environment. +%configure \ + --quiet \ + --build=%{_target_platform} --host=%{_target_platform} \ + --target=%{binutils_target} \ +%ifarch %gold_arches +%if "%{build_gold}" == "both" + --enable-gold=default --enable-ld \ +%else + --enable-gold \ +%endif +%endif +%if %{isnative} + --with-sysroot=/ \ +%else + --enable-targets=%{_host} \ + --with-sysroot=%{_prefix}/%{binutils_target}/sys-root \ + --program-prefix=%{cross} \ +%endif +%if %{enable_shared} + --enable-shared \ +%else + --disable-shared \ +%endif +%if %{enable_deterministic_archives} + --enable-deterministic-archives \ +%else + --enable-deterministic-archives=no \ +%endif +%if %{enable_lto} + --enable-lto \ +%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 + $CARGS \ + --enable-plugins \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla/ + +%if %{with docs} +%make_build %{_smp_mflags} tooldir=%{_prefix} all +%make_build %{_smp_mflags} tooldir=%{_prefix} info +%else +%make_build %{_smp_mflags} tooldir=%{_prefix} MAKEINFO=true all +%endif + +# Do not use %%check as it is run after %%install where libbfd.so is rebuilt +# with -fvisibility=hidden no longer being usable in its shared form. +%if %{without testsuite} +echo ====================TESTSUITE DISABLED========================= +%else +make -k check < /dev/null || : +echo ====================TESTING========================= +cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum +%if "%{build_gold}" == "both" +if [ -f gold/test-suite.log ]; then + cat gold/test-suite.log +fi +if [ -f gold/testsuite/test-suite.log ]; then + cat gold/testsuite/*.log +fi +%endif +echo ====================TESTING END===================== +for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log} +do + ln $file binutils-%{_target_platform}-$(basename $file) || : +done +tar cjf binutils-%{_target_platform}.tar.xz binutils-%{_target_platform}-*.{sum,log} +uuencode binutils-%{_target_platform}.tar.xz binutils-%{_target_platform}.tar.xz +rm -f binutils-%{_target_platform}.tar.xz binutils-%{_target_platform}-*.{sum,log} +%if "%{build_gold}" == "both" +if [-f gold/testsuite/test-suite.log ]; then + tar cjf binutils-%{_target_platform}-gold.log.tar.xz gold/testsuite/*.log + uuencode binutils-%{_target_platform}-gold.log.tar.xz binutils-%{_target_platform}-gold.log.tar.xz + rm -f binutils-%{_target_platform}-gold.log.tar.xz +fi +%endif +%endif + +#---------------------------------------------------------------------------- + +%install +%if %{with docs} +%make_install DESTDIR=%{buildroot} +%else +%make_install DESTDIR=%{buildroot} MAKEINFO=true +%endif + +%if %{isnative} +%if %{with docs} +make prefix=%{buildroot}%{_prefix} infodir=%{buildroot}%{_infodir} install-info +cp %{SOURCE3} %{buildroot}%{_infodir} +%endif + +# Rebuild libiberty.a with -fPIC. +# Future: Remove it together with its header file, projects should bundle it. +%make_build -C libiberty clean +%make_build CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C libiberty + +# Rebuild libbfd.a with -fPIC. +# Without the hidden visibility the 3rd party shared libraries would export +# the bfd non-stable ABI. +%make_build -C bfd clean +%make_build CFLAGS="-g -fPIC $RPM_OPT_FLAGS -fvisibility=hidden" -C bfd + +# Rebuild libopcodes.a with -fPIC. +%make_build -C opcodes clean +%make_build CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C opcodes + +install -m 644 bfd/libbfd.a %{buildroot}%{_libdir} +install -m 644 libiberty/libiberty.a %{buildroot}%{_libdir} +install -m 644 include/libiberty.h %{buildroot}%{_prefix}/include +install -m 644 opcodes/libopcodes.a %{buildroot}%{_libdir} +# Remove Windows/Novell only man pages +rm -f %{buildroot}%{_mandir}/man1/{dlltool,nlmconv,windres,windmc}* +%if %{without docs} +rm -f %{buildroot}%{_mandir}/man1/{addr2line,ar,as,c++filt,elfedit,gprof,ld,nm,objcopy,objdump,ranlib,readelf,size,strings,strip}* +rm -f %{buildroot}%{_infodir}/{as,bfd,binutils,gprof,ld}* +%endif + +%if %{enable_shared} +chmod +x %{buildroot}%{_libdir}/lib*.so* +%endif + +# Prevent programs from linking against libbfd and libopcodes +# dynamically, as they are changed far too often. +rm -f %{buildroot}%{_libdir}/lib{bfd,opcodes}.so + +# Remove libtool files, which reference the .so libs +rm -f %{buildroot}%{_libdir}/lib{bfd,opcodes}.la + +# Sanity check --enable-64-bit-bfd really works. +grep '^#define BFD_ARCH_SIZE 64$' %{buildroot}%{_prefix}/include/bfd.h +# Fix multilib conflicts of generated values by __WORDSIZE-based expressions. +%ifarch %{ix86} x86_64 ppc %{power64} s390 s390x sh3 sh4 sparc sparc64 arm +sed -i -e '/^#include "ansidecl.h"/{p;s~^.*$~#include ~;}' \ + -e 's/^#define BFD_DEFAULT_TARGET_SIZE \(32\|64\) *$/#define BFD_DEFAULT_TARGET_SIZE __WORDSIZE/' \ + -e 's/^#define BFD_HOST_64BIT_LONG [01] *$/#define BFD_HOST_64BIT_LONG (__WORDSIZE == 64)/' \ + -e 's/^#define BFD_HOST_64_BIT \(long \)\?long *$/#if __WORDSIZE == 32\ +#define BFD_HOST_64_BIT long long\ +#else\ +#define BFD_HOST_64_BIT long\ +#endif/' \ + -e 's/^#define BFD_HOST_U_64_BIT unsigned \(long \)\?long *$/#define BFD_HOST_U_64_BIT unsigned BFD_HOST_64_BIT/' \ + %{buildroot}%{_prefix}/include/bfd.h +%endif +touch -r bfd/bfd-in2.h %{buildroot}%{_prefix}/include/bfd.h + +# Generate .so linker scripts for dependencies; imported from glibc/Makerules: + +# This fragment of linker script gives the OUTPUT_FORMAT statement +# for the configuration we are building. +OUTPUT_FORMAT="\ +/* Ensure this .so library will not be used by a link for a different format + on a multi-architecture system. */ +$(gcc $CFLAGS $LDFLAGS -shared -x c /dev/null -o /dev/null -Wl,--verbose -v 2>&1 | sed -n -f "%{SOURCE2}")" + +tee %{buildroot}%{_libdir}/libbfd.so <> %{?cross}binutils.lang +cat %{?cross}bfd.lang >> %{?cross}binutils.lang +cat %{?cross}gas.lang >> %{?cross}binutils.lang +cat %{?cross}gprof.lang >> %{?cross}binutils.lang + +if [ -x ld/ld-new ]; then + %find_lang %{?cross}ld + cat %{?cross}ld.lang >> %{?cross}binutils.lang +fi +if [ -x gold/ld-new ]; then + %find_lang %{?cross}gold + cat %{?cross}gold.lang >> %{?cross}binutils.lang +fi + +#---------------------------------------------------------------------------- + +%post +%if "%{build_gold}" == "both" +%__rm -f %{_bindir}/%{?cross}ld +%{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \ + %{_bindir}/%{?cross}ld.bfd %{ld_bfd_priority} +%{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \ + %{_bindir}/%{?cross}ld.gold %{ld_gold_priority} +if [ $1 = 0 ]; then + %{_sbindir}/alternatives --auto %{?cross}ld +fi +%endif # both ld.gold and ld.bfd + +%if %{isnative} +/sbin/ldconfig + +%if %{with docs} + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/standards.info.gz +%endif # with docs +%endif # isnative + +exit 0 + +#---------------------------------------------------------------------------- + +%preun +%if "%{build_gold}" == "both" +if [ $1 = 0 ]; then + %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.bfd + %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.gold +fi +%endif # both ld.gold and ld.bfd + +%if %{isnative} +if [ $1 = 0 ]; then + if [ -e %{_infodir}/binutils.info.gz ] + then + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + /sbin/install-info --quiet --delete --info-dir=%{_infodir} %{_infodir}/standards.info.gz + fi +fi +%endif # isnative + +exit 0 + +#---------------------------------------------------------------------------- + +%if %{isnative} +%postun +/sbin/ldconfig + if [ -e %{_infodir}/binutils.info.gz ] + then + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz + /sbin/install-info --quiet --delete --info-dir=%{_infodir} %{_infodir}/standards.info.gz + fi +%endif # isnative + +#---------------------------------------------------------------------------- + +%files -f %{?cross}binutils.lang +%license COPYING COPYING3 COPYING3.LIB COPYING.LIB +%doc README +%{_bindir}/%{?cross}[!l]* + +%if "%{build_gold}" == "both" +%{_bindir}/%{?cross}ld.* +%ghost %{_bindir}/%{?cross}ld +%else +%{_bindir}/%{?cross}ld* +%endif # both ld.gold and ld.bfd + +%if %{with docs} +%{_mandir}/man1/* +%{_infodir}/as.info.gz +%{_infodir}/binutils.info.gz +%{_infodir}/gprof.info.gz +%{_infodir}/ld.info.gz +%{_infodir}/standards.info.gz +%endif # with docs + +%if %{enable_shared} +%{_libdir}/lib*.so +%exclude %{_libdir}/libbfd.so +%exclude %{_libdir}/libopcodes.so +%endif # enable_shared + +%if %{isnative} + +%if %{with docs} +%{_infodir}/[^b]*info* +%{_infodir}/binutils*info* +%endif # with docs + +%files devel +%{_prefix}/include/* +%{_libdir}/lib*.a +%{_libdir}/libbfd.so +%{_libdir}/libopcodes.so + +%if %{with docs} +%{_infodir}/bfd*info* +%endif # with docs + +%endif # isnative + +#---------------------------------------------------------------------------- +%changelog +* Mon Dec 16 2019 Nick Clifton - 2.30-58.1 +- Backport H.J.Lu's patch to add a workaround for the JCC Errata to the assembler. (#1783957) + +* Fri Sep 13 2019 Nick Clifton 2.30-58 +- Stop the BFD library from complaining about sections with multiple sets of relocations. (#1749084) + +* Mon May 20 2019 Nick Clifton - 2.30-57 +- Fix a thinko in the new gas tests for the s390x arch13 extension. (#1710860) + +* Mon May 20 2019 Nick Clifton - 2.30-56 +- Remove a spurious debugging message left in the binutils-note-merge-improvements.patch. + +* Mon May 20 2019 Nick Clifton - 2.30-55 +- Fix a problem when producing non-PIE binaries using the GOLD linker for AArch64. (#1693661) + +* Thu Mar 14 2019 Nick Clifton - 2.30-54 +- Further enhance the support for the arch13 extensions to the s390x architecture. (#1659437) + +* Wed Mar 13 2019 Nick Clifton - 2.30-53 +- Do not enable IBT when an object file contains code but no GNU Property notes. (#1687774) + +* Mon Mar 11 2019 Nick Clifton - 2.30-52 +- Add support for partially relocatable GOT sections on the s390x architecture. (#1525406) + +* Mon Mar 11 2019 Nick Clifton - 2.30-51 +- Add support for the arch13 extension to the s390x architecture. (#1659437) + +* Mon Mar 11 2019 Nick Clifton - 2.30-50 +- Add support for disassembling NFP binaries. (#1644391) + +* Tue Oct 09 2018 Nick Clifton - 2.30-49 +- Have the GOLD linker produce 8-byte aligned GNU Property notes. (#1614908) + +* Mon Oct 08 2018 Nick Clifton - 2.30-48 +- Make the x86_64 linker produce IBT-enabled TLS stubs. (PR 23000). (#1637072) + +* Tue Sep 25 2018 Nick Clifton - 2.30-47 +- Fix a potential buffer overrun when parsing a corrupt ELF file. (#1632912) + +* Tue Sep 25 2018 Nick Clifton - 2.30-46 +- Add a .attach_to_group pseuo-op to assembler (for use by annobin). (#1630574) + +* Thu Sep 20 2018 Nick Clifton - 2.30-45 +- Stop the binutils from statically linking with libstdc++. (#1630550) + +* Thu Sep 20 2018 Nick Clifton - 2.30-44 +- Include gold testsuite results in test logs. + +* Wed Sep 19 2018 Nick Clifton - 2.30-43 +- Add (very basic) gating tests for the binutils. (#1625683) + +* Wed Sep 12 2018 Nick Clifton - 2.30-42 +- Update x86_64 linker testsuite after previous delta. (#1624779) + +* Wed Sep 05 2018 Nick Clifton - 2.30-41 +- Disable the x86_64 linker's elimination of PLT entries. (#1624779) + +* Wed Sep 05 2018 Nick Clifton - 2.30-40 +- Disable readelf's reporting of gaps in build notes. (#1623556) + +* Wed Sep 05 2018 Nick Clifton - 2.30-39 +- Fix some more PowerPC64 linker testsuite failures. (#1584565) + +* Fri Aug 17 2018 Nick Clifton - 2.30-38 +- Remove PLT eliision patch. (#1618748) +- Restore the binutils-2.25-set-long-long.patch. + +* Fri Aug 17 2018 Nick Clifton - 2.30-36 +- Fix GOLDs creation of PT_NOTE segments. (#1614908) (#1614920) + +* Mon Aug 06 2018 Nick Clifton - 2.30-35 +- Improve objcopy's --merge-notes option. (#1608390) + +* Mon Jul 30 2018 Nick Clifton - 2.30-34 +- Remove x86 ISA property notes with empty bits. (#1609801) + +* Mon Jul 30 2018 Florian Weimer - 2.30-33 +- Rebuild with fixed binutils + +* Mon Jul 30 2018 Nick Clifton - 2.30-32 +- Move the .gnu.build.attributes section to after the .comment section. + +* Fri Jul 27 2018 Nick Clifton - 2.30-31 +- Fix a thinko in the merge patch. + +* Fri Jul 27 2018 Nick Clifton - 2.30-30 +- Fix a typo in the merge patch. + +* Thu Jul 26 2018 Nick Clifton - 2.30-29 +- Merge .gnu.build.attribute sections together. (#1608390) + +* Tue Jul 24 2018 Nick Clifton 2.30-27 +- Fix the gold linker so that it can handle relocs in discardeable note sections. (#1607054) + +* Fri Jul 6 2018 Nick Clifton 2.30-26 +- Fix the generation of relocations for assembler created notes. (#1598551) + +* Wed Jul 4 2018 Peter Robinson 2.30-25 +- Minor spec cleanups and fixes. + +* Mon Jun 18 2018 Nick Clifton 2.30-24 +- When installing both ld.bfd and ld.gold, do not reset the current alternative if upgrading. (#1592069) + +* Tue Jun 12 2018 Nick Clifton 2.30-23 +- Correct warning messages about incompatible PowerPC IEEE long double settings. + +* Fri Jun 01 2018 Nick Clifton 2.30-22 +- Fix handling of local versioned symbols by the x86 linker. (PR 23194) +- Fix linker testsuite failures. + +* Thu May 17 2018 Nick Clifton 2.30-21 +- Fix a seg-fault parsing PE format binaries. (#1560829) + +* Mon May 14 2018 Nick Clifton 2.30-20 +- Have the x86 linker resolve relocations against the _end, _edata and __bss_start symbols locally. (#1576735) +- Do not generate GNU build notes for linkonce sections. (#1576362) + +* Thu May 10 2018 Nick Clifton 2.30-19 +- Fix a seg-fault running objcopy on a corrupt PE format file. (#1574702) +- Fix a seg-fault running objcopy on a corrupt ELF format file. (#1574705) + +* Tue May 01 2018 Nick Clifton 2.30-18 +- Fix a seg-fault parsing corrupt DWARF information. (#1573360) +- Fix another seg-fault parsing corrupt DWARF information. (#1573367) +- Fix a seg-fault copying a corrupt ELF file. (#1551788) +- Fix a seg-fault parsing a large ELF files on a 32-bit host. (#1539891) +- Fix a seg-fault running nm on a corrupt ELF file. (#15343247) +- Fix a seg-fault running nm on a file containing corrupt DWARF information. (#1551781) +- Fix another seg-fault running nm on a file containing corrupt DWARF information. (#1551763) + +* Fri Apr 27 2018 Nick Clifton 2.30-17 +- Disable the automatic generation of annobin notes. (#1572485) + +* Fri Apr 27 2018 Nick Clifton 2.30-16 +- Fix for PR 22887 - crashing objdump by passing it a corrupt AOUT binary. (#1553115) +- Fix for PR 22905 - crashing objdump by passing it a corrupt DWARF file. (#1553122) +- Fix for PR 22741 - crashing objdump by passing it a corrupt COFF file. (#1571918) + +* Thu Apr 26 2018 Nick Clifton 2.30-15 +- Enhance the assembler to automatically generate annobin notes if none are present in the input. + +* Thu Mar 22 2018 Nick Clifton 2.30-14 +- Fix the GOLD linker's processing of protected symbols created by the LLVM plugin. (#1559234 and PR 22868) + +* Wed Mar 14 2018 Nick Clifton 2.30-13 +- Do not discard debugobj files created by GCC v8 LTO wrapper. (#1543912 and RHBZ 84847 and PR 20882) + +* Fri Mar 09 2018 Nick Clifton 2.30-12 +- Treat relocs against s390x IFUNC symbols in note sections as relocs against the FUNC symbol instead. +- Combined previous patches into one which covers all ifunc supporting architectures. (#1553705) +- Retire binutils-s390-ifunc-relocs-in-notes.patch +- Retire binutils-x86_64-ifunc-relocs-in-notes.patch + +* Fri Mar 09 2018 Nick Clifton 2.30-11 +- Treat relocs against s390x IFUNC symbols in note sections as relocs against the FUNC symbol instead. (#1553705) + +* Wed Mar 07 2018 Nick Clifton 2.30-10 +- Ignore duplicate symbols generated by GOLD. (#1458003) + +* Mon Mar 05 2018 Nick Clifton 2.30-9 +- Speed up objdump. (#1551540) + +* Fri Mar 02 2018 Nick Clifton 2.30-8 +- Version bump to allow rebuilding and tagging in to the buildroot. + +* Tue Feb 27 2018 Nick Clifton 2.30-7 +- Stop strip from replacing unknown relocs with null relocs. (#1545386) + +* Thu Feb 22 2018 Patrick Uiterwijk - 2.30-6 +- Fix R_AARCH64 symbols (PR 22764) (#1547781) + +* Thu Feb 15 2018 Nick Clifton 2.30-5 +- Fix assignment of pages to segments. (PR 22758) + +* Thu Feb 08 2018 Nick Clifton 2.30-4 +- Inject RPM_LD_FLAGS into the build. (#1541027) + +* Thu Feb 08 2018 Nick Clifton 2.30-3 +- Fix slowdown in readelf when examining files with lots of debug information. (PR 22802) + +* Thu Feb 08 2018 Nick Clifton 2.30-2 +- Remove support for PowerPC speculation barrier insertion. + +* Tue Feb 06 2018 Nick Clifton 2.30-1 +- Rebase on 2.30 + +* Tue Dec 19 2017 Nick Clifton 2.29.1-8 +- Add standards.info file to documentation distributed with the binutils package. (#1467390 and #1520899) + +* Mon Dec 11 2017 Nick Clifton 2.29.1-7 +- Do not enable relro by default for the PowerPC64 architecture. (#1523946) + +* Fri Dec 08 2017 Nick Clifton 2.29.1-6 +- Stop strip from crashing when deleteing relocs in a file with annobin notes. (#1520805) + +* Wed Dec 06 2017 Nick Clifton 2.29.1-5 +- Have readelf return an exit failure status when attempting to process an empty file. (PR 22555) + +* Thu Nov 16 2017 Nick Clifton 2.29.1-4 +- Prevent the PowerPC64 linker from triggering a seg-fault when discarding dynamic sections. (#1513014) +- Prevent a seg-fault when attempting to pad a section with a NULL padding pointer. +- Do not create PLT entries for AARCH64 IFUNC symbols referenced in debug sections. +- Fix compile time warning messages. + +* Wed Nov 15 2017 Nick Clifton 2.29.1-3 +- Disable PLT elision for x86/x86_64. (#1452111 and #1333481) +- Fix the GOLD linkers generation of relocations for start and stop symbols. (#1500898) + +* Thu Sep 28 2017 Nick Clifton 2.29.1-2 +- Enable GOLD for PPC64 and s390x. (#1173780) +- Retire: binutils-2.20.51.0.10-sec-merge-emit.patch. + (It has been redundant for a long time now...) + +* Wed Sep 27 2017 Nick Clifton 2.29.1-1 +- Rebase on FSF binutils 2.29.1 release. +- Retire: binutils-2.29-ppc64-plt-localentry0-disable.patch +- Retire: binutils-2.29-non-elf-orphan-skip.patch + +* Thu Sep 14 2017 Nick Clifton 2.29-10 +- Extend fix for PR 21884. + (#1491023) + +* Thu Sep 14 2017 Nick Clifton 2.29-8 +- Import fix for PR 21884 which stops a seg-fault in the linker when changing output format to binary during a final link. + (#1491023) + +* Sun Sep 10 2017 Nick Clifton - 2.29-7 +- Annotate patches with reason and lifetime expectances. +- Retire: binutils-2.24-ldforcele.patch +- Retire: binutils-2.25-set-long-long.patch +- Retire: binutils-2.25.1-cleansweep.patch +- Retire: binutils-2.26-fix-compile-warnings.patch +- Retire: binutils-2.28-ignore-gold-duplicates.patch + +* Wed Aug 02 2017 Fedora Release Engineering - 2.29-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Mon Jul 31 2017 Nick Clifton 2.29-5 +- Update ppc64 localentry0 patch with changes made by Alan Modra to the FSF binutils sources. + (#1475636) + +* Sun Jul 30 2017 Florian Weimer - 2.29-4 +- Rebuild with binutils fix for ppc64le, bootstrapping (#1475636) + +* Fri Jul 28 2017 Nick Clifton 2.29-3 +- Do not enable the PPC64 plt-localentry0 linker optimization by default. + (#1475636) + +* Wed Jul 26 2017 Fedora Release Engineering - 2.29-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jul 24 2017 Nick Clifton 2.29-1 +- Rebase on FSF binutils 2.29. +- Retire: binutils-2.20.51.0.10-ppc64-pie.patch +- Retire: binutils-2.27-ld-buffer-overflow.patch +- Retire: binutils-2.28-libiberty-bugfixes.patch +- Retire: binutils-gnu-build-notes.patch +- Retire: binutils-2.28-gas-comp_dir.patch +- Retire: binutils-2.28-ppc-dynamic-relocs.patch +- Retire: binutils-2.28-dynamic-section-warning.patch +- Retire: binutils-2.28-aarch64-copy-relocs.patch +- Retire: binutils-2.28-DW_AT_export_symbols.patch + +* Thu Jul 20 2017 Nick Clifton 2.28-14 +- Remove -flto compile time option accidentally added to CFLAGS. + +* Thu Jul 20 2017 Nick Clifton 2.28-13 +- Add support for displaying new DWARF5 tags. + (#1472966) + +* Wed Jul 19 2017 Nick Clifton 2.28-12 +- Correct snafu in previous delta that broke building s390 binaries. + (#1472486) + +* Mon Jul 17 2017 Nick Clifton 2.28-11 +- Fix s390 assembler so that it remove fake local symbols from its output. + (#1460254) + +* Wed Jun 28 2017 Nick Clifton 2.28-10 +- Update support for GNU Build Attribute notes to include version 2 notes. + +* Thu Jun 15 2017 Nick Clifton 2.28-9 +- Update patch to fix AArch64 copy reloc generation. + (#1452170) + +* Fri Jun 09 2017 Nick Clifton 2.28-8 +- Ignore duplicate indirect symbols generated by the GOLD linker. + (#1458003) + +* Thu Jun 08 2017 Nick Clifton 2.28-7 +- Eliminate the generation of incorrect dynamic copy relocations on AArch64. + (#1452170) + +* Mon May 15 2017 Fedora Release Engineering - 2.28-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild + +* Mon Mar 20 2017 Nick Clifton 2.28-5 +- Update GNU BUILD NOTES patch. +- Import FSF binutils patch to fix running readelf on debug info binaries. + (#1434050) + +* Wed Mar 08 2017 Nick Clifton 2.28-4 +- Update GNU BUILD NOTES patch. +- Import FSF binutils patch to fix an abort with PowerPC dynamic relocs. + +* Mon Mar 06 2017 Mark Wielaard 2.28-3 +- Backport patch to add support for putting name, comp_dir and + producer strings into the .debug_str section. + (#1429389) + +* Fri Mar 03 2017 Nick Clifton 2.28-2 +- Add support for GNU BUILD NOTEs. + +* Thu Mar 02 2017 Nick Clifton 2.28-1 +- Rebase on FSF binutils v2.28. +- Retire: binutils-2.23.52.0.1-addr2line-dynsymtab.patch +- Retire: binutils-2.27-local-dynsym-count.patch +- Retire: binutils-2.27-monotonic-section-offsets.patch +- Retire: binutils-2.27-arm-aarch64-default-relro.patch +- Retire: binutils-2.28-gold.patch +- Retire: binutils-2.27-objdump-improvements.patch +- Retire: binutils-2.27-dwarf-parse-speedup.patch +- Retire: binutils-2.27-objdump-improvements.2.patch +- Retire: binutils-2.27-arm-binary-objects.patch +- Retire: binutils-2.27-ppc-fp-attributes.patch +- Add patch to sync libiberty with FSF GCC mainline. + (#1428310) + +* Fri Feb 17 2017 Nick Clifton 2.27-19 +- Add support for PowerPC FP attributes. + (#1422461) + +* Wed Feb 15 2017 Nick Clifton 2.27-18 +- Fix running the ARM port of the linker on BINARY objects. + (#1422577) + +* Fri Feb 10 2017 Fedora Release Engineering - 2.27-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 02 2017 Stephen Gallagher 2.27-16 +- Install COPYING[*] files using the % license macro. + (#1418430) + +* Tue Jan 31 2017 Nick Clifton 2.27-15 +- Fix buffer overflows when printing translated messages. + (#1417411) + +* Mon Jan 16 2017 Nick Clifton 2.27-14 +- Include the filename concerned in readelf error messages. + (#1412348) + +* Mon Jan 09 2017 Nick Clifton 2.27-13 +- Another speed up for objdump when displaying source code alognside disassembly. + (#1397113) + +* Tue Nov 22 2016 Nick Clifton 2.27-12 +- Speed up objdump when displaying source code alognside disassembly. + (#1397113) + +* Tue Nov 08 2016 Nick Clifton 2.27-11 +- Fix objdumps disassembly of dynamic executables. + (#1370275) + +* Fri Nov 04 2016 Nick Clifton 2.27-10 +- Fix GOLD for ARM and AARCH64 + (#1386126) + +* Mon Sep 26 2016 Mark Pryor 2.27-9 +- Fix invocation of /sbin/ldconfig when reinstalling binutils + in order to prevent warnings from rpm. + (#1379030) + (#1379117) + +* Thu Sep 22 2016 Mark Pryor 2.27-8 +- Add i386pep emulation for all EFI capable CPU types. + (#1376870) + +* Wed Sep 21 2016 Nick Clifton 2.27-7 +- Use --with-sysroot=/ for native targets. This prevents the default + sysroot of /usr/local//sys-root from being used, which breaks + locating needed shared libaries, but still allows the --sysroot + linker command line option to be effective. + (#1374889) + (#1377803) + (#1377949) + +* Tue Sep 20 2016 Nick Clifton 2.27-6 +- Omit building GOLD when bootstrapping. +- Add a generic build requirement on gcc. +- Move bison and m4 build requirements to be conditional upon building GOLD. +- Add --with-sysroot configure option when building native targets. +- Skip PR14918 linker test for ARM native targets. + (#1374889) + +* Fri Sep 16 2016 Nick Clifton 2.27-5 +- Add support for building the rpm with "--with bootstrap" enabled. +- Retire: binutils-2.20.51.0.2-ia64-lib64.patch + +* Thu Sep 01 2016 Nick Clifton 2.27-4 +- Properly disable the default generation of compressed debug sections. + (#1366182) + +* Fri Aug 19 2016 Nick Clifton 2.27-3 +- Put sections in a monotonically increasing order of file offset. +- Allow ARM and AArch64 targets to have relro on by default. + +* Mon Aug 15 2016 Nick Clifton 2.27-2 +- Fix computation of sh_info field in the header of .dynsym sections. + +* Wed Aug 03 2016 Nick Clifton 2.27-1 +- Rebase on FSF binutils 2.27 release. +- Retire: binutils-2.26-formatting.patch +- Retire: binutils-2.26-Bsymbolic_PIE.patch +- Retire: binutils-rh1312151.patch +- Retire: binutils-2.26-fix-GOT-offset-calculation.patch +- Retire: binutils-2.26-common-definitions.patch +- Retire: binutils-2.26-x86-PIE-relocations.patch + +* Mon Jun 13 2016 Nick Clifton 2.26-23 +- Enable support for GCC's LTO. + (#1342618) + +* Thu Jun 02 2016 Nick Clifton 2.26-22 +- Retire the copy-osabi patch. + (#1252066) + +* Mon May 09 2016 Nick Clifton 2.26-21 +- Fix another compile time warning, this time in tc-arm.c. + (#1333695) + +* Fri Apr 22 2016 Nick Clifton 2.26-20 +- Housekeeping: Delete retired patches. Renumber patches. +- Increase version number past F24 because F24 update is blocked by a version number comparison. + +* Fri Mar 18 2016 Nick Clifton 2.26-16 +- Import patch to fix generation of x86 relocs in PIE mode. (PR 19827) + +* Mon Mar 14 2016 Nick Clifton 2.26-15 +- Import patch to have common symbols in an executable override definitions in shared objects (PR 19579) + (#1312507) + +* Mon Feb 29 2016 Nick Clifton 2.26-14 +- Import patch to fix x86 GOT offset calculation in 2.26 sources (PR 19601) + (#1312489) + +* Fri Feb 26 2016 Nick Clifton 2.26-13 +- Import patch to fix symbol versioning bug in 2.26 sources (PR 19698) + (#1312151) + +* Fri Feb 19 2016 Nick Clifton 2.26-12 +- Import H.J.Lu's kernel LTO patch. + (#1302071) + +* Tue Feb 16 2016 poma 2.26-11 +- Enable -Bsymbolic and -Bsymbolic-functions to PIE. Needed by Syslinux + (#1308296) + +* Wed Feb 10 2016 Nick Clifton 2.26-10 +- Retire: binutils-2.23.2-aarch64-em.patch + (#1305179) + +* Tue Feb 09 2016 Nick Clifton 2.26-9 +- Fix indentation in bfd/elf64-s390.c, gas/config/tc-ia64.c + and bfd/pe-mips.c to avoid compile time warnings. + +* Thu Feb 04 2016 Nick Clifton 2.26-8 +- Fix indentation in bfd/coff-[i386|x86_64].c to avoid compile time warning. +- Suppress GOLD's dir_caches destructor. +- Suppress GOLD's Reloc_stub::Key::name function. +- Suppress unused ARM architecture variations in GAS. + +* Wed Feb 03 2016 Fedora Release Engineering - 2.26-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jan 27 2016 Nick Clifton 2.26-4 +- Drop the kernel patch entirely... +- Retire: binutils-2.25-kernel-ld-r.patch +- Retire: binutils-2.25.1-plugin-format-checking.patch + +* Tue Jan 26 2016 Nick Clifton 2.26-3 +- Fix kernel patch for AVR targets. + +* Mon Jan 25 2016 Nick Clifton 2.26-2 +- Fix kernel patch for PPC32 targets. + +* Mon Jan 25 2016 Nick Clifton 2.26-1 +- Rebase on FSF binutils 2.26 release. +- Retire: binutils-2.25.1-ihex-parsing.patch +- Retire: binutils-2.25.1-dynamic_list.patch +- Retire: binutils-2.25.1-aarch64-pr18668.patch +- Retire: binutils-rh1247126.patch + (#1271387) + +* Thu Nov 05 2015 Nick Clifton 2.25.1-9 +- Prevent an infinite recursion when a plugin tries to claim a file in an unrecognised format. + (#1174065) + +* Wed Oct 28 2015 Nick Clifton 2.25.1-8 +- Enable little endian support when configuring for 64-bit PowerPC. + (#1275709) + +* Thu Sep 24 2015 Nick Clifton 2.25.1-7 +- Fix incorrectly generated binaries and DSOs on PPC platforms. + (#1247126) + +* Fri Sep 11 2015 Nick Clifton 2.25.1-6 +- Fix handling of AArch64 local GOT relocs. (#1262091) + +* Thu Sep 10 2015 Nick Clifton 2.25.1-5 +- Do not enable deterministic archives by default (#1195883) + +* Thu Aug 06 2015 Rex Dieter 2.25.1-4 +- Qt linked with gold crash on startup (#1193044) + +* Tue Aug 04 2015 Nick Clifton - 2.25.1-3 +- Fix the parsing of corrupt iHex files. +- Resovles: 1250141 + +* Tue Aug 04 2015 Nick Clifton - 2.25.1-2 +- Retire: binutils-2.25-aarch64-fPIC-error.patch +- Resovles: 1249969 + +* Thu Jul 23 2015 Nick Clifton - 2.25.1-1 +- Rebase on FSF binutils 2.25.1 release. +- Retire: binutils-2.25-x86_64-pie-relocs.patch + +* Thu Jul 02 2015 Nick Clifton - 2.25-12 +- For AArch64 issue an error message when attempting to resolve a + PC-relative dynamic reloc in a non-PIC object file. +- Related: 1232499 + +* Wed Jun 17 2015 Fedora Release Engineering - 2.25-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Jun 10 2015 Nick Clifton - 2.25-10 +- Make the AArch64 GOLD port use 64K pages. +- Resolves: BZ #1225156 and BZ #1215546 + +* Mon Apr 27 2015 Nick Clifton - 2.25-8 +- Require the coreutils so that touch is available. +- Resolves: BZ #1215242 + +* Tue Apr 21 2015 Nick Clifton - 2.25-7 +- Enable building GOLD for the AArch64. +- Resolves: BZ #1203057 + +* Thu Mar 19 2015 Nick Clifton - 2.25-6 +- Remove the windmc manual page, so that it is not installed. +- Resolves: BZ #1203606 + +* Sat Feb 21 2015 Till Maas - 2.25-6 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Mon Feb 02 2015 Nick Clifton - 2.25-5 +- Fix scanning for object symbols in binutils-2.25-kernel-ld-r.patch +- Resolves: BZ #1149660 + +* Tue Jan 20 2015 Nick Clifton - 2.25-4 +- Import the fix for PR ld/17827 from FSF mainline. +- Resolves: BZ #1182511 + +* Mon Jan 12 2015 Nick Clifton - 2.25-3 +- Suppress building of GOLD for PPC, for now... +- Resolves: BZ #1173780 + +* Sat Dec 27 2014 Ralf Corsépius - 2.25-2 +- Reflect configure.info/standards.info having been dropped (RHBZ#1177359). + +* Wed Dec 24 2014 Nick Clifton - 2.25-1 +- Rebase on FSF binutils 2.25 release. +- Retire: binutils-2.24-s390-mkopc.patch +- Retire: binutils-2.24-elfnn-aarch64.patch +- Retire: binutils-2.24-DW_FORM_ref_addr.patch +- Retire: binutils-2.24-set-section-macros.patch +- Retire: binutils-2.24-fake-zlib-sections.patch +- Retire: binutils-2.24-arm-static-tls.patch +- Retire: binutils-2.24-fat-lto-objects.patch +- Retire: binutils-2.24-symbol-warning.patch +- Retire: binutils-2.24-aarch64-ld-shared-non-PIC-xfail.patch +- Retire: binutils-2.24-weak-sym-merge.patch +- Retire: binutils-2.24-indirect-chain.patch +- Retire: binutils-2.24-aarch64-fix-final_link_relocate.patch +- Retire: binutils-2.24-aarch64-fix-gotplt-offset-ifunc.patch +- Retire: binutils-2.24-aarch64-fix-static-ifunc.patch +- Retire: binutils-2.24-aarch64-fix-ie-relax.patch +- Retire: binutils-HEAD-change-ld-notice-interface.patch +- Retire: binutils-2.24-corrupt-binaries.patch +- Retire: binutils-2.24-strings-default-all.patch +- Retire: binutils-2.24-corrupt-ar.patch + +* Thu Nov 13 2014 Nick Clifton - 2.24-29 +- Fix problems with the ar program reported in FSF PR 17533. + Resolves: BZ #1162666, #1162655 + +* Fri Oct 31 2014 Nick Clifton - 2.24-28 +- Fix buffer overrun in ihex parser. +- Fix memory corruption in previous patch. +- Consoldiate corrupt handling patches into just one patch. +- Default strings command to using -a. + +* Wed Oct 29 2014 Nick Clifton - 2.24-27 +- Fix memory corruption bug introduced by the previous patch. + +* Tue Oct 28 2014 Nick Clifton - 2.24-26 +- Import patches for PR/17510 and PR/17512 to fix reading corrupt ELF binaries. + Resolves: BZ #1157276, #1157277 + +* Mon Oct 27 2014 Nick Clifton - 2.24-25 +- Import patch from mainline to fix seg-fault when reading corrupt group headers. + Resolves: BZ #1157276 + +* Fri Oct 24 2014 Nick Clifton - 2.24-24 +- Import patch from mainline to fix seg-fault when reading corrupt srec fields. + Resolves: BZ #1156272 + +* Mon Aug 25 2014 Kyle McMartin - 2.24-23 +- aarch64: increase common page size to 64KB +- binutils-HEAD-change-ld-notice-interface.patch: backport fix from HEAD + that fixes LTO + ifunc when using ld.bfd instead of gold. +- binutils-2.24-aarch64-fix-gotplt-offset-ifunc.patch + binutils-2.24-aarch64-fix-static-ifunc.patch, split elfnn-aarch64 patches + into upstream git commits, to make it easier to figure out what's + backported already +- binutils-2.24-aarch64-fix-ie-relax.patch: add fix for gd to ie relaxation + when target register is >16 (pretty unlikely, but...) + +* Thu Aug 21 2014 Kyle McMartin - 2.24-22 +- bfd/elfnn-aarch64.c: use correct offsets in final_link_relocate + Resolves: BZ #1126199 + +* Thu Aug 21 2014 Nick Clifton - 2.24-21 +- Import patch from mainline to fix indirect symbol resolution. + Resolves: BZ #1123714 + +* Tue Aug 19 2014 Nick Clifton - 2.24-20 +- Enable deterministic archives by default. + Resolves: BZ #1124342 + +* Fri Aug 15 2014 Fedora Release Engineering - 2.24-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 15 2014 Nick Clifton - 2.24-18 +- Correct elf_merge_st_other arguments for weak symbols. + Resolves: #1126436 + +* Tue Aug 12 2014 Jeff Law - 2.24-17 +- Enable gold for PPC. + +* Tue Jun 24 2014 Kyle McMartin - 2.24-16 +- Backport a couple LTO testsuite fixes from HEAD. + Default to -ffat-lto-objects for some ld tests, which was the default in + gcc 4.8, but changed in 4.9, and resulted in some failures. +- Add STATIC_TLS flag on ARM when IE relocs are emitted in a shared + library. Also fix up offsets in the testsuite resulting from the + addition of the flags. +- XFail some ld tests on AArch64 to cut some of the spurious testsuite + failures down. + +* Sat Jun 07 2014 Fedora Release Engineering - 2.24-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri May 09 2014 Nick Clifton - 2.24-14 +- Fix detection of little endian PPC64 binaries. (#1095885) + +* Mon Apr 28 2014 Nick Clifton - 2.24-13 +- Fix detection of uncompressed .debug_str sections. (#1082370) + +* Tue Apr 22 2014 Nick Clifton - 2.24-12 +- Fix compiling using gcc 4.9 (#1087374) + +* Thu Mar 27 2014 Nick Clifton - 2.24-11 +- Use {version} in Source string. Delete unused patches. + +* Tue Jan 28 2014 Nick Clifton - 2.24-10 +- Fix decoding of abbrevs using a DW_FORM_ref_addr attribute. (#1056797) + +* Tue Dec 17 2013 Nick Clifton - 2.24-9 +- Import fixes on 2.24 branch that affect AArch64 IFUNC and PLT handling. + +* Thu Dec 05 2013 Nick Clifton - 2.24-8 +- Fix building opcodes library with -Werror=format-security. (#1037026) + +* Wed Dec 04 2013 Jeff Law - 2.24-7 +- Update to official binutils 2.24 release. + +* Thu Nov 21 2013 Nick Clifton - 2.24-6 +- Update binutils 2.24 snapshot. + +* Mon Nov 11 2013 Nick Clifton - 2.24-5 +- Update binutils 2.24 snapshot. +- Switch to using GIT instead of CVS to access the FSF repository. +- Retire binutils-2.24-nm-dynsym.patch + +* Fri Oct 25 2013 Nick Clifton - 2.24-4 +- Update binutils 2.24 snapshot. +- Stop NM from halting if it encounters a file with no symbols when displaying dynamic symbols in multiple files. (#1022845) + +* Fri Oct 18 2013 Nick Clifton - 2.24-3 +- Update binutils 2.24 snapshot. + +* Fri Oct 11 2013 Nick Clifton - 2.24-2 +- Update binutils 2.24 snapshot. + +* Fri Oct 04 2013 Nick Clifton - 2.24-1 +- Rebase on binutils 2.24 snapshot. +- Retire: binutils-2.23.52.0.1-64-bit-thin-archives.patch, +- binutils-2.23.52.0.1-as-doc-texinfo-fixes.patch, +- binutils-2.23.52.0.1-check-regular-ifunc-refs.patch, +- binutils-2.23.2-ld-texinfo-fixes.patch, +- binutils-2.23.2-bfd-texinfo-fixes.patch, +- binutils-2.23.2-dwz-alt-debuginfo.patch +- binutils-2.23.2-s390-gas-machinemode.patch +- binutils-2.23.2-xtensa.memset.patch +- binutils-2.23.2-s390-zEC12.patch +- binutils-2.23.2-arm-add-float-abi-to-e_flags.patch +- binutils-2.23.51.0.1-readelf-flush-stdout.patch + +* Mon Sep 09 2013 Nick Clifton - 2.23.88.0.1-14 +- Make readelf flush stdout before emitting an error or warning message. (#1005182) + +* Fri Aug 30 2013 Kyle McMartin 2.23.88.0.1-13 +- Add the hard-float/soft-float ABI flag as appropriate for + ET_DYN/ET_EXEC in EABI_VER5. +- Fix last changelog entry, it was release 12, not 14. + +* Wed Aug 14 2013 Nick Clifton 2.23.88.0.1-12 +- Add support for the s/390 zEC12 architecture to gas. (#996395) + +* Mon Aug 12 2013 Nick Clifton 2.23.88.0.1-11 +- Fix typos in invocations of memset in elf32-xtensa.c + +* Wed Aug 07 2013 Karsten Hopp 2.23.88.0.1-10 +- disable -Werror on ppc64p7 for #918189 + +* Sat Aug 03 2013 Fedora Release Engineering - 2.23.88.0.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri Jul 19 2013 Nick Clifton - 2.23.88.0.1-8 +- Add support for the S/390 .machinemode pseudo-op to GAS. (#986031) + +* Fri Jul 05 2013 Nick Clifton - 2.23.88.0.1-7 +- Add a requirement for libstdc++-static when running the GOLD testsuite. + +* Wed Jun 05 2013 Nick Clifton - 2.23.88.0.1-6 +- Fix building of aarch64 targets after applying the patch for kernel ld -r modules. +- Fix building when "--with debug" is specified. + +* Wed May 29 2013 Nick Clifton - 2.23.88.0.1-5 +- Add support for the alternative debuging files generated by the DWZ program. (#965255) + +* Fri May 17 2013 Nick Clifton - 2.23.88.0.1-4 +- Import H.J.'s patch to add support for kernel ld -r modules. +- Fix errors reported by version 5.0 of texinfo when parsing bfd documentation. + +* Fri Apr 26 2013 Nick Clifton - 2.23.88.0.1-3 +- Fix errors reported by version 5.0 of texinfo when parsing assembler documentation. + +* Thu Apr 25 2013 Nick Clifton - 2.23.88.0.1-2 +- Fix errors reported by version 5.0 of texinfo when parsing linker documentation. + +* Wed Apr 24 2013 Nick Clifton - 2.23.88.0.1-1 +- Switch over to basing sources on the official FSF binutils releases. +- Retire binutils-2.23.52.0.1-revert-pr15149.patch. +- Update binutils-2.22.52.0.1-relro-on-by-default.patch and binutils-2.23.52.0.1-as-doc-texinfo-fixes.patch. + +* Wed Apr 17 2013 Nick Clifton - 2.23.52.0.1-10 +- Import patch for FSF mainline PR 15371 to fix ifunc references in shared libraries. (#927818) + +* Thu Mar 14 2013 Nick Clifton - 2.23.52.0.1-9 +- Enhance opncls.c:find_separate_debug_file() to look in Fedora specific locations. +- Enhance dwarf2.c:find_line() to work with shared libraries. (#920542) + +* Wed Mar 13 2013 Nick Clifton - 2.23.52.0.1-8 +- Fix addr2line to use dynamic symbols if it failed to canonicalize ordinary symbols. (#920542) + +* Wed Mar 13 2013 Nick Clifton - 2.23.52.0.1-7 +- Change requirement to explicitly depend upon /usr/bin/pod2man. (#920545) + +* Wed Mar 13 2013 Nick Clifton - 2.23.52.0.1-6 +- Require perl for pod2man for building man pages. (#920545) + +* Fri Mar 08 2013 Nick Clifton - 2.23.52.0.1-5 +- Reverts patch for PR15149 - prevents report weak DT_NEEDED symbols. (#918003) + +* Wed Mar 06 2013 Nick Clifton - 2.23.52.0.1-4 +- Enable building of GOLD for the ARM. (#908966) + +* Mon Mar 04 2013 Nick Clifton - 2.23.52.0.1-3 +- Fix errors reported by version 5.0 of texinfo when parsing assembler documentaion. + +* Fri Mar 01 2013 Nick Clifton - 2.23.52.0.1-2 +- Fix the creation of index tables in 64-bit thin archives. (#915411) + +* Thu Feb 28 2013 Nick Clifton - 2.23.52.0.1-1 +- Rebase on 2.23.51.0.1 release. (#916516) + +* Fri Feb 08 2013 Nick Clifton - 2.23.51.0.9-2 +- Enable 64-bit BFD for aarch64. (#908904) + +* Mon Feb 04 2013 Nick Clifton - 2.23.51.0.9-1 +- Rebase on 2.23.51.0.9 release. (#907089) +- Retire binutils-2.23.51.0.8-arm-whitespace.patch. + +* Mon Jan 21 2013 Nick Clifton - 2.23.51.0.8-4 +- Allow more whitespace in ARM instructions. (#892261) + +* Tue Jan 15 2013 Patsy Franklin - 2.23.51.0.8-3 +- Add bc to BuildRequires when running the testsuite. (#895321) + +* Wed Jan 02 2013 Nick Clifton - 2.23.51.0.8-2 +- Add runtime link with libdl. (#889134) + +* Wed Jan 02 2013 Nick Clifton - 2.23.51.0.8-1 +- Rebase on 2.23.51.0.8 release. (#890382) + +* Fri Dec 21 2012 Nick Clifton - 2.23.51.0.7-1 +- Rebase on 2.23.51.0.7 release. (#889432) + +* Tue Nov 27 2012 Nick Clifton - 2.23.51.0.6-1 +- Rebase on 2.23.51.0.6 release. (#880508) + +* Tue Nov 13 2012 Nick Clifton - 2.23.51.0.5-1 +- Rebase on 2.23.51.0.5 release. (#876141) +- Retire binutils-2.23.51.0.3-arm-ldralt.patch + +* Tue Oct 23 2012 Nick Clifton - 2.23.51.0.3-3 +- Rename ARM LDRALT instruction to LDALT. (#869025) PR/14575 + +* Mon Oct 15 2012 Jon Ciesla - 2.23.51.0.3-2 +- Provides: bundled(libiberty) + +* Tue Oct 02 2012 Nick Clifton - 2.23.51.0.3-1 +- Rebase on 2.23.51.0.3 release. (#858560) + +* Tue Sep 11 2012 Nick Clifton - 2.23.51.0.2-1 +- Rebase on 2.23.51.0.2 release. (#856119) +- Retire binutils-2.23.51.0.1-gold-keep.patch and binutils-rh805974.patch. + +* Tue Sep 4 2012 Jeff Law 2.23.51.0.1-4 +- Correctly handle PLTOFF relocs for s390 IFUNCs. + +* Tue Aug 14 2012 Karsten Hopp 2.23.51.0.1-3 +- apply F17 commit cd2fda5 to honour {powerpc64} macro (#834651) + +* Tue Aug 14 2012 Nick Clifton - 2.23.51.0.1-2 +- Make GOLD honour KEEP directives in linker scripts (#8333355) + +* Wed Aug 08 2012 Nick Clifton - 2.23.51.0.1-1 +- Rebase on 2.23.51.0.1 release. (#846433) +- Retire binutils-2.22.52.0.4-dwz.patch, binutils-2.22.52.0.4-ar-4Gb.patch, binutils-2.22.52.0.4-arm-plt-refcount.patch, binutils-2.22.52.0.4-s390-64bit-archive.patch. + +* Thu Aug 02 2012 Nick Clifton - 2.22.52.0.4-8 +- Make the binutils-devel package depend upon the binutils package. (#845082) + +* Thu Aug 02 2012 Nick Clifton - 2.22.52.0.4-7 +- Disable checks that config.h is included before system headers. (#845084) + +* Tue Jul 17 2012 Nick Clifton - 2.22.52.0.4-6 +- Use 64bit indicies in archives for s390 binaries. (#835957) + +* Thu Jul 05 2012 Nick Clifton - 2.22.52.0.4-5 +- Catch attempts to create a broken symbol index with archives > 4Gb in size. (#835957) + +* Fri Jun 29 2012 Nick Clifton - 2.22.52.0.4-4 +- Import fix for ld/14189. (#829311) + +* Fri Jun 29 2012 Nick Clifton - 2.22.52.0.4-3 +- Fix handling of archives > 4Gb in size by importing patch for PR binutils/14302. (#835957) + +* Tue Jun 19 2012 Jakub Jelinek - 2.22.52.0.4-2 +- Add minimal dwz -m support. + +* Wed Jun 06 2012 Nick Clifton - 2.22.52.0.4-1 +- Rebase on 2.22.52.0.4 release. (#829027) + +* Tue May 08 2012 Nick Clifton - 2.22.52.0.3-1 +- Rebase on 2.22.52.0.3 release. (#819823) + +* Mon Apr 30 2012 Nick Clifton - 2.22.52.0.2-1 +- Rebase on 2.22.52.0.2 release. (#816514) +- Retire binutils-2.22.52.0.1-weakdef.patch, binutils-2.22.52.0.1-ld-13621.patch, binutils-rh797752.patch, binutils-2.22.52.0.1-x86_64-hidden-ifunc.patch, binutils-2.22.52.0.1-tsx.patch and binutils-2.22.52.0.1-hidden-ifunc.patch. +- Update binutils-2.22.52.0.1-reloc-on-by-default.patch. + +* Fri Apr 27 2012 Nick Clifton - 2.22.52.0.1-12 +- Include demangle.h in the devel rpm. + +* Tue Apr 03 2012 Nick Clifton - 2.22.52.0.1-11 +- Enable -zrelro by default for RHEL 7+. (#807831) + +* Fri Mar 16 2012 Jakub Jelinek - 2.22.52.0.1-10 +- Fix up handling of hidden ifunc relocs on i?86 + +* Wed Mar 14 2012 Jeff Law - 2.22.52.0.1-9 +- Fix c++filt docs (2nd instance) (#797752) + +* 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 + +* Tue Mar 06 2012 Nick Clifton - 2.22.52.0.1-7 +- Enable -zrelro by default. (#621983 #807831) + +* Mon Feb 27 2012 Jeff Law - 2.22.52.0.1-6 +- Fix c++filt docs (#797752) + +* Wed Feb 15 2012 Mark Wielaard - 2.22.52.0.1-5 +- Add upstream ld/13621 'dangling global hidden symbol in symtab' patch. + +* Wed Feb 08 2012 Adam Williamson - 2.22.52.0.1-4 +- Actually apply the patch + +* Wed Feb 08 2012 Adam Williamson - 2.22.52.0.1-3 +- Add upstream weakdef.patch to fix RH #788107 + +* Wed Feb 01 2012 Nick Clifton - 2.22.52.0.1-2 +- Drat - forgot to upload the new tarball. Now done. + +* Wed Feb 01 2012 Nick Clifton - 2.22.52.0.1-1 +- Rebase on 2.22.52 release. +- Remove build-id.patch and gold-casts.patch as they are included in the 2.22.52 sources. + +* Fri Jan 13 2012 Nick Clifton - 2.22-4 +- Fix bug in GOLD sources parsing signed integers in command line options. + +* Fri Jan 13 2012 Nick Clifton - 2.22-3 +- Add casts for building gold with 4.7 version of gcc. + +* Thu Jan 12 2012 Fedora Release Engineering - 2.22-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Nov 22 2011 Nick Clifton - 2.22-1 +- Rebase on 2.22 release. + +* Fri Sep 30 2011 Ricky Zhou - 2.21.53.0.2-2 +- Rebuild libopcodes.a with -fPIC. + +* Tue Aug 09 2011 Nick Clifton - 2.21.53.0.2-1 +- Rebase on 2.21.53.0.2 tarball. Delete unneeded patches. (BZ 728677) + +* Tue Aug 02 2011 Nick Clifton - 2.21.53.0.1-3 +- Update libiberty demangling. (BZ 727453) + +* Wed Jul 27 2011 Nick Clifton - 2.21.53.0.1-2 +- Import Jakub Jelinek's patch to add support for displaying the contents of .debug_macro sections. + +* Tue Jul 19 2011 Nick Clifton - 2.21.53.0.1-1 +- Rebase on 2.21.53.0.1 tarball. Delete unneeded patches. (BZ 712668) + +* Fri Jun 24 2011 Nick Clifton - 2.21.52.0.1-5 +- Import fix for PR ld/12921. + +* Fri Jun 24 2011 Nick Clifton - 2.21.52.0.1-4 +- Run "alternatives --auto" to restore ld symbolic link if it was manually configured. (BZ 661247) + +* Thu Jun 16 2011 Nick Clifton - 2.21.52.0.1-3 +- Fix seg-fault attempting to find a function name without a symbol table. (BZ 713471) + +* Fri Jun 10 2011 Nick Clifton - 2.21.52.0.1-2 +- Import fix for PR ld/12851 (BZ 711268) + +* Thu Jun 09 2011 Nick Clifton - 2.21.52.0.1-1 +- Rebase on 2.21.52.0.1 tarball. (BZ 712025) + +* Tue May 17 2011 Nick Clifton - 2.21.51.0.9-1 +- Rebase on 2.21.51.0.9 tarball. (BZ 703105) + +* Mon May 2 2011 Peter Robinson - 2.21.51.0.8-3 +- Add ARM to BFD checks + +* Mon Apr 11 2011 Nick Clifton - 2.21.51.0.8-2 +- Delete plugins patch - enable plugins via configure option. + +* Mon Apr 11 2011 Nick Clifton - 2.21.51.0.8-1 +- Rebase on 2.21.51.0.8 tarball. + +* Thu Mar 17 2011 Nick Clifton - 2.21.51.0.7-1 +- Rebase on 2.21.51.0.7 tarball. + +* Tue Mar 08 2011 Nick Clifton - 2.21.51.0.6-2 +- Enable gold plugins. (BZ 682852) + +* Thu Feb 10 2011 Nick Clifton - 2.21.51.0.6-1 +- Rebase on 2.21.51.0.6 tarball. + +* Mon Feb 07 2011 Fedora Release Engineering - 2.21.51.0.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Jan 28 2011 Jakub Jelinek - 2.21.51.0.5-3 +- Readd --build-id fix patch. (PR ld/12451) + +* Thu Jan 6 2011 Dan Horák - 2.21.51.0.5-2 +- fix build on non-gold arches like s390(x) where both ld and ld.bfd is installed + +* Wed Jan 5 2011 Nick Clifton - 2.21.51.0.5-1 +- Rebase on 2.21.51.0.5 tarball. +- Delete redundant patches. +- Fix gold+ld configure command line option. + +* Fri Nov 5 2010 Dan Horák - 2.20.51.0.12-2 +- "no" is not valid option for --enable-gold + +* Thu Oct 28 2010 Nick Clifton - 2.20.51.0.12-1 +- Rebase on 2.20.51.0.12 tarball. (BZ 582160) + +* Fri Sep 10 2010 Nick Clifton - 2.20.51.0.11-1 +- Rebase on 2.20.51.0.11 tarball. (BZ 631771) + +* Fri Aug 20 2010 Nick Clifton - 2.20.51.0.10-3 +- Allow ^ and ! characters in linker script wildcard patterns. (BZ 621742) + +* Fri Aug 20 2010 Nick Clifton - 2.20.51.0.10-2 +- Fix seg fault in sec_merge_emit(). (BZ 623687) + +* Tue Aug 10 2010 Nick Clifton - 2.20.51.0.10-1 +- Rebase on 2.20.51.0.10 tarball. +- Import GOLD sources from binutils mainline as of 10 Aug 2010. + +* Wed Jun 30 2010 Nick Clifton - 2.20.51.0.7-5 +- Rename the binutils-static package to binutils-devel in line with the Fedora packaging guidelines. + +* Wed Jun 9 2010 Nick Clifton - 2.20.51.0.7-4 +- Allow GOLD linker to parse "-l" directives inside INPUT statements in linker scripts. (BZ 600553) + +* Tue May 4 2010 Nick Clifton - 2.20.51.0.7-3 +- Allow unique symbols in archive maps. + +* Tue Apr 20 2010 Nick Clifton - 2.20.51.0.7-2 +- Merge binutils-devel package into binutils-static package. (BZ 576300) + +* Thu Apr 8 2010 Nick Clifton - 2.20.51.0.7-1 +- Rebase on 2.20.51.0.7 tarball. +- Delete redundant patches: + binutils-2.20.51.0.2-add-needed.patch, + binutils-2.20.51.0.2-do-not-set-ifunc.patch, + binutils-2.20.51.0.2-enable-gold.patch, + binutils-2.20.51.0.2-gas-expr.patch, + binutils-2.20.51.0.2-ifunc-ld-s.patch, + binutils-2.20.51.0.2-lwp.patch, + binutils-2.20.51.0.2-ppc-hidden-plt-relocs.patch, + binutils-2.20.51.0.2-x86-hash-table.patch, +- Do not allow unique symbols to be bound locally. (PR ld/11434) +- Add support for DWARF4 debug information. + +* Thu Mar 4 2010 Nick Clifton - 2.20.51.0.2-17 +- Do not set ELFOSABI_LINUX on binaries which just link to IFUNC using DSOs. (BZ 568941) + +* Tue Mar 2 2010 Nick Clifton - 2.20.51.0.2-16 +- Copy the OSABI field in ELF headers, if set. (BZ 568921) + +* Fri Feb 12 2010 Nick Clifton - 2.20.51.0.2-15 +- Create separate static and devel sub-packages. (BZ 556040) + +* Tue Feb 2 2010 Nick Clifton - 2.20.51.0.2-14 +- Fix seg-fault when linking mixed x86 and x86_64 binaries. (BZ 487472) + +* Fri Jan 22 2010 Nick Clifton - 2.20.51.0.2-13 +- Add a requirement for the coreutils. (BZ 557006) + +* Wed Jan 20 2010 Nick Clifton - 2.20.51.0.2-12 +- Fix --no-copy-dt-needed so that it will not complain about weak references. + +* Fri Dec 18 2009 Nick Clifton - 2.20.51.0.2-11 +- Add missing part of PR 11088 patch. + +* Thu Dec 17 2009 Nick Clifton - 2.20.51.0.2-10 +- Apply patch for PR 11088. (BZ 544149) + +* Wed Dec 9 2009 Nick Clifton - 2.20.51.0.2-9 +- Apply patch for PR 10856. (BZ 544358) + +* Tue Dec 1 2009 Roland McGrath - 2.20.51.0.2-8 +- Build gold only for x86 flavors until others are tested. + +* Tue Nov 24 2009 Roland McGrath - 2.20.51.0.2-7 +- Add support for building gold. + +* Mon Nov 9 2009 Jakub Jelinek 2.20.51.0.2-5 +- Fix up --copy-dt-needed-entries default. (Nick Clifton) + +* Mon Nov 9 2009 Jakub Jelinek 2.20.51.0.2-4 +- Fix ld -s with IRELATIVE relocations. (BZ 533321, PR ld/10911) +- Add AMD Orochi LWP support, fix FMA4 support. + +* Thu Nov 05 2009 Nick CLifton 2.20.51.0.2-3 +- Rename --add-needed to --copy-dt-needed-entries and improve error message about unresolved symbols in DT_NEEDED DSOs. + +* Tue Oct 27 2009 Jan Kratochvil 2.20.51.0.2-2 +- Fix rpm --excludedocs (BZ 515922). +- Fix spurious scriplet errors by `exit 0'. (BZ 517979, Nick Clifton) + +* Mon Oct 12 2009 Nick Clifton 2.20.51.0.2-1 +- Rebase on 2.20 tarball. +- Remove redundant moxie patch. +- Remove redundant unique is global patch. +- Remove redundant cxxfilt java doc patch. + +* Tue Sep 29 2009 Jan Kratochvil 2.19.51.0.14-32 +- Remove spurious description of nonexistent --java switch for cxxfilt. + +* Thu Aug 6 2009 Jakub Jelinek 2.19.51.0.14-31 +- Fix strip on objects with STB_GNU_UNIQUE symbols. (BZ 515700, PR binutils/10492) + +* Fri Jul 24 2009 Fedora Release Engineering - 2.19.51.0.14-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Jul 22 2009 Nick Clifton 2.19.51.0.11-28 +- Rebase sources on 2.19.51.0.14 tarball. Gain fixes for PRs 10429 and 10433. + +* Wed Jul 22 2009 Nick Clifton 2.19.51.0.11-28 +- Rebase sources on 2.19.51.0.13 tarball. Remove redundant orphan section placement patch. (BZ 512937) + +* Tue Jul 14 2009 Nick Clifton 2.19.51.0.11-27 +- Add patch to allow moxie target to build, and hence --enable-targets=all to work. + +* Tue Jul 14 2009 Nick Clifton 2.19.51.0.11-26 +- Import orphan section placement patch from mainline. (BZ 510384) + +* Tue Jul 14 2009 Nick Clifton 2.19.51.0.11-25 +- Fix build-id patch to avoid memory corruption. (BZ 501582) + +* Sat Jul 11 2009 Jan Kratochvil 2.19.51.0.11-24 +- Provide uuencode output of the testsuite results. + +* Tue Jun 30 2009 Nick Clifton 2.19.51.0.11-23 +- Rebase sources on the 2.19.51.0.11 tarball. + +* Mon Jun 22 2009 Nick Clifton 2.19.51.0.10-22 +- Rebase sources on the 2.19.51.0.10 tarball. + +* Thu Jun 11 2009 Nick Clifton 2.19.51.0.2-21 +- Do not attempt to set execute permission on non-regular files. (BZ 503426) + +* Tue Jun 9 2009 Jakub Jelinek 2.19.51.0.2-20 +- Fix .cfi_* skip over >= 64KB of code. (PR gas/10255) + +* Wed May 27 2009 Nick Clifton 2.19.51.0.2-19 +- Import fix for binutils PR #9938. (BZ 500295) + +* Wed Apr 15 2009 Nick Clifton 2.19.51.0.2-18 +- Update IBM Power 7 support patch to fix tlbilx opcode. (BZ 494718) + +* Tue Mar 17 2009 Nick Clifton 2.19.51.0.2-17 +- Add glibc-static to BuildRequires when running the testsuite. + +* Thu Mar 05 2009 Nick Clifton 2.19.51.0.2-16 +- Add IBM Power7 support. (BZ 487887) + +* Mon Mar 02 2009 Nick Clifton 2.19.51.0.2-15 +- Add IFUNC support. (BZ 465302) + +* Mon Feb 23 2009 Fedora Release Engineering - 2.19.51.0.2-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 23 2009 Jan Kratochvil 2.19.50.0.2-13 +- Rediff the symbolic-envvar-revert patch to comply with rpm patch --fuzz=0. + +* Thu Feb 5 2009 Nick Clifton 2.19.51.0.2-12 +- Rebase sources on 2.19.51.0.2 tarball. Remove linkonce-r-discard and + gcc-expect-table patches. + +* Mon Feb 2 2009 Jan Kratochvil 2.19.50.0.1-11 +- Fix .eh_frame_hdr build also for .gcc_except_table LSDA refs (BZ 461675). + +* Fri Jan 23 2009 Nick Clifton 2.19.50.0.1-10 +- Only require dejagnu if the testsuites are going to be run. (BZ 481169) + +* Sat Nov 29 2008 Nick Clifton 2.19.50.0.1-8 +- Add build-id patch to ensure that section contents are incorporated + into a build id. (BZ 472152) + +* Fri Nov 21 2008 Nick Clifton 2.19.50.0.1 +- Rebase sources on 2.19.50.0.1 tarball. Update all patches, trimming + those that are no longer needed. + +* Thu Oct 30 2008 Jan Kratochvil 2.18.50.0.9-7 +- Fix %%{_prefix}/include/bfd.h on 32-bit hosts due the 64-bit BFD target + support from 2.18.50.0.8-2 (BZ 468495). + +* Thu Oct 30 2008 Jan Kratochvil 2.18.50.0.9-6 +- binutils-devel now requires zlib-devel (BZ 463101 comment 5). +- Fix complains on .gnu.linkonce.r relocations to their discarded + .gnu.linkonce.t counterparts. + +* Mon Sep 22 2008 Jan Kratochvil 2.18.50.0.9-5 +- Remove %%makeinstall to comply with the spu-binutils review (BZ 452211). + +* Mon Sep 22 2008 Jan Kratochvil 2.18.50.0.9-4 +- Fix *.so scripts for multilib linking (BZ 463101, suggested by Jakub Jelinek). + +* Sun Sep 21 2008 Jan Kratochvil 2.18.50.0.9-3 +- Provide libbfd.so and libopcodes.so for automatic dependencies (BZ 463101). +- Fix .eh_frame_hdr build on C++ files with discarded common groups (BZ 458950). +- Provide --build and --host to fix `rpmbuild --target' biarch builds. +- Include %%{binutils_target}- filename prefix for binaries for cross builds. +- Fix multilib conflict on %%{_prefix}/include/bfd.h's BFD_HOST_64BIT_LONG_LONG. + +* Mon Sep 15 2008 Jan Kratochvil 2.18.50.0.9-2 +- Package review, analysed by Jon Ciesla and Patrice Dumas (BZ 225615). + - build back in the sourcedir without problems as gasp is no longer included. + - Fix the install-info requirement. + - Drop the needless gzipping of the info files. + - Provide Obsoletes versions. + - Use the %%configure macro. + +* Sat Aug 30 2008 Jan Kratochvil 2.18.50.0.9-1 +- Update to 2.18.50.0.9. + - Drop the ppc-only spu target pre-build stage (BZ 455242). + - Drop parsing elf64-i386 files for kdump PAE vmcore dumps (BZ 457189). +- New .spec BuildRequires zlib-devel (/-static) for compressed sections. +- Update .spec Buildroot to be more unique. + +* Fri Aug 1 2008 Jan Kratochvil 2.18.50.0.8-2 +- Fix parsing elf64-i386 files for kdump PAE vmcore dumps (BZ 457189). +- Turn on 64-bit BFD support for i386, globally enable AC_SYS_LARGEFILE. +- `--with debug' builds now with --disable-shared. +- Removed a forgotten unused ld/eelf32_spu.c workaround from 2.18.50.0.8-1. + +* Thu Jul 31 2008 Jan Kratochvil 2.18.50.0.8-1 +- Update to 2.18.50.0.8. + - Drop the .clmul -> .pclmul renaming backport. +- Add %%{binutils_target} macro to support building cross-binutils. + (David Woodhouse) +- Support `--without testsuite' to suppress the testsuite run. +- Support `--with debug' to build without optimizations. +- Refresh the patchset with fuzz 0 (for new rpmbuild). +- Enable the spu target on ppc/ppc64 (BZ 455242). + +* Wed Jul 16 2008 Jan Kratochvil 2.18.50.0.6-4 +- include the `dist' tag in the Release number +- libbfd.a symbols visibility is now hidden (for #447426, suggested by Jakub) + +* Wed Jul 16 2008 Jan Kratochvil 2.18.50.0.6-3 +- rebuild libbfd.a with -fPIC for inclusion into shared libraries (#447426) + +* Tue Apr 8 2008 Jakub Jelinek 2.18.50.0.6-2 +- backport .clmul -> .pclmul renaming + +* Fri Apr 4 2008 Jakub Jelinek 2.18.50.0.6-1 +- update to 2.18.50.0.6 + - Intel AES, CLMUL, AVX/FMA support + +* Mon Mar 3 2008 Jakub Jelinek 2.18.50.0.4-2 +- revert aranges optimization (Alan Modra, BZ#5303, BZ#5755) +- fix ld-shared testcase for GCC 4.3 (H.J. Lu) + +* Fri Feb 29 2008 Jakub Jelinek 2.18.50.0.4-1 +- update to 2.18.50.0.4 + +* Tue Feb 19 2008 Fedora Release Engineering 2.18.50.0.3-2 +- Autorebuild for GCC 4.3 + +* Wed Dec 12 2007 Jakub Jelinek 2.18.50.0.3-1 +- update to 2.18.50.0.3 + - fix build with recent makeinfo (#415271) + +* Thu Aug 16 2007 Jakub Jelinek 2.17.50.0.18-1 +- update to 2.17.50.0.18 + - GPLv3+ + - preserve .note.gnu.build-id in objcopy --only-keep-debug (#251935) + - fix sparc64/alpha broken by --build-id patch (#252936) +- update License tag +- fix ld crash with --build-id and non-ELF output format (Alan Modra, BZ#4923) + +* Tue Jul 31 2007 Jakub Jelinek 2.17.50.0.17-7 +- fix ppc32 secure PLT detection (Alan Modra) + +* Wed Jul 25 2007 Jakub Jelinek 2.17.50.0.17-6 +- rebuilt to make sure even libbfd.so and libopcodes.so aren't + broken by #249435 + +* Tue Jul 24 2007 Jakub Jelinek 2.17.50.0.17-5 +- add .note.gnu.build-id into default linker script (#249435) + +* Tue Jul 24 2007 Jakub Jelinek 2.17.50.0.17-4 +- don't kill the %%{_gnu} part of target name on arm + (Lennert Buytenhek, #243516) +- create just one PT_NOTE segment header for all consecutive SHT_NOTE + sections + +* Wed Jul 18 2007 Roland McGrath 2.17.50.0.17-3 +- fix for ld --build-id + +* Sun Jul 15 2007 Roland McGrath 2.17.50.0.17-2 +- ld --build-id support + +* Wed Jun 27 2007 Jakub Jelinek 2.17.50.0.17-1 +- update to 2.17.50.0.17 + +* Tue Jun 12 2007 Jakub Jelinek 2.17.50.0.16-1 +- update to 2.17.50.0.16 + +* Sat Apr 14 2007 Jakub Jelinek 2.17.50.0.12-4 +- fix linking non-ELF input objects into ELF output (#235747) + +* Wed Mar 14 2007 Jakub Jelinek 2.17.50.0.12-3 +- don't require matching ELF_OSABI for target vecs with ELFOSABI_NONE, + only prefer specific osabi target vecs over the generic ones + (H.J.Lu, #230964, BZ#3826) +- build libbfd.so and libopcodes.so with -Bsymbolic-functions + +* Fri Mar 2 2007 Jakub Jelinek 2.17.50.0.12-2 +- ignore install-info errors from scriptlets (#223678) + +* Thu Mar 1 2007 Jakub Jelinek 2.17.50.0.12-1 +- update to 2.17.50.0.12 +- revert the misdesigned LD_SYMBOLIC{,_FUNCTIONS} env var support, + only support -Bsymbolic/-Bsymbolic-functions/--dynamic-list* + +* Mon Jan 8 2007 Jakub Jelinek 2.17.50.0.9-1 +- update to 2.17.50.0.9 +- fix tekhex reader + +* Sat Dec 23 2006 Jakub Jelinek 2.17.50.0.8-2 +- fix --as-needed on ppc64 (#219629) + +* Sun Dec 3 2006 Jakub Jelinek 2.17.50.0.8-1 +- update to 2.17.50.0.8 +- initialize frch_cfi_data (BZ#3607) + +* Fri Dec 1 2006 Jakub Jelinek 2.17.50.0.7-1 +- update to 2.17.50.0.7 + - .cfi_personality and .cfi_lsda directives, per subsection .cfi_* + directives, better .eh_frame CIE merging + +* Thu Nov 9 2006 Jakub Jelinek 2.17.50.0.6-3 +- fix popcnt instruction assembly and disassembly on amd64 (#214767) + +* Mon Oct 23 2006 Jakub Jelinek 2.17.50.0.6-2 +- update to 2.17.50.0.6 + - fix for section relative linker script defined symbols in + empty sections (#207598, BZ#3267) + - fix handling of DW_CFA_set_loc in .eh_frame optimizations + - fix R_PPC_{PLT,GOT{,_TLSGD,_TLSLD,_TPREL,_DTPREL}}16_HA relocation + handling with weak undefined symbols (Alan Modra, #211094) + +* Tue Sep 12 2006 Jakub Jelinek 2.17.50.0.3-6 +- fix multilib conflict in %%{_prefix}/include/bfd.h + +* Tue Sep 12 2006 Jakub Jelinek 2.17.50.0.3-5 +- fix efi-app-ia64 magic number (#206002, BZ#3171) + +* Tue Sep 5 2006 Jakub Jelinek 2.17.50.0.3-4 +- link libopcodes*.so against libbfd*.so (#202327) +- split *.a and header files into binutils-devel + +* Fri Aug 18 2006 Jakub Jelinek 2.17.50.0.3-3 +- on ppc and ppc64 increase default -z commonpagesize to 64K (#203001) + +* Fri Jul 28 2006 Alexandre Oliva 2.17.50.0.3-2 +- do not infer x86 arch implicitly based on instruction in the input + (#200330) + +* Mon Jul 17 2006 Jakub Jelinek 2.17.50.0.3-1 +- update to 2.17.50.0.3 + +* Fri Jul 14 2006 Jakub Jelinek 2.17.50.0.2-8 +- add support for new AMDFAM10 instructions (#198281, IT#97662) +- add -march=/-mtune= gas support on x86/x86-64 +- x86/x86-64 nop insn improvements +- fix DT_GNU_HASH shift count value computation + +* Tue Jul 11 2006 Jakub Jelinek 2.17.50.0.2-7 +- add DT_GNU_HASH support (--hash-style=gnu and --hash-style=both + ld options) + +* Thu Jun 29 2006 Jakub Jelinek 2.17.50.0.2-4 +- fix i?86 TLS GD->IE transition in executables (#196157, BZ#2513) + +* Mon Jun 19 2006 Jakub Jelinek 2.17.50.0.2-3 +- fix two places in ld that misbehaved with MALLOC_PERTURB_=N +- fix .tls_common handling in relocatable linking + +* Mon Jun 5 2006 Jakub Jelinek 2.17.50.0.2-2 +- fix --as-needed (Alan Modra, #193689, BZ#2721) + +* Thu Jun 1 2006 Jakub Jelinek 2.17.50.0.2-1 +- update to 2.17.50.0.2 +- update from CVS to 20060601 +- speed up the ELF linker by caching the result of kept section check + (H.J. Lu) + +* Tue May 9 2006 Jakub Jelinek 2.17.50.0.1-1 +- update to 2.17.50.0.1 + +* Fri Mar 31 2006 Jakub Jelinek 2.16.91.0.6-6 +- fix ld error message formatting, so that collect2 parser can + parse it again for g++ -frepo (#187142) + +* Thu Mar 9 2006 Alexandre Oliva 2.16.91.0.6-4 +- fix relaxation of TLS GD to LE on PPC (#184590) + +* Fri Mar 3 2006 Jakub Jelinek 2.16.91.0.6-3 +- support DW_CFA_val_{offset,offset_sf,expression} in readelf/objdump + +* Tue Feb 28 2006 Jakub Jelinek 2.16.91.0.6-2 +- add MNI support on i?86/x86_64 (#183080) +- support S signal frame augmentation flag in .eh_frame, + add .cfi_signal_frame support (#175951, PR other/26208, BZ#300) + +* Tue Feb 14 2006 Jakub Jelinek 2.16.91.0.6-1 +- update to 2.16.91.0.6 + - fix ppc64 --gc-sections + - disassembler fixes for x86_64 cr/debug regs + - fix linker search order for DT_NEEDED libs + +* Mon Jan 02 2006 Jakub Jelinek 2.16.91.0.5-1 +- update to 2.16.91.0.5 +- don't error about .toc1 references to discarded sectiosn on ppc64 + (#175944) + +* Wed Dec 14 2005 Jakub Jelinek 2.16.91.0.3-2 +- put .gnu.linkonce.d.rel.ro.* sections into relro region + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Fri Nov 11 2005 Jakub Jelinek 2.16.91.0.3-1 +- update to 2.16.91.0.3 +- add .weakref support (Alexandre Oliva, #115157, #165728) + +* Thu Aug 18 2005 Jakub Jelinek 2.16.91.0.2-4 +- install-info also configure.info +- update standards.texi from gnulib (#165530) + +* Tue Aug 16 2005 Jakub Jelinek 2.16.91.0.2-3 +- update to 20050816 CVS +- better fix for ld-cdtest +- fix symbol version script parsing + +* Fri Jul 29 2005 Jakub Jelinek 2.16.91.0.2-2 +- don't complain about relocs to discarded sections in ppc32 + .got2 sections (Alan Modra, PR target/17828) + +* Fri Jul 22 2005 Jakub Jelinek 2.16.91.0.2-1 +- update to 2.16.91.0.2 + +* Thu Jul 21 2005 Jakub Jelinek 2.16.91.0.1-3 +- fix buffer overflow in readelf ia64 unwind printing code +- use vsnprintf rather than vsprintf in gas diagnostics (Tavis Ormandy) +- fix ld-cdtest when CFLAGS contains -fexceptions + +* Wed Jul 20 2005 Jakub Jelinek 2.16.91.0.1-2 +- update to 20050720 CVS + +* Mon Jul 11 2005 Jakub Jelinek 2.16.91.0.1-1 +- update to 2.16.91.0.1 plus 20050708 CVS + +* Wed Jun 15 2005 Jakub Jelinek 2.16.90.0.3-1 +- update to 2.16.90.0.3 +- update to 20050615 CVS + - ppc32 secure PLT support (Alan Modra) +- further bfd/readelf robustification + +* Sat Jun 11 2005 Jakub Jelinek 2.15.94.0.2.2-4 +- further bfd robustification (CAN-2005-1704, #158680) + +* Fri Jun 10 2005 Jakub Jelinek 2.15.94.0.2.2-3 +- further objdump and readelf robustification (CAN-2005-1704, #158680) + +* Wed May 25 2005 Jakub Jelinek 2.15.94.0.2.2-2 +- bfd and readelf robustification (CAN-2005-1704, #158680) + +* Tue Mar 29 2005 Jakub Jelinek 2.15.94.0.2.2-1 +- update to 2.15.94.0.2.2 +- speed up walk_wild_section (Robert O'Callahan) + +* Mon Mar 7 2005 Jakub Jelinek 2.15.94.0.2-4 +- rebuilt with GCC 4 + +* Mon Feb 28 2005 Jakub Jelinek 2.15.94.0.2-3 +- fix buffer overflows in readelf (#149506) +- move c++filt to binutils from gcc-c++, conflict with gcc-c++ < 4.0 (#86333) + +* Thu Feb 10 2005 Jakub Jelinek 2.15.94.0.2-1 +- update to 2.15.94.0.2 +- fix .note.GNU-stack/PT_GNU_STACK computation in linker on ppc64 (#147296) +- fix stripping of binaries/libraries that have empty sections right before + .dynamic section (with the same starting address; #144038) +- handle AS_NEEDED (...) in linker script INPUT/GROUP + +* Tue Dec 14 2004 Jakub Jelinek 2.15.92.0.2-11 +- fix a longstanding -z relro bug + +* Mon Dec 13 2004 Jakub Jelinek 2.15.92.0.2-10 +- avoid unnecessary gap with -z relro showing on i686 libc.so +- ppc64 --emit-relocs fix (Alan Modra) +- don't crash if STT_SECTION symbol has incorrect st_shndx (e.g. SHN_ABS, + as created by nasm; #142181) +- don't try to make absptr LSDAs relative if they don't have relocations + against them (Alan Modra, #141162) + +* Wed Oct 27 2004 Jakub Jelinek 2.15.92.0.2-5.EL4 +- fix ar xo (#104344) + +* Wed Oct 20 2004 Jakub Jelinek 2.15.92.0.2-5 +- fix --just-symbols on ppc64 (Alan Modra, #135498) + +* Fri Oct 15 2004 Jakub Jelinek 2.15.92.0.2-4 +- fix code detecting matching linkonce and single member comdat + group sections (#133078) + +* Mon Oct 11 2004 Jakub Jelinek 2.15.92.0.2-3 +- revert Sep 09 change to make ppc L second argument e.g. for tlbie + non-optional +- fix stripping of prelinked binaries and libraries (#133734) +- allow strings(1) on 32-bit arches to be used again with > 2GB + files (#133555) + +* Mon Oct 4 2004 Jakub Jelinek 2.15.92.0.2-2 +- update to 2.15.92.0.2 +- change ld's ld.so.conf parser to match ldconfig's (#129340) + +* Mon Sep 20 2004 Jakub Jelinek 2.15.91.0.2-9 +- avoid almost 1MB (sparse) gaps in the middle of -z relro + libraries on x86-64 (Andreas Schwab) +- fix -z relro to make sure end of PT_GNU_RELRO segment is always + COMMONPAGESIZE aligned + +* Wed Aug 18 2004 Jakub Jelinek 2.15.91.0.2-8 +- fix linker segfaults on input objects with SHF_LINK_ORDER with + incorrect sh_link (H.J.Lu, Nick Clifton, #130198, BZ #290) + +* Wed Aug 18 2004 Jakub Jelinek 2.15.91.0.2-7 +- resolve all undefined ppc64 .* syms to the function bodies through + .opd, not just those used in brach instructions (Alan Modra) + +* Tue Aug 17 2004 Jakub Jelinek 2.15.91.0.2-6 +- fix ppc64 ld --dotsyms (Alan Modra) + +* Tue Aug 17 2004 Jakub Jelinek 2.15.91.0.2-5 +- various ppc64 make check fixes when using non-dot-syms gcc (Alan Modra) +- fix --gc-sections +- on ia64 create empty .gnu.linkonce.ia64unw*.* sections for + .gnu.linkonce.t.* function doesn't need unwind info + +* Mon Aug 16 2004 Jakub Jelinek 2.15.91.0.2-4 +- kill ppc64 dot symbols (Alan Modra) +- objdump -d support for objects without dot symbols +- support for overlapping ppc64 .opd entries + +* Mon Aug 9 2004 Jakub Jelinek 2.15.91.0.2-3 +- fix a newly introduced linker crash on x86-64 + +* Sun Aug 8 2004 Alan Cox 2.15.91.0.2-2 +- BuildRequire bison and macroise buildroot - from Steve Grubb + +* Fri Jul 30 2004 Jakub Jelinek 2.15.91.0.2-1 +- update to 2.15.91.0.2 +- BuildRequire flex (#117763) + +* Wed May 19 2004 Jakub Jelinek 2.15.90.0.3-7 +- use lib64 instead of lib directories on ia64 if %%{_lib} is + set to lib64 by rpm + +* Sat May 15 2004 Jakub Jelinek 2.15.90.0.3-6 +- fix a bug introduced in the ++/-- rejection patch + from 2.15.90.0.3 (Alan Modra) + +* Tue May 4 2004 Jakub Jelinek 2.15.90.0.3-5 +- fix s390{,x} .{,b,p2}align handling +- ppc/ppc64 testsuite fix + +* Mon May 3 2004 Jakub Jelinek 2.15.90.0.3-4 +- -z relro ppc/ppc64/ia64 fixes +- change x86-64 .plt symbol st_size handling to match ia32 +- prettify objdump -d output + +* Tue Apr 20 2004 Jakub Jelinek 2.15.90.0.3-3 +- several SPARC fixes + +* Sun Apr 18 2004 Jakub Jelinek 2.15.90.0.3-2 +- yet another fix for .tbss handling + +* Fri Apr 16 2004 Jakub Jelinek 2.15.90.0.3-1 +- update to 2.15.90.0.3 + +* Fri Mar 26 2004 Jakub Jelinek 2.15.90.0.1.1-2 +- update to 20040326 CVS + - fix ppc64 weak .opd symbol handling (Alan Modra, #119086) +- fix .tbss handling bug introduced + +* Fri Mar 26 2004 Jakub Jelinek 2.15.90.0.1.1-1 +- update to 2.15.90.0.1.1 + +* Sat Feb 21 2004 Jakub Jelinek 2.14.90.0.8-8 +- with -z now without --enable-new-dtags create DT_BIND_NOW + dynamic entry in addition to DT_FLAGS_1 with DF_1_NOW bit set + +* Fri Feb 20 2004 Jakub Jelinek 2.14.90.0.8-7 +- fix -pie on ppc32 + +* Fri Feb 20 2004 Jakub Jelinek 2.14.90.0.8-6 +- clear .plt sh_entsize on sparc32 +- put whole .got into relro area with -z now -z relro + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Thu Jan 22 2004 Jakub Jelinek 2.14.90.0.8-4 +- fix -pie on IA64 + +* Mon Jan 19 2004 Jakub Jelinek 2.14.90.0.8-3 +- fix testcases on s390 and s390x + +* Fri Jan 16 2004 Jakub Jelinek 2.14.90.0.8-2 +- fix testcases on AMD64 +- fix .got's sh_entsize on IA32/AMD64 +- set COMMONPAGESIZE on s390/s390x +- set COMMONPAGESIZE on ppc32 (Alan Modra) + +* Fri Jan 16 2004 Jakub Jelinek 2.14.90.0.8-1 +- update to 2.14.90.0.8 + +* Tue Jan 13 2004 Jakub Jelinek 2.14.90.0.7-4 +- fix -z relro on 64-bit arches + +* Mon Jan 12 2004 Jakub Jelinek 2.14.90.0.7-3 +- fix some bugs in -z relro support + +* Fri Jan 9 2004 Jakub Jelinek 2.14.90.0.7-2 +- -z relro support, reordering of RW sections + +* Fri Jan 9 2004 Jakub Jelinek 2.14.90.0.7-1 +- update to 2.14.90.0.7 + +* Mon Nov 24 2003 Jakub Jelinek 2.14.90.0.6-4 +- fix assembly parsing of foo=(.-bar)/4 (Alan Modra) +- fix IA-64 assembly parsing of (p7) hint @pause + +* Tue Sep 30 2003 Jakub Jelinek 2.14.90.0.6-3 +- don't abort on some linker warnings/errors on IA-64 + +* Sat Sep 20 2003 Jakub Jelinek 2.14.90.0.6-2 +- fix up merge2.s to use .p2align instead of .align + +* Sat Sep 20 2003 Jakub Jelinek 2.14.90.0.6-1 +- update to 2.14.90.0.6 +- speed up string merging (Lars Knoll, Michael Matz, Alan Modra) +- speed up IA-64 local symbol handling during linking + +* Fri Sep 5 2003 Jakub Jelinek 2.14.90.0.5-7 +- avoid ld -s segfaults introduced in 2.14.90.0.5-5 (Dmitry V. Levin, + #103180) + +* Fri Aug 29 2003 Jakub Jelinek 2.14.90.0.5-6 +- build old demangler into libiberty.a (#102268) +- SPARC .cfi* support + +* Tue Aug 5 2003 Jakub Jelinek 2.14.90.0.5-5 +- fix orphan section placement + +* Tue Jul 29 2003 Jakub Jelinek 2.14.90.0.5-4 +- fix ppc64 elfvsb linker tests +- some more 64-bit cleanliness fixes, give ppc64 fdesc symbols + type and size (Alan Modra) + +* Tue Jul 29 2003 Jakub Jelinek 2.14.90.0.5-3 +- fix 64-bit unclean code in ppc-opc.c + +* Mon Jul 28 2003 Jakub Jelinek 2.14.90.0.5-2 +- fix 64-bit unclean code in tc-ppc.c + +* Mon Jul 28 2003 Jakub Jelinek 2.14.90.0.5-1 +- update to 2.14.90.0.5 +- fix ld -r on ppc64 (Alan Modra) + +* Fri Jul 18 2003 Jakub Jelinek 2.14.90.0.4-23 +- rebuilt + +* Thu Jul 17 2003 Jakub Jelinek 2.14.90.0.4-22 +- fix elfNN_ia64_dynamic_symbol_p (Richard Henderson, #86661) +- don't access memory beyond what was allocated in readelf + (Richard Henderson) + +* Thu Jul 10 2003 Jakub Jelinek 2.14.90.0.4-21 +- add .cfi_* support on ppc{,64} and s390{,x} + +* Tue Jul 8 2003 Jakub Jelinek 2.14.90.0.4-20 +- remove lib{bfd,opcodes}.la (#98190) + +* Mon Jul 7 2003 Jakub Jelinek 2.14.90.0.4-19 +- fix -pie support on amd64, s390, s390x and ppc64 +- issue relocation overflow errors for s390/s390x -fpic code when + accessing .got slots above 4096 bytes from .got start + +* Thu Jul 3 2003 Jakub Jelinek 2.14.90.0.4-18 +- rebuilt + +* Thu Jul 3 2003 Jakub Jelinek 2.14.90.0.4-17 +- fix ia64 -pie support +- require no undefined non-weak symbols in PIEs like required for normal + binaries + +* Wed Jul 2 2003 Jakub Jelinek 2.14.90.0.4-16 +- fix readelf -d on IA-64 +- build libiberty.a with -fPIC, so that it can be lined into shared + libraries + +* Wed Jun 25 2003 Jakub Jelinek 2.14.90.0.4-15 +- rebuilt + +* Wed Jun 25 2003 Jakub Jelinek 2.14.90.0.4-14 +- added support for Intel Prescott instructions +- fix hint@pause for ia64 +- add workaround for LTP sillyness (#97934) + +* Wed Jun 18 2003 Jakub Jelinek 2.14.90.0.4-13 +- update CFI stuff to 2003-06-18 +- make sure .eh_frame is aligned to 8 bytes on 64-bit arches, + remove padding within one .eh_frame section + +* Tue Jun 17 2003 Jakub Jelinek 2.14.90.0.4-12 +- rebuilt + +* Tue Jun 17 2003 Jakub Jelinek 2.14.90.0.4-11 +- one more fix for the same patch + +* Tue Jun 17 2003 Jakub Jelinek 2.14.90.0.4-10 +- fix previous patch + +* Mon Jun 16 2003 Jakub Jelinek 2.14.90.0.4-9 +- ensure R_PPC64_{RELATIVE,ADDR64} have *r_offset == r_addend + and the other relocs have *r_offset == 0 + +* Tue Jun 10 2003 Jakub Jelinek 2.14.90.0.4-8 +- remove some unnecessary provides in ppc64 linker script + which were causing e.g. empty .ctors/.dtors section creation + +* Fri Jun 6 2003 Jakub Jelinek 2.14.90.0.4-7 +- some CFI updates/fixes +- don't create dynamic relocations against symbols defined in PIE + exported from its .dynsym + +* Wed Jun 4 2003 Jakub Jelinek 2.14.90.0.4-6 +- update gas to 20030604 +- PT_GNU_STACK support + +* Mon Jun 2 2003 Jakub Jelinek 2.14.90.0.4-5 +- buildrequire gettext (#91838) + +* Sat May 31 2003 Jakub Jelinek 2.14.90.0.4-4 +- fix shared libraries with >= 8192 .plt slots on ppc32 + +* Thu May 29 2003 Jakub Jelinek 2.14.90.0.4-3 +- rebuilt + +* Thu May 29 2003 Jakub Jelinek 2.14.90.0.4-2 +- rename ld --dynamic option to --pic-executable or --pie +- fix ld --help output +- document --pie/--pic-executable in ld.info and ld.1 + +* Wed May 28 2003 Jakub Jelinek 2.14.90.0.4-1 +- update to 2.14.90.0.4-1 +- gas CFI updates (Richard Henderson) +- dynamic executables (Ulrich Drepper) + +* Tue May 20 2003 Jakub Jelinek 2.14.90.0.2-2 +- fix ELF visibility handling +- tidy plt entries on IA-32, ppc and ppc64 + +* Mon May 19 2003 Jakub Jelinek 2.14.90.0.2-1 +- update to 2.14.90.0.2-1 + +* Tue May 13 2003 Jakub Jelinek 2.13.90.0.20-8 +- fix bfd_elf_hash on 64-bit arches (Andrew Haley) + +* Wed Apr 30 2003 Jakub Jelinek 2.13.90.0.20-7 +- rebuilt + +* Mon Apr 14 2003 Jakub Jelinek 2.13.90.0.20-6 +- optimize DW_CFA_advance_loc4 in gas even if there is 'z' augmentation + with size 0 in FDE + +* Fri Apr 11 2003 Jakub Jelinek 2.13.90.0.20-5 +- fix SPARC build + +* Thu Apr 3 2003 Jakub Jelinek 2.13.90.0.20-4 +- fix ppc32 plt reference counting +- don't include %%{_prefix}/%%{_lib}/debug in the non-debuginfo package + (#87729) + +* Mon Mar 31 2003 Jakub Jelinek 2.13.90.0.20-3 +- make elf64ppc target native extra on ppc and elf32ppc native extra + on ppc64. + +* Fri Mar 28 2003 Jakub Jelinek 2.13.90.0.20-2 +- fix TLS on IA-64 with ld relaxation + +* Sat Mar 22 2003 Jakub Jelinek 2.13.90.0.20-1 +- update to 2.13.90.0.20 + +* Mon Feb 24 2003 Jakub Jelinek 2.13.90.0.18-9 +- rebuilt + +* Mon Feb 24 2003 Jakub Jelinek 2.13.90.0.18-8 +- don't strip binaries in %%install, so that there is non-empty + debuginfo + +* Mon Feb 24 2003 Jakub Jelinek 2.13.90.0.18-7 +- don't optimize .eh_frame during ld -r + +* Thu Feb 13 2003 Jakub Jelinek 2.13.90.0.18-6 +- don't clear elf_link_hash_flags in the .symver patch +- only use TC_FORCE_RELOCATION in s390's TC_FORCE_RELOCATION_SUB_SAME + (Alan Modra) + +* Mon Feb 10 2003 Jakub Jelinek 2.13.90.0.18-5 +- fix the previous .symver change +- remove libbfd.so and libopcodes.so symlinks, so that other packages + link statically, not dynamically against libbfd and libopcodes + whose ABI is everything but stable + +* Mon Feb 10 2003 Jakub Jelinek 2.13.90.0.18-4 +- do .symver x, x@FOO handling earlier +- support .file and .loc on s390* + +* Mon Feb 10 2003 Jakub Jelinek 2.13.90.0.18-3 +- handle .symver x, x@FOO in ld such that relocs against x become + dynamic relocations against x@FOO (#83325) +- two PPC64 TLS patches (Alan Modra) + +* Sun Feb 09 2003 Jakub Jelinek 2.13.90.0.18-2 +- fix SEARCH_DIR on x86_64/s390x +- fix Alpha --relax +- create DT_RELA{,SZ,ENT} on s390 even if there is just .rela.plt + and no .rela.dyn section +- support IA-32 on IA-64 (#83752) +- .eh_frame_hdr fix (Andreas Schwab) + +* Thu Feb 06 2003 Jakub Jelinek 2.13.90.0.18-1 +- update to 2.13.90.0.18 + 20030121->20030206 CVS diff + +* Tue Feb 04 2003 Jakub Jelinek 2.13.90.0.16-8 +- alpha TLS fixes +- use .debug_line directory table to make the section tiny bit smaller +- libtool fix from Jens Petersen + +* Sun Feb 02 2003 Jakub Jelinek 2.13.90.0.16-7 +- sparc32 TLS + +* Fri Jan 24 2003 Jakub Jelinek 2.13.90.0.16-6 +- s390{,x} TLS and two other mainframe patches + +* Fri Jan 17 2003 Jakub Jelinek 2.13.90.0.16-5 +- fix IA-64 TLS IE in shared libs +- .{preinit,init,fini}_array compat hack from Alexandre Oliva + +* Thu Jan 16 2003 Jakub Jelinek 2.13.90.0.16-4 +- IA-64 TLS fixes +- fix .plt sh_entsize on Alpha +- build with %%_smp_mflags + +* Sat Nov 30 2002 Jakub Jelinek 2.13.90.0.16-3 +- fix strip on TLS binaries and libraries + +* Fri Nov 29 2002 Jakub Jelinek 2.13.90.0.16-2 +- fix IA-64 ld bootstrap + +* Thu Nov 28 2002 Jakub Jelinek 2.13.90.0.16-1 +- update to 2.13.90.0.16 +- STT_TLS SHN_UNDEF fix + +* Wed Nov 27 2002 Jakub Jelinek 2.13.90.0.10-4 +- pad .rodata.cstNN sections at the end if they aren't sized to multiple + of sh_entsize +- temporary patch to make .eh_frame and .gcc_except_table sections + readonly if possible (should be removed when AUTO_PLACE is implemented) +- fix .PPC.EMB.apuinfo section flags + +* Wed Oct 23 2002 Jakub Jelinek 2.13.90.0.10-3 +- fix names and content of alpha non-alloced .rela.* sections (#76583) +- delete unpackaged files from the buildroot + +* Tue Oct 15 2002 Jakub Jelinek 2.13.90.0.10-2 +- enable s390x resp. s390 emulation in linker too + +* Mon Oct 14 2002 Jakub Jelinek 2.13.90.0.10-1 +- update to 2.13.90.0.10 +- add a bi-arch patch for sparc/s390/x86_64 +- add --enable-64-bit-bfd on sparc, s390 and ppc + +* Thu Oct 10 2002 Jakub Jelinek 2.13.90.0.4-3 +- fix combreloc testcase + +* Thu Oct 10 2002 Jakub Jelinek 2.13.90.0.4-2 +- fix orphan .rel and .rela section placement with -z combreloc (Alan Modra) +- skip incompatible linker scripts when searching for libraries + +* Tue Oct 1 2002 Jakub Jelinek 2.13.90.0.4-1 +- update to 2.13.90.0.4 +- x86-64 TLS support +- some IA-32 TLS fixes +- some backported patches from trunk +- include opcodes, ld, gas and bfd l10n too + +* Thu Sep 19 2002 Jakub Jelinek 2.13.90.0.2-3 +- allow addends for IA-32 TLS @tpoff, @ntpoff and @dtpoff +- clear memory at *r_offset of dynamic relocs on PPC +- avoid ld crash if accessing non-local symbols through LE relocs +- new IA-32 TLS relocs, bugfixes and testcases +- use brl insn on IA-64 (Richard Henderson) +- fix R_IA64_PCREL21{M,F} handling (Richard Henderson) +- build in separate builddir, so that gasp tests don't fail +- include localization + +* Thu Aug 8 2002 Jakub Jelinek 2.13.90.0.2-2 +- fix R_386_TPOFF32 addends (#70824) + +* Sat Aug 3 2002 Jakub Jelinek 2.13.90.0.2-1 +- update to 2.13.90.0.2 + - fix ld TLS assertion failure (#70084) + - fix readelf --debug-dump= handling to match man page and --help + (#68997) +- fix _GLOBAL_OFFSET_TABLE gas handling (#70241) + +* Wed Jul 24 2002 Jakub Jelinek 2.12.90.0.15-1 +- update to 2.12.90.0.15 +- TLS .tbss fix +- don't use rpm %%configure macro, it is broken too often (#69366) + +* Thu May 30 2002 Jakub Jelinek 2.12.90.0.9-1 +- update to 2.12.90.0.9 + - TLS support +- remove gasp.info from %%post/%%preun (#65400) + +* Mon Apr 29 2002 Jakub Jelinek 2.12.90.0.7-1 +- update to 2.12.90.0.7 +- run make check + +* Mon Apr 29 2002 Jakub Jelinek 2.11.93.0.2-12 +- fix .hidden handling on SPARC (Richard Henderson) +- don't crash when linking -shared non-pic code with SHF_MERGE +- fix .eh_frame_hdr for DW_EH_PE_aligned +- correctly adjust DW_EH_PE_pcrel encoded personalities in CIEs + +* Fri Apr 5 2002 Jakub Jelinek 2.11.93.0.2-11 +- don't emit dynamic R_SPARC_DISP* relocs against STV_HIDDEN symbols + into shared libraries + +* Thu Mar 21 2002 Jakub Jelinek 2.11.93.0.2-10 +- don't merge IA-64 unwind info sections together during ld -r + +* Mon Mar 11 2002 Jakub Jelinek 2.11.93.0.2-9 +- fix DATA_SEGMENT_ALIGN on ia64/alpha/sparc/sparc64 + +* Fri Mar 8 2002 Jakub Jelinek 2.11.93.0.2-8 +- don't crash on SHN_UNDEF local dynsyms (Andrew MacLeod) + +* Thu Mar 7 2002 Jakub Jelinek 2.11.93.0.2-7 +- fix bfd configury bug (Alan Modra) + +* Tue Mar 5 2002 Jakub Jelinek 2.11.93.0.2-6 +- don't copy visibility when equating symbols +- fix alpha .text/.data with .previous directive bug + +* Tue Mar 5 2002 Jakub Jelinek 2.11.93.0.2-5 +- fix SHF_MERGE crash with --gc-sections (#60369) +- C++ symbol versioning patch + +* Fri Feb 22 2002 Jakub Jelinek 2.11.93.0.2-4 +- add DW_EH_PE_absptr -> DW_EH_PE_pcrel optimization for shared libs, + if DW_EH_PE_absptr cannot be converted that way, don't build the + .eh_frame_hdr search table + +* Fri Feb 15 2002 Jakub Jelinek 2.11.93.0.2-3 +- fix ld -N broken by last patch + +* Tue Feb 12 2002 Jakub Jelinek 2.11.93.0.2-2 +- trade one saved runtime page for data segment (=almost always not shared) + for up to one page of disk space where possible + +* Fri Feb 8 2002 Jakub Jelinek 2.11.93.0.2-1 +- update to 2.11.93.0.2 +- use %%{ix86} instead of i386 for -z combreloc default (#59086) + +* Thu Jan 31 2002 Jakub Jelinek 2.11.92.0.12-10 +- don't create SHN_UNDEF STB_WEAK symbols unless there are any relocations + against them + +* Wed Jan 30 2002 Bill Nottingham 2.11.92.0.12-9.1 +- rebuild (fix ia64 miscompilation) + +* Wed Jan 09 2002 Tim Powers +- automated rebuild + +* Fri Dec 28 2001 Jakub Jelinek 2.11.92.0.12-8 +- two further .eh_frame patch fixes + +* Wed Dec 19 2001 Jakub Jelinek 2.11.92.0.12-7 +- as ld is currently not able to shrink input sections to zero size + during discard_info, build a fake minimal CIE in that case +- update elf-strtab patch to what was commited + +* Mon Dec 17 2001 Jakub Jelinek 2.11.92.0.12-6 +- one more .eh_frame patch fix +- fix alpha .eh_frame handling +- optimize elf-strtab finalize + +* Sat Dec 15 2001 Jakub Jelinek 2.11.92.0.12-5 +- yet another fix for the .eh_frame patch + +* Fri Dec 14 2001 Jakub Jelinek 2.11.92.0.12-4 +- Alan Modra's patch to avoid crash if there is no dynobj + +* Thu Dec 13 2001 Jakub Jelinek 2.11.92.0.12-3 +- H.J.'s patch to avoid crash if input files are not ELF +- don't crash if a SHF_MERGE for some reason could not be merged +- fix objcopy/strip to preserve SHF_MERGE sh_entsize +- optimize .eh_frame sections, add PT_GNU_EH_FRAME support +- support anonymous version tags in version script + +* Tue Nov 27 2001 Jakub Jelinek 2.11.92.0.12-2 +- fix IA-64 SHF_MERGE handling + +* Tue Nov 27 2001 Jakub Jelinek 2.11.92.0.12-1 +- update to 2.11.92.0.12 + - optimize .dynstr and .shstrtab sections (#55524) + - fix ld.1 glitch (#55459) +- turn relocs against SHF_MERGE local symbols with zero addend + into STT_SECTION + addend +- remove man pages for programs not included (nlmconv, windres, dlltool; + #55456, #55461) +- add BuildRequires for texinfo + +* Thu Oct 25 2001 Jakub Jelinek 2.11.92.0.7-2 +- duh, fix strings on bfd objects (#55084) + +* Sat Oct 20 2001 Jakub Jelinek 2.11.92.0.7-1 +- update to 2.11.92.0.7 +- remove .rel{,a}.dyn from output if it is empty + +* Thu Oct 11 2001 Jakub Jelinek 2.11.92.0.5-2 +- fix strings patch +- use getc_unlocked in strings to speed it up by 50% on large files + +* Wed Oct 10 2001 Jakub Jelinek 2.11.92.0.5-1 +- update to 2.11.92.0.5 + - binutils localization (#45148) + - fix typo in REPORT_BUGS_TO (#54325) +- support files bigger than 2GB in strings (#54406) + +* Wed Sep 26 2001 Jakub Jelinek 2.11.90.0.8-12 +- on IA-64, don't mix R_IA64_IPLTLSB relocs with non-PLT relocs in + .rela.dyn section. + +* Tue Sep 25 2001 Jakub Jelinek 2.11.90.0.8-11 +- add iplt support for IA-64 (Richard Henderson) +- switch to new section flags for SHF_MERGE and SHF_STRINGS, put + in compatibility code +- "s" section flag for small data sections on IA-64 and Alpha + (Richard Henderson) +- fix sparc64 .plt[32768+] handling +- don't emit .rela.stab on sparc + +* Mon Sep 10 2001 Jakub Jelinek 2.11.90.0.8-10 +- fix SHF_MERGE on Sparc + +* Fri Aug 31 2001 Jakub Jelinek 2.11.90.0.8-9 +- on Alpha, copy *r_offset to R_ALPHA_RELATIVE's r_addend + +* Thu Aug 30 2001 Jakub Jelinek 2.11.90.0.8-8 +- on IA-64, put crtend{,S}.o's .IA_64.unwind section last in + .IA_64.unwind output section (for compatibility with 7.1 eh) + +* Fri Aug 24 2001 Jakub Jelinek 2.11.90.0.8-7 +- put RELATIVE relocs first, not last +- enable -z combreloc by default on IA-{32,64}, Alpha, Sparc* + +* Thu Aug 23 2001 Jakub Jelinek 2.11.90.0.8-6 +- support for -z combreloc +- remove .dynamic patch, -z combreloc patch does this better +- set STT_FUNC default symbol sizes in .endp directive on IA-64 + +* Mon Jul 16 2001 Jakub Jelinek 2.11.90.0.8-5 +- fix last patch (H.J.Lu) + +* Fri Jul 13 2001 Jakub Jelinek 2.11.90.0.8-4 +- fix placing of orphan sections + +* Sat Jun 23 2001 Jakub Jelinek +- fix SHF_MERGE support on Alpha + +* Fri Jun 8 2001 Jakub Jelinek +- 2.11.90.0.8 + - some SHF_MERGE suport fixes +- don't build with tooldir /usrusr instead of /usr (#40937) +- reserve few .dynamic entries for prelinking + +* Mon Apr 16 2001 Jakub Jelinek +- 2.11.90.0.5 + - SHF_MERGE support + +* Tue Apr 3 2001 Jakub Jelinek +- 2.11.90.0.4 + - fix uleb128 support, so that CVS gcc bootstraps + - some ia64 fixes + +* Mon Mar 19 2001 Jakub Jelinek +- add -Bgroup support from Ulrich Drepper + +* Fri Mar 9 2001 Jakub Jelinek +- hack - add elf_i386_glibc21 emulation + +* Fri Feb 16 2001 Jakub Jelinek +- 2.10.91.0.2 + +* Fri Feb 9 2001 Jakub Jelinek +- 2.10.1.0.7 +- remove ExcludeArch ia64 +- back out the -oformat, -omagic and -output change for now + +* Fri Dec 15 2000 Jakub Jelinek +- Prereq /sbin/install-info + +* Tue Nov 21 2000 Jakub Jelinek +- 2.10.1.0.2 + +* Tue Nov 21 2000 Jakub Jelinek +- add one more alpha patch + +* Wed Nov 15 2000 Jakub Jelinek +- fix alpha visibility as problem +- add support for Ultra-III + +* Fri Sep 15 2000 Jakub Jelinek +- and one more alpha patch + +* Fri Sep 15 2000 Jakub Jelinek +- two sparc patches + +* Mon Jul 24 2000 Jakub Jelinek +- 2.10.0.18 + +* Mon Jul 10 2000 Jakub Jelinek +- 2.10.0.12 + +* Mon Jun 26 2000 Jakub Jelinek +- 2.10.0.9 + +* Thu Jun 15 2000 Jakub Jelinek +- fix ld -r + +* Mon Jun 5 2000 Jakub Jelinek +- 2.9.5.0.46 +- use _mandir/_infodir/_lib + +* Mon May 8 2000 Bernhard Rosenkraenzer +- 2.9.5.0.41 + +* Wed Apr 12 2000 Bernhard Rosenkraenzer +- 2.9.5.0.34 + +* Wed Mar 22 2000 Bernhard Rosenkraenzer +- 2.9.5.0.31 + +* Fri Feb 04 2000 Cristian Gafton +- man pages are compressed +- apply kingdon's patch from #5031 + +* Wed Jan 19 2000 Jeff Johnson +- Permit package to be built with a prefix other than /usr. + +* Thu Jan 13 2000 Cristian Gafton +- add pacth from hjl to fix the versioning problems in ld + +* Tue Jan 11 2000 Bernhard Rosenkraenzer +- Add sparc patches from Jakub Jelinek +- Add URL: + +* Tue Dec 14 1999 Bernhard Rosenkraenzer +- 2.9.5.0.22 + +* Wed Nov 24 1999 Bernhard Rosenkraenzer +- 2.9.5.0.19 + +* Sun Oct 24 1999 Bernhard Rosenkraenzer +- 2.9.5.0.16 + +* Mon Sep 06 1999 Jakub Jelinek +- make shared non-pic libraries work on sparc with glibc 2.1. + +* Fri Aug 27 1999 Jim Kingdon +- No source/spec changes, just rebuilding with egcs-1.1.2-18 because + the older egcs was miscompling gprof. + +* Mon Apr 26 1999 Cristian Gafton +- back out very *stupid* sparc patch done by HJLu. People, keep out of + things you don't understand. +- add alpha relax patch from rth + +* Mon Apr 05 1999 Cristian Gafton +- version 2.9.1.0.23 +- patch to make texinfo documentation compile +- auto rebuild in the new build environment (release 2) + +* Tue Feb 23 1999 Cristian Gafton +- updated to 2.9.1.0.21 +- merged with UltraPenguin + +* Mon Jan 04 1999 Cristian Gafton +- added ARM patch from philb +- version 2.9.1.0.19a +- added a patch to allow arm* arch to be identified as an ARM + +* Thu Oct 01 1998 Cristian Gafton +- updated to 2.9.1.0.14. + +* Sat Sep 19 1998 Jeff Johnson +- updated to 2.9.1.0.13. + +* Wed Sep 09 1998 Cristian Gafton +- updated to 2.9.1.0.12 + +* Thu Jul 2 1998 Jeff Johnson +- updated to 2.9.1.0.7. + +* Wed Jun 03 1998 Jeff Johnson +- updated to 2.9.1.0.6. + +* Tue Jun 02 1998 Erik Troan +- added patch from rth to get right offsets for sections in relocateable + objects on sparc32 + +* Thu May 07 1998 Prospector System +- translations modified for de, fr, tr + +* Tue May 05 1998 Cristian Gafton +- version 2.9.1.0.4 is out; even more, it is public ! + +* Tue May 05 1998 Jeff Johnson +- updated to 2.9.1.0.3. + +* Mon Apr 20 1998 Cristian Gafton +- updated to 2.9.0.3 + +* Tue Apr 14 1998 Cristian Gafton +- upgraded to 2.9.0.2 + +* Sun Apr 05 1998 Cristian Gafton +- updated to 2.8.1.0.29 (HJ warned me that this thing is a moving target... + :-) +- "fixed" the damn make install command so that all tools get installed + +* Thu Apr 02 1998 Cristian Gafton +- upgraded again to 2.8.1.0.28 (at least on alpha now egcs will compile) +- added info packages handling + +* Tue Mar 10 1998 Cristian Gafton +- upgraded to 2.8.1.0.23 + +* Mon Mar 02 1998 Cristian Gafton +- updated to 2.8.1.0.15 (required to compile the newer glibc) +- all patches are obsoleted now + +* Wed Oct 22 1997 Erik Troan +- added 2.8.1.0.1 patch from hj +- added patch for alpha palcode form rth