diff --git a/.devtoolset-6-binutils.metadata b/.devtoolset-6-binutils.metadata new file mode 100644 index 0000000..7d18766 --- /dev/null +++ b/.devtoolset-6-binutils.metadata @@ -0,0 +1 @@ +6e472ddae565a2b1447e6f2393809bb8799982cf SOURCES/binutils-2.27.tar.bz2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1dc826f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/binutils-2.27.tar.bz2 diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet 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.10-ppc64-pie.patch b/SOURCES/binutils-2.20.51.0.10-ppc64-pie.patch new file mode 100644 index 0000000..740c071 --- /dev/null +++ b/SOURCES/binutils-2.20.51.0.10-ppc64-pie.patch @@ -0,0 +1,12 @@ +--- a/bfd/elf64-ppc.c 2012-09-11 12:13:00.637448573 +0100 ++++ b/bfd/elf64-ppc.c 2012-09-11 12:13:17.922449052 +0100 +@@ -13523,6 +13523,9 @@ + { + BFD_ASSERT (h->elf.dynindx != -1); + outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type); ++ if (h->elf.dynindx == -1 ++ && h->elf.root.type == bfd_link_hash_undefweak) ++ memset (&outrel, 0, sizeof outrel); + } + else + { diff --git a/SOURCES/binutils-2.20.51.0.10-sec-merge-emit.patch b/SOURCES/binutils-2.20.51.0.10-sec-merge-emit.patch new file mode 100644 index 0000000..238beb3 --- /dev/null +++ b/SOURCES/binutils-2.20.51.0.10-sec-merge-emit.patch @@ -0,0 +1,11 @@ +--- binutils-2.26.orig/bfd/merge.c 2016-01-25 10:11:33.505289018 +0000 ++++ binutils-2.26/bfd/merge.c 2016-01-25 10:19:56.961381656 +0000 +@@ -334,7 +334,7 @@ sec_merge_emit (bfd *abfd, struct sec_me + + /* Trailing alignment needed? */ + off = sec->size - off; +- if (off != 0) ++ if (off != 0 && alignment_power) + { + if (contents) + memcpy (contents + offset, pad, off); diff --git a/SOURCES/binutils-2.20.51.0.2-ia64-lib64.patch b/SOURCES/binutils-2.20.51.0.2-ia64-lib64.patch new file mode 100644 index 0000000..c1241ac --- /dev/null +++ b/SOURCES/binutils-2.20.51.0.2-ia64-lib64.patch @@ -0,0 +1,21 @@ +2004-05-14 Jakub Jelinek + + * emulparams/elf64_ia64.sh (LIBPATH_SUFFIX): Use */lib64 paths on + ia64-linux if /lib64 tree is present. + +--- a/ld/emulparams/elf64_ia64.sh 2008-11-21 16:45:00.000000000 +0000 ++++ b/ld/emulparams/elf64_ia64.sh 2008-11-21 16:55:46.000000000 +0000 +@@ -38,3 +38,13 @@ OTHER_READONLY_SECTIONS="${OTHER_READONL + SMALL_DATA_CTOR=" " + SMALL_DATA_DTOR=" " + SHARABLE_SECTIONS=yes ++ ++# For Linux modify the default library search path ++# to first include a 64-bit specific directory. ++case "$target" in ++ ia64*-linux*) ++ case "$EMULATION_NAME" in ++ *64*) test -d /lib64 && LIBPATH_SUFFIX=64 ;; ++ esac ++ ;; ++esac 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.1-relro-on-by-default.patch b/SOURCES/binutils-2.22.52.0.1-relro-on-by-default.patch new file mode 100644 index 0000000..8d9b6c1 --- /dev/null +++ b/SOURCES/binutils-2.22.52.0.1-relro-on-by-default.patch @@ -0,0 +1,13 @@ +--- binutils-2.27.orig/ld/configure.tgt 2016-07-07 11:16:49.967963649 +0100 ++++ binutils-2.27/ld/configure.tgt 2016-07-07 11:17:02.252045673 +0100 +@@ -901,8 +901,8 @@ frv-*-* | hppa*-*-* | ia64-*-* | mips*-* + # FAIL: objcopy -shared -z relro (tbss2) + # FAIL: objcopy -shared -z relro (tbss3) + ;; +-*-*-linux*) +- if test ${ac_default_ld_z_relro} = unset; then ++*) ++ if test x${ac_default_ld_z_relro} = xunset; then + ac_default_ld_z_relro=1 + fi + ;; 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.23.51.0.3-Provide-std-tr1-hash.patch b/SOURCES/binutils-2.23.51.0.3-Provide-std-tr1-hash.patch new file mode 100644 index 0000000..852034c --- /dev/null +++ b/SOURCES/binutils-2.23.51.0.3-Provide-std-tr1-hash.patch @@ -0,0 +1,57 @@ +From b9fe56f2e08939e68cabda378c7e5c4775ed381e Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 16 Oct 2012 04:27:15 -0400 +Subject: [PATCH] Provide std::tr1::hash{, } + +When compiling powerpc.cc on gcc 4.1 i386, we fail on line 68 +because we try to instantiate unordered_map with a key that is +elfcpp::Elf_types::Elf_Addr where size seems to be uint64_t. + +That amounts to trying to use an std::tr1::hash +but then system.h only defines an std::tr1::hash with off_t +defined to long long. + +This patch defines a specialization for std::tr1::hash +and std::tr1::hash, similarly to what is done by recent libstdc++ +in the file functional_hash.h. + +gold/ + + * system.h (tr1_hashtable_define_trivial_hash): Define new macro. + Use it to define specializations std::tr1::hash + and std::tr1::hash. +--- + gold/gold.h | 21 ++++++++++++++------- + 1 files changed, 14 insertions(+), 7 deletions(-) + +diff -Nrup a/gold/system.h b/gold/system.h +--- a/gold/system.h 2012-12-21 14:40:41.000000000 -0500 ++++ b/gold/system.h 2013-01-08 13:29:21.872781906 -0500 +@@ -77,13 +77,20 @@ + // arises with GCC 4.1.x when compiling in 32-bit mode with a 64-bit + // off_t type. + namespace std { namespace tr1 { +-template<> +-struct hash : public std::unary_function +-{ +- std::size_t +- operator()(off_t val) const +- { return static_cast(val); } +-}; ++#define tr1_hashtable_define_trivial_hash(T) \ ++ template<> \ ++ struct hash \ ++ : public std::unary_function \ ++ { \ ++ std::size_t \ ++ operator()(T val) const \ ++ { return static_cast(val); } \ ++ } ++ template struct hash; ++ ++ tr1_hashtable_define_trivial_hash(long long); ++ tr1_hashtable_define_trivial_hash(unsigned long long); ++#undef tr1_hashtable_define_trivial_hash + } } // Close namespaces. + #endif // !defined(HAVE_TR1_HASH_OFF_T) + diff --git a/SOURCES/binutils-2.23.52.0.1-addr2line-dynsymtab.patch b/SOURCES/binutils-2.23.52.0.1-addr2line-dynsymtab.patch new file mode 100644 index 0000000..6abaf53 --- /dev/null +++ b/SOURCES/binutils-2.23.52.0.1-addr2line-dynsymtab.patch @@ -0,0 +1,38 @@ +--- a/bfd/opncls.c 2013-03-14 11:25:30.338306122 +0000 ++++ b/bfd/opncls.c 2013-03-14 12:20:21.686397360 +0000 +@@ -1297,6 +1297,8 @@ + bfd_malloc (strlen (debug_file_directory) + 1 + + (canon_dirlen > dirlen ? canon_dirlen : dirlen) + + strlen (".debug/") ++#define FEDORA_LIB_DEBUG_DIR "/usr/lib/debug" ++ + strlen (FEDORA_LIB_DEBUG_DIR) + strlen ("usr/") + + strlen (base) + + 1); + if (debugfile == NULL) +@@ -1332,6 +1334,26 @@ + if (check_func (debugfile, crc32)) + goto found; + ++ /* Then try in the global debug dir for Fedora libraries. */ ++ sprintf (debugfile, "%s%s%s", FEDORA_LIB_DEBUG_DIR, dir, base); ++ if (separate_debug_file_exists (debugfile, crc32)) ++ { ++ free (base); ++ free (dir); ++ free (canon_dir); ++ return debugfile; ++ } ++ ++ /* Then try in the usr subdirectory of the global debug dir for Fedora libraries. */ ++ sprintf (debugfile, "%s/usr%s%s", FEDORA_LIB_DEBUG_DIR, dir, base); ++ if (separate_debug_file_exists (debugfile, crc32)) ++ { ++ free (base); ++ free (dir); ++ free (canon_dir); ++ return debugfile; ++ } ++ + /* Then try in the global debugfile directory. */ + strcpy (debugfile, debug_file_directory); + dirlen = strlen (debug_file_directory) - 1; diff --git a/SOURCES/binutils-2.24-ldforcele.patch b/SOURCES/binutils-2.24-ldforcele.patch new file mode 100644 index 0000000..194cf1e --- /dev/null +++ b/SOURCES/binutils-2.24-ldforcele.patch @@ -0,0 +1,54 @@ +Common subdirectories: ../binutils-2.24.orig/ld/emulparams and ld/emulparams +Common subdirectories: ../binutils-2.24.orig/ld/emultempl and ld/emultempl +diff -up ../binutils-2.24.orig/ld/ldlang.c ld/ldlang.c +--- a/ld/ldlang.c 2014-05-09 10:35:04.589504928 +0100 ++++ b/ld/ldlang.c 2014-05-09 10:35:55.515661478 +0100 +@@ -7096,6 +7096,18 @@ + && little != NULL) + format = little; + ++ if (getenv ("LD_FORCE_LE") != NULL) ++ { ++ if (strcmp (format, "elf64-powerpc") == 0) ++ format = "elf64-powerpcle"; ++ else if (strcmp (format, "elf32-powerpc") == 0) ++ format = "elf32-powerpcle"; ++ else if (strcmp (format, "elf64-big") == 0) ++ format = "elf64-little"; ++ else if (strcmp (format, "elf32-big") == 0) ++ format = "elf32-little"; ++ } ++ + output_target = format; + } + } +Only in ld: ldlang.c.orig +diff -up ../binutils-2.24.orig/ld/ldmain.c ld/ldmain.c +--- a/ld/ldmain.c 2014-05-09 10:35:04.593504941 +0100 ++++ b/ld/ldmain.c 2014-05-09 10:35:55.515661478 +0100 +@@ -603,6 +603,18 @@ + } + } + ++ if ((strncmp (emulation, "elf64ppc", 8) == 0 ++ || strncmp (emulation, "elf32ppc", 8) == 0) ++ && getenv ("LD_FORCE_LE") != NULL) ++ { ++ size_t len = strlen (emulation); ++ char *le = xmalloc (len + 2); ++ memcpy (le, emulation, 5); ++ le[5] = 'l'; ++ memcpy (le + 6, emulation + 5, len - 4); ++ emulation = le; ++ } ++ + return emulation; + } + +Only in ld: ldmain.c.orig +Common subdirectories: ../binutils-2.24.orig/ld/ldscripts and ld/ldscripts +Common subdirectories: ../binutils-2.24.orig/ld/.libs and ld/.libs +Common subdirectories: ../binutils-2.24.orig/ld/po and ld/po +Common subdirectories: ../binutils-2.24.orig/ld/scripttempl and ld/scripttempl +Common subdirectories: ../binutils-2.24.orig/ld/testsuite and ld/testsuite +Common subdirectories: ../binutils-2.24.orig/ld/tmpdir and ld/tmpdir diff --git a/SOURCES/binutils-2.24-rh919508.patch b/SOURCES/binutils-2.24-rh919508.patch new file mode 100644 index 0000000..4e2e19c --- /dev/null +++ b/SOURCES/binutils-2.24-rh919508.patch @@ -0,0 +1,12 @@ +diff -Nrup a/gold/Makefile.in b/gold/Makefile.in +--- a/gold/Makefile.in 2014-05-16 02:47:18.061653023 -0400 ++++ b/gold/Makefile.in 2014-05-16 02:51:39.680778689 -0400 +@@ -120,7 +120,7 @@ am__objects_3 = yyscript.$(OBJEXT) + am_libgold_a_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_2) + libgold_a_OBJECTS = $(am_libgold_a_OBJECTS) +-am__installdirs = "$(DESTDIR)$(bindir)" ++am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" + @GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@am__EXEEXT_1 = \ + @GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@ ld3$(EXEEXT) + PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) 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..567f909 --- /dev/null +++ b/SOURCES/binutils-2.26-lto.patch @@ -0,0 +1,2556 @@ +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 +@@ -1089,6 +1089,9 @@ struct bfd_section *bfd_create_gnu_debug + bfd_boolean bfd_fill_in_gnu_debuglink_section + (bfd *abfd, struct bfd_section *sect, const char *filename); + ++const char *bfd_extract_object_only_section ++ (bfd *abfd); ++ + /* Extracted from libbfd.c. */ + + /* Byte swapping macros for user section data. */ +@@ -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/opncls.c binutils-2.26/bfd/opncls.c +--- binutils-2.26.orig/bfd/opncls.c 2016-02-19 09:35:36.281000909 +0000 ++++ binutils-2.26/bfd/opncls.c 2016-02-19 09:35:54.905106520 +0000 +@@ -1717,3 +1717,69 @@ bfd_fill_in_gnu_debuglink_section (bfd * + + return TRUE; + } ++ ++/* ++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 = 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; ++} +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/armelf.em binutils-2.26/ld/emultempl/armelf.em +--- binutils-2.26.orig/ld/emultempl/armelf.em 2016-02-19 09:35:36.698003274 +0000 ++++ binutils-2.26/ld/emultempl/armelf.em 2016-02-19 09:35:54.914106571 +0000 +@@ -377,7 +377,7 @@ gld${EMULATION_NAME}_after_allocation (v + } + + static void +-gld${EMULATION_NAME}_finish (void) ++arm_finish (void) + { + struct bfd_link_hash_entry * h; + +@@ -404,7 +404,7 @@ gld${EMULATION_NAME}_finish (void) + } + } + +- finish_default (); ++ gld${EMULATION_NAME}_finish (); + + if (thumb_entry_symbol) + { +@@ -730,5 +730,5 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS= + LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse + LDEMUL_SET_SYMBOLS=gld"${EMULATION_NAME}"_set_symbols + + # Call the extra arm-elf function +-LDEMUL_FINISH=gld${EMULATION_NAME}_finish ++LDEMUL_FINISH=arm_finish +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) + else + 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 + return last; + } + ++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__)} : +diff -rup binutils-2.26.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.26/ld/testsuite/ld-plugin/lto.exp +--- binutils-2.26.orig/ld/testsuite/ld-plugin/lto.exp 2016-02-19 09:35:36.807003892 +0000 ++++ binutils-2.26/ld/testsuite/ld-plugin/lto.exp 2016-02-19 09:36:15.450223025 +0000 +@@ -79,6 +79,15 @@ set lto_link_tests [list \ + [list "Build liblto-3.a" \ + "" "-flto $lto_fat" \ + {lto-3b.c} {} "liblto-3.a"] \ ++ [list "Compile 4a" \ ++ "" "-flto $lto_fat" \ ++ {lto-4a.c} {} ""] \ ++ [list "Compile 4b" \ ++ "" "-O2" \ ++ {lto-4b.c} {} ""] \ ++ [list "Compile 4c" \ ++ "" "-O2" \ ++ {lto-4c.c} {} ""] \ + [list "Compile 5a" \ + "" "-flto $lto_fat" \ + {lto-5a.c} {} ""] \ +@@ -94,6 +103,12 @@ set lto_link_tests [list \ + [list "Compile 9" \ + "" "-O2 -finline -flto" \ + {lto-9.cc} {} "" "c++"] \ ++ [list "Compile 10a" \ ++ "" "-O2" \ ++ {lto-10a.c} {} ""] \ ++ [list "Compile 10b" \ ++ "" "-O2 -flto $lto_fat" \ ++ {lto-10b.c} {} ""] \ + [list "Compile 11a" \ + "" "-O -flto" \ + {lto-11a.c} {} ""] \ +@@ -291,9 +306,21 @@ set lto_run_tests [list \ + [list "LTO 3c" \ + "-O2 -flto -fuse-linker-plugin tmpdir/lto-3a.o tmpdir/lto-3c.o -Wl,--whole-archive tmpdir/liblto-3.a -Wl,--no-whole-archive tmpdir/liblto-3.a" "" \ + {dummy.c} "lto-3d.exe" "lto-3.out" "" "c"] \ ++ [list "LTO 4a" \ ++ "-O2 -flto -fuse-linker-plugin tmpdir/lto-4r-a.o" "" \ ++ {dummy.c} "lto-4a.exe" "lto-4.out" "" "c"] \ ++ [list "LTO 4c" \ ++ "-O2 -flto -fuse-linker-plugin tmpdir/lto-4r-c.o" "" \ ++ {dummy.c} "lto-4c.exe" "lto-4.out" "" "c"] \ ++ [list "LTO 4d" \ ++ "-O2 -flto -fuse-linker-plugin tmpdir/lto-4r-d.o" "" \ ++ {dummy.c} "lto-4d.exe" "lto-4.out" "" "c"] \ + [list "LTO 5" \ + "-O2 -flto -fuse-linker-plugin tmpdir/lto-5.o" "" \ + {dummy.c} "lto-5.exe" "lto-5.out" "" "c"] \ ++ [list "LTO 10" \ ++ "-O2 -flto -fuse-linker-plugin tmpdir/lto-10.o" "" \ ++ {dummy.c} "lto-10.exe" "lto-10.out" "" "c"] \ + [list "LTO 11" \ + "-O -flto -fuse-linker-plugin tmpdir/liblto-11.a" "" \ + {dummy.c} "lto-11.exe" "lto-11.out" "" "c"] \ +@@ -378,6 +405,15 @@ if { [is_elf_format] && [check_lto_share + } + } + ++set testname "Build liblto-4.a" ++remote_file host delete "tmpdir/liblto-4.a" ++set catch_output [run_host_cmd "$ar" "rc tmpdir/liblto-4.a tmpdir/lto-4a.o tmpdir/lto-4b.o tmpdir/lto-4c.o"] ++if {![string match "" $catch_output]} { ++ unresolved $testname ++ restore_notify ++ return ++} ++ + set testname "Build liblto-11.a" + remote_file host delete "tmpdir/liblto-11.a" + set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"] +@@ -424,8 +460,30 @@ return + # Run "ld -r" to generate inputs for complex LTO tests. + run_dump_test "lto-3r" + remote_exec host "mv" "tmpdir/dump tmpdir/lto-3.o" ++run_dump_test "lto-4r-a" ++remote_exec host "mv" "tmpdir/dump tmpdir/lto-4r-a.o" ++run_dump_test "lto-4r-b" ++remote_exec host "mv" "tmpdir/dump tmpdir/lto-4r-b.o" ++run_dump_test "lto-4r-c" ++remote_exec host "mv" "tmpdir/dump tmpdir/lto-4r-c.o" ++run_dump_test "lto-4r-d" ++remote_exec host "mv" "tmpdir/dump tmpdir/lto-4r-d.o" + run_dump_test "lto-5r" + remote_exec host "mv" "tmpdir/dump tmpdir/lto-5.o" ++run_dump_test "lto-10r" ++remote_exec host "mv" "tmpdir/dump tmpdir/lto-10.o" ++set testname "nm mixed object" ++set lto_plugin [run_host_cmd "$CC" "-print-prog-name=liblto_plugin.so tmpdir/lto-10.o"] ++if { [ regexp "liblto_plugin.so" $lto_plugin ] } { ++ set exec_output [run_host_cmd "$NM" "--plugin $lto_plugin tmpdir/lto-10.o"] ++ if { [ regexp "T main" $exec_output ] } { ++ pass $testname ++ } { ++ fail $testname ++ } ++} { ++ fail $testname ++ } + + run_cc_link_tests $lto_link_symbol_tests + +--- /dev/null 2016-08-19 08:03:37.292222041 +0100 ++++ binutils-2.27/ld/testsuite/ld-plugin/lto-4a.c 2016-08-19 12:14:15.685818046 +0100 +@@ -0,0 +1,7 @@ ++extern void foo(void); ++ ++int main(void) ++{ ++ foo(); ++ return 0; ++} +--- /dev/null 2016-08-19 08:03:37.292222041 +0100 ++++ binutils-2.27/ld/testsuite/ld-plugin/lto-4b.c 2016-08-19 12:14:19.603842115 +0100 +@@ -0,0 +1,9 @@ ++#include ++ ++extern void bar (void); ++ ++void foo(void) ++{ ++ bar (); ++ printf ("hello foo\n"); ++} +--- /dev/null 2016-08-19 08:03:37.292222041 +0100 ++++ binutils-2.27/ld/testsuite/ld-plugin/lto-4c.c 2016-08-19 12:14:21.987856760 +0100 +@@ -0,0 +1,6 @@ ++#include ++ ++void bar (void) ++{ ++ printf ("hello bar\n"); ++} +--- /dev/null 2016-08-19 08:03:37.292222041 +0100 ++++ binutils-2.27/ld/testsuite/ld-plugin/lto-10a.c 2016-08-19 12:14:27.670891671 +0100 +@@ -0,0 +1,6 @@ ++extern int foo(void); ++ ++int main(void) ++{ ++ return foo(); ++} +--- /dev/null 2016-08-19 08:03:37.292222041 +0100 ++++ binutils-2.27/ld/testsuite/ld-plugin/lto-10b.c 2016-08-19 12:14:33.380926748 +0100 +@@ -0,0 +1,7 @@ ++#include ++ ++int foo(void) ++{ ++ printf ("hello\n"); ++ return 0; ++} diff --git a/SOURCES/binutils-2.27-aarch64-relro-default.patch b/SOURCES/binutils-2.27-aarch64-relro-default.patch new file mode 100644 index 0000000..c6f87da --- /dev/null +++ b/SOURCES/binutils-2.27-aarch64-relro-default.patch @@ -0,0 +1,12 @@ +diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em +index a17553a..9f2c349 100644 +--- a/ld/emultempl/aarch64elf.em ++++ b/ld/emultempl/aarch64elf.em +@@ -43,6 +43,7 @@ gld${EMULATION_NAME}_before_parse (void) + input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; + config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; + config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; ++ link_info.relro = DEFAULT_LD_Z_RELRO; + } + + static void diff --git a/SOURCES/binutils-2.27-local-dynsym-count.patch b/SOURCES/binutils-2.27-local-dynsym-count.patch new file mode 100644 index 0000000..7b27255 --- /dev/null +++ b/SOURCES/binutils-2.27-local-dynsym-count.patch @@ -0,0 +1,271 @@ +diff -rup binutils-2.27.orig/bfd/ChangeLog binutils-2.27/bfd/ChangeLog +--- binutils-2.27.orig/bfd/ChangeLog 2016-08-12 17:14:07.621773233 +0100 ++++ binutils-2.27/bfd/ChangeLog 2016-08-12 17:17:32.408119156 +0100 +@@ -1,3 +1,9 @@ ++2016-08-12 Alan Modra ++ ++ * elf-bfd.h (struct elf_link_hash_table): Add local_dynsymcount. ++ * elflink.c (_bfd_elf_link_renumber_dynsyms): Set local_dynsymcount. ++ (bfd_elf_final_link): Set .dynsym sh_info from local_dynsymcount. ++ + 2016-08-03 Tristan Gingold + + * version.m4: Bump version to 2.27 +Only in binutils-2.27/bfd: ChangeLog.orig +Only in binutils-2.27/bfd: ChangeLog.rej +diff -rup binutils-2.27.orig/bfd/elf-bfd.h binutils-2.27/bfd/elf-bfd.h +--- binutils-2.27.orig/bfd/elf-bfd.h 2016-08-12 17:14:07.630773290 +0100 ++++ binutils-2.27/bfd/elf-bfd.h 2016-08-12 17:16:08.519549845 +0100 +@@ -524,6 +524,7 @@ struct elf_link_hash_table + /* The number of symbols found in the link which is intended for the + mandatory DT_SYMTAB tag (.dynsym section) in .dynamic section. */ + bfd_size_type dynsymcount; ++ bfd_size_type local_dynsymcount; + + /* The string table of dynamic symbols, which becomes the .dynstr + section. */ +diff -rup binutils-2.27.orig/bfd/elflink.c binutils-2.27/bfd/elflink.c +--- binutils-2.27.orig/bfd/elflink.c 2016-08-12 17:14:07.637773334 +0100 ++++ binutils-2.27/bfd/elflink.c 2016-08-12 17:16:08.521549858 +0100 +@@ -903,6 +903,7 @@ _bfd_elf_link_renumber_dynsyms (bfd *out + for (p = elf_hash_table (info)->dynlocal; p ; p = p->next) + p->dynindx = ++dynsymcount; + } ++ elf_hash_table (info)->local_dynsymcount = dynsymcount; + + elf_link_hash_traverse (elf_hash_table (info), + elf_link_renumber_hash_table_dynsyms, +@@ -11678,7 +11679,10 @@ bfd_elf_final_link (bfd *abfd, struct bf + { + Elf_Internal_Sym sym; + bfd_byte *dynsym = elf_hash_table (info)->dynsym->contents; +- long last_local = 0; ++ ++ o = elf_hash_table (info)->dynsym->output_section; ++ elf_section_data (o)->this_hdr.sh_info ++ = elf_hash_table (info)->local_dynsymcount + 1; + + /* Write out the section symbols for the output sections. */ + if (bfd_link_pic (info) +@@ -11708,8 +11712,6 @@ bfd_elf_final_link (bfd *abfd, struct bf + return FALSE; + sym.st_value = s->vma; + dest = dynsym + dynindx * bed->s->sizeof_sym; +- if (last_local < dynindx) +- last_local = dynindx; + bed->s->swap_symbol_out (abfd, &sym, dest, 0); + } + } +@@ -11742,16 +11744,10 @@ bfd_elf_final_link (bfd *abfd, struct bf + + e->isym.st_value); + } + +- if (last_local < e->dynindx) +- last_local = e->dynindx; +- + dest = dynsym + e->dynindx * bed->s->sizeof_sym; + bed->s->swap_symbol_out (abfd, &sym, dest, 0); + } + } +- +- elf_section_data (elf_hash_table (info)->dynsym->output_section)->this_hdr.sh_info = +- last_local + 1; + } + + /* We get the global symbols from the hash table. */ +Only in binutils-2.27/bfd: elflink.c.orig +diff -rup binutils-2.27.orig/ld/ChangeLog binutils-2.27/ld/ChangeLog +--- binutils-2.27.orig/ld/ChangeLog 2016-08-12 17:14:08.064776041 +0100 ++++ binutils-2.27/ld/ChangeLog 2016-08-12 17:17:00.166900351 +0100 +@@ -1,3 +1,19 @@ ++2016-08-12 Alan Modra ++ ++ * testsuite/ld-tic6x/shlib-1.rd: Correct expected .dynsym sh_info. ++ * testsuite/ld-tic6x/shlib-1b.rd: Likewise. ++ * testsuite/ld-tic6x/shlib-1r.rd: Likewise. ++ * testsuite/ld-tic6x/shlib-1rb.rd: Likewise. ++ * testsuite/ld-tic6x/shlib-app-1.rd: Likewise. ++ * testsuite/ld-tic6x/shlib-app-1b.rd: Likewise. ++ * testsuite/ld-tic6x/shlib-app-1r.rd: Likewise. ++ * testsuite/ld-tic6x/shlib-app-1rb.rd: Likewise. ++ * testsuite/ld-tic6x/shlib-noindex.rd: Likewise. ++ * testsuite/ld-tic6x/static-app-1.rd: Likewise. ++ * testsuite/ld-tic6x/static-app-1b.rd: Likewise. ++ * testsuite/ld-tic6x/static-app-1r.rd: Likewise. ++ * testsuite/ld-tic6x/static-app-1rb.rd: Likewise. ++ + 2016-08-03 Tristan Gingold + + * configure: Regenerate. +Only in binutils-2.27/ld: ChangeLog.orig +Only in binutils-2.27/ld: ChangeLog.rej +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1b.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-1b.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1b.rd 2016-08-12 17:14:08.200776903 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-1b.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4 ++ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 00008140 001140 000024 0c AI 2 10 4 + \[ 5\] \.rela\.neardata RELA 00008164 001164 000018 0c AI 2 11 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1rb.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-1rb.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1rb.rd 2016-08-12 17:14:08.200776903 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-1rb.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4 ++ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 00008140 001140 000024 0c AI 2 10 4 + \[ 5\] \.rela\.neardata RELA 00008164 001164 000018 0c AI 2 11 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-1.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1.rd 2016-08-12 17:14:08.200776903 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-1.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4 ++ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 00008140 001140 000024 0c AI 2 10 4 + \[ 5\] \.rela\.neardata RELA 00008164 001164 000018 0c AI 2 11 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1r.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-1r.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1r.rd 2016-08-12 17:14:08.200776903 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-1r.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4 ++ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 00008140 001140 000024 0c AI 2 10 4 + \[ 5\] \.rela\.neardata RELA 00008164 001164 000018 0c AI 2 11 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1b.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1b.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1b.rd 2016-08-12 17:14:08.200776903 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1b.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 000044 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 00008044 001044 0000c0 10 A 3 6 4 ++ \[ 2\] \.dynsym DYNSYM 00008044 001044 0000c0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 00008104 001104 000036 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 0000813c 00113c 000018 0c AI 2 11 4 + \[ 5\] \.rela\.neardata RELA 00008154 001154 000018 0c AI 2 12 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1rb.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1rb.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1rb.rd 2016-08-12 17:14:08.201776909 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1rb.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 6 4 ++ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 000080dc 0010dc 000031 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 00008110 001110 000018 0c AI 2 10 4 + \[ 5\] \.rela\.bss RELA 00008128 001128 00000c 0c AI 2 12 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1.rd 2016-08-12 17:14:08.200776903 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 000044 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 00008044 001044 0000c0 10 A 3 6 4 ++ \[ 2\] \.dynsym DYNSYM 00008044 001044 0000c0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 00008104 001104 000035 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 0000813c 00113c 000018 0c AI 2 11 4 + \[ 5\] \.rela\.neardata RELA 00008154 001154 000018 0c AI 2 12 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1r.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1r.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1r.rd 2016-08-12 17:14:08.200776903 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1r.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 6 4 ++ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 000080dc 0010dc 000030 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 0000810c 00110c 000018 0c AI 2 10 4 + \[ 5\] \.rela\.bss RELA 00008124 001124 00000c 0c AI 2 12 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-noindex.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-noindex.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-noindex.rd 2016-08-12 17:14:08.201776909 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-noindex.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4 ++ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1 + \[ 4\] \.rela\.text RELA 00008140 001140 00000c 0c AI 2 10 4 + \[ 5\] \.rela\.got RELA 0000814c 00114c 000024 0c AI 2 11 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1b.rd binutils-2.27/ld/testsuite/ld-tic6x/static-app-1b.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1b.rd 2016-08-12 17:14:08.201776909 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/static-app-1b.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 5 4 ++ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 000080dc 0010dc 00001d 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 000080fc 0010fc 000024 0c AI 2 8 4 + \[ 5\] \.rela\.neardata RELA 00008120 001120 000030 0c AI 2 9 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1rb.rd binutils-2.27/ld/testsuite/ld-tic6x/static-app-1rb.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1rb.rd 2016-08-12 17:14:08.201776909 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/static-app-1rb.rd 2016-08-12 17:16:08.523549872 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 5 4 ++ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 000080dc 0010dc 00001d 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 000080fc 0010fc 000024 0c AI 2 8 4 + \[ 5\] \.rela\.neardata RELA 00008120 001120 000018 0c AI 2 9 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1.rd binutils-2.27/ld/testsuite/ld-tic6x/static-app-1.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1.rd 2016-08-12 17:14:08.201776909 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/static-app-1.rd 2016-08-12 17:16:08.522549865 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 5 4 ++ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 000080dc 0010dc 00001d 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 000080fc 0010fc 000024 0c AI 2 8 4 + \[ 5\] \.rela\.neardata RELA 00008120 001120 000030 0c AI 2 9 4 +diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1r.rd binutils-2.27/ld/testsuite/ld-tic6x/static-app-1r.rd +--- binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1r.rd 2016-08-12 17:14:08.201776909 +0100 ++++ binutils-2.27/ld/testsuite/ld-tic6x/static-app-1r.rd 2016-08-12 17:16:08.523549872 +0100 +@@ -4,7 +4,7 @@ Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4 +- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 5 4 ++ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4 + \[ 3\] \.dynstr STRTAB 000080dc 0010dc 00001d 00 A 0 0 1 + \[ 4\] \.rela\.got RELA 000080fc 0010fc 000024 0c AI 2 8 4 + \[ 5\] \.rela\.neardata RELA 00008120 001120 000018 0c AI 2 9 4 +--- binutils-2.27.orig/binutils/readelf.c 2016-08-12 17:14:07.717773841 +0100 ++++ binutils-2.27/binutils/readelf.c 2016-08-12 17:24:25.007897415 +0100 +@@ -11110,6 +11110,11 @@ process_symbol_table (FILE * file) + } + + putchar ('\n'); ++ ++ if (ELF_ST_BIND (psym->st_info) == STB_LOCAL ++ && si >= section->sh_info) ++ warn (_("local symbol %u found at index >= %s's sh_info value of %u\n"), ++ si, printable_section_name (section), section->sh_info); + } + + free (symtab); diff --git a/SOURCES/binutils-2.27-monotonic-section-offsets.patch b/SOURCES/binutils-2.27-monotonic-section-offsets.patch new file mode 100644 index 0000000..09df9f7 --- /dev/null +++ b/SOURCES/binutils-2.27-monotonic-section-offsets.patch @@ -0,0 +1,2100 @@ +diff --git a/bfd/elf.c b/bfd/elf.c +index 274cd53..c3630d2 100644 +--- a/bfd/elf.c ++++ b/bfd/elf.c +@@ -3093,7 +3093,7 @@ elf_fake_sections (bfd *abfd, asection *asect, void *fsarg) + compressed. */ + asect->flags |= SEC_ELF_COMPRESS; + +- /* If this section will be compressed, delay adding setion ++ /* If this section will be compressed, delay adding section + name to section name section after it is compressed in + _bfd_elf_assign_file_positions_for_non_load. */ + delay_st_name_p = TRUE; +@@ -3595,10 +3595,6 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) + d->rela.idx = 0; + } + +- elf_shstrtab_sec (abfd) = section_number++; +- _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->shstrtab_hdr.sh_name); +- elf_elfheader (abfd)->e_shstrndx = elf_shstrtab_sec (abfd); +- + need_symtab = (bfd_get_symcount (abfd) > 0 + || (link_info == NULL + && ((abfd->flags & (EXEC_P | DYNAMIC | HAS_RELOC)) +@@ -3626,6 +3622,10 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) + _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->strtab_hdr.sh_name); + } + ++ elf_shstrtab_sec (abfd) = section_number++; ++ _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->shstrtab_hdr.sh_name); ++ elf_elfheader (abfd)->e_shstrndx = elf_shstrtab_sec (abfd); ++ + if (section_number >= SHN_LORESERVE) + { + _bfd_error_handler (_("%B: too many sections: %u"), +@@ -6028,7 +6028,7 @@ _bfd_elf_assign_file_positions_for_non_load (bfd *abfd) + return FALSE; + name = new_name; + } +- /* Add setion name to section name section. */ ++ /* Add section name to section name section. */ + if (shdrp->sh_name != (unsigned int) -1) + abort (); + shdrp->sh_name +@@ -6036,7 +6036,7 @@ _bfd_elf_assign_file_positions_for_non_load (bfd *abfd) + name, FALSE); + d = elf_section_data (sec); + +- /* Add reloc setion name to section name section. */ ++ /* Add reloc section name to section name section. */ + if (d->rel.hdr + && !_bfd_elf_set_reloc_sh_name (abfd, + d->rel.hdr, +diff --git a/binutils/testsuite/binutils-all/readelf.s b/binutils/testsuite/binutils-all/readelf.s +index fd62fda..5aae0ce 100644 +--- a/binutils/testsuite/binutils-all/readelf.s ++++ b/binutils/testsuite/binutils-all/readelf.s +@@ -14,8 +14,8 @@ Section Headers: + # MIPS targets put .reginfo, .mdebug, .MIPS.abiflags and .gnu.attributes here. + # v850 targets put .call_table_data and .call_table_text here. + #... +- +\[ .\] .shstrtab +STRTAB +00000000 0+.* 0+.* 00 .* +0 +0 +. + +\[..\] .symtab +SYMTAB +00000000 0+.* 0+.* 10 +.. +.+ +4 + +\[..\] .strtab +STRTAB +00000000 0+.* 0+.* 00 .* +0 +0 +1 ++ +\[..\] .shstrtab +STRTAB +00000000 0+.* 0+.* 00 .* +0 +0 +. + Key to Flags: + #... +diff --git a/binutils/testsuite/binutils-all/readelf.s-64 b/binutils/testsuite/binutils-all/readelf.s-64 +index d198300..622b314 100644 +--- a/binutils/testsuite/binutils-all/readelf.s-64 ++++ b/binutils/testsuite/binutils-all/readelf.s-64 +@@ -13,12 +13,12 @@ Section Headers: + +000000000000000[48] +0000000000000000 +WA +0 +0 +.* + +\[ 4\] .bss +NOBITS +0000000000000000 +000000(4c|50|54|58) + +0000000000000000 +0000000000000000 +WA +0 +0 +.* +- +\[ 5\] .shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ +- +00000000000000.. +0000000000000000 .* +0 +0 +.* +- +\[ 6\] .symtab +SYMTAB +0000000000000000 +0+.* ++ +\[ 5\] .symtab +SYMTAB +0000000000000000 +0+.* + # aarch64-elf targets have one more data symbol. +- +0+.* +0000000000000018 +7 +(6|7) +8 +- +\[ 7\] .strtab +STRTAB +0000000000000000 +0+.* ++ +0+.* +0000000000000018 +6 +(6|7) +8 ++ +\[ 6\] .strtab +STRTAB +0000000000000000 +0+.* + +0+.* +0000000000000000 .* +0 +0 +1 ++ +\[ 7\] .shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ ++ +00000000000000.. +0000000000000000 .* +0 +0 +.* + Key to Flags: + #... +diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-unwind.d b/gas/testsuite/gas/i386/ilp32/x86-64-unwind.d +index 5cea05e..5dc74d6 100644 +--- a/gas/testsuite/gas/i386/ilp32/x86-64-unwind.d ++++ b/gas/testsuite/gas/i386/ilp32/x86-64-unwind.d +@@ -11,8 +11,8 @@ Section Headers: + \[ 2\] .data PROGBITS 00000000 000034 000000 00 WA 0 0 1 + \[ 3\] .bss NOBITS 00000000 000034 000000 00 WA 0 0 1 + \[ 4\] .eh_frame X86_64_UNWIND 00000000 000034 000008 00 A 0 0 1 +- \[ 5\] .shstrtab STRTAB 00000000 [0-9a-f]+ 000036 00 . 0 0 1 +- \[ 6\] .symtab SYMTAB 00000000 [0-9a-f]+ 000050 10 7 5 4 +- \[ 7\] .strtab STRTAB 00000000 [0-9a-f]+ 000001 00 . 0 0 1 ++ \[ 5\] .symtab SYMTAB 00000000 [0-9a-f]+ 000050 10 6 5 4 ++ \[ 6\] .strtab STRTAB 00000000 [0-9a-f]+ 000001 00 . 0 0 1 ++ \[ 7\] .shstrtab STRTAB 00000000 [0-9a-f]+ 000036 00 . 0 0 1 + Key to Flags: + #pass +diff --git a/gas/testsuite/gas/i386/x86-64-unwind.d b/gas/testsuite/gas/i386/x86-64-unwind.d +index 7a4c64c..89f1a65 100644 +--- a/gas/testsuite/gas/i386/x86-64-unwind.d ++++ b/gas/testsuite/gas/i386/x86-64-unwind.d +@@ -16,11 +16,11 @@ Section Headers: + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 4\] \.eh_frame X86_64_UNWIND 0000000000000000 00000040 + 0000000000000008 0000000000000000 A 0 0 1 +- \[ 5\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ +- 0000000000000036 0000000000000000 . 0 0 1 +- \[ 6\] \.symtab SYMTAB 0000000000000000 [0-9a-f]+ +- 0000000000000078 0000000000000018 7 5 8 +- \[ 7\] \.strtab STRTAB 0000000000000000 [0-9a-f]+ ++ \[ 5\] \.symtab SYMTAB 0000000000000000 [0-9a-f]+ ++ 0000000000000078 0000000000000018 6 5 8 ++ \[ 6\] \.strtab STRTAB 0000000000000000 [0-9a-f]+ + 0000000000000001 0000000000000000 . 0 0 1 ++ \[ 7\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ ++ 0000000000000036 0000000000000000 . 0 0 1 + Key to Flags: + #... +diff --git a/gas/testsuite/gas/ia64/alias-ilp32.d b/gas/testsuite/gas/ia64/alias-ilp32.d +index d882b3c..df05d36 100644 +--- a/gas/testsuite/gas/ia64/alias-ilp32.d ++++ b/gas/testsuite/gas/ia64/alias-ilp32.d +@@ -12,9 +12,9 @@ Section Headers: + +\[ 2\] .data +PROGBITS +00000000 000040 000000 00 +WA +0 +0 +1 + +\[ 3\] .bss +NOBITS +00000000 000040 000000 00 +WA +0 +0 +1 + +\[ 4\] 1234 +PROGBITS +00000000 000040 000005 00 +WA +0 +0 +1 +- +\[ 5\] .shstrtab +STRTAB +00000000 [0-9a-f]+ 000031 00 +0 +0 +1 +- +\[ 6\] .symtab +SYMTAB +00000000 [0-9a-f]+ 000060 10 +7 +6 +4 +- +\[ 7\] .strtab +STRTAB +00000000 [0-9a-f]+ 000006 00 +0 +0 +1 ++ +\[ 5\] .symtab +SYMTAB +00000000 [0-9a-f]+ 000060 10 +6 +6 +4 ++ +\[ 6\] .strtab +STRTAB +00000000 [0-9a-f]+ 000006 00 +0 +0 +1 ++ +\[ 7\] .shstrtab +STRTAB +00000000 [0-9a-f]+ 000031 00 +0 +0 +1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/ia64/alias.d b/gas/testsuite/gas/ia64/alias.d +index 398bff4..23b9330 100644 +--- a/gas/testsuite/gas/ia64/alias.d ++++ b/gas/testsuite/gas/ia64/alias.d +@@ -16,12 +16,12 @@ Section Headers: + +0000000000000000 +0000000000000000 +WA +0 +0 +1 + +\[ 4\] 1234 +PROGBITS +0000000000000000 +00000040 + +0000000000000005 +0000000000000000 +WA +0 +0 +1 +- +\[ 5\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ +- +0000000000000031 +0000000000000000 +0 +0 +1 +- +\[ 6\] \.symtab +SYMTAB +0000000000000000 .* +- +0000000000000090 +0000000000000018 +7 +6 +8 +- +\[ 7\] \.strtab +STRTAB +0000000000000000 .* ++ +\[ 5\] \.symtab +SYMTAB +0000000000000000 .* ++ +0000000000000090 +0000000000000018 +6 +6 +8 ++ +\[ 6\] \.strtab +STRTAB +0000000000000000 .* + +0000000000000006 +0000000000000000 +0 +0 +1 ++ +\[ 7\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ ++ +0000000000000031 +0000000000000000 +0 +0 +1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/ia64/group-1.d b/gas/testsuite/gas/ia64/group-1.d +index b4eab14..b90bd88 100644 +--- a/gas/testsuite/gas/ia64/group-1.d ++++ b/gas/testsuite/gas/ia64/group-1.d +@@ -18,12 +18,12 @@ Section Headers: + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 5\] \.text PROGBITS 0000000000000000 00000050 + 0000000000000010 0000000000000000 AXG 0 0 16 +- \[ 6\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ +- 0000000000000033 0000000000000000 0 0 1 +- \[ 7\] \.symtab SYMTAB 0000000000000000 .* +- 00000000000000c0 0000000000000018 8 8 8 +- \[ 8\] \.strtab STRTAB 0000000000000000 .* ++ \[ 6\] \.symtab SYMTAB 0000000000000000 .* ++ 00000000000000c0 0000000000000018 7 8 8 ++ \[ 7\] \.strtab STRTAB 0000000000000000 .* + 000000000000000[7c] 0000000000000000 0 0 1 ++ \[ 8\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ ++ 0000000000000033 0000000000000000 0 0 1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/ia64/group-2.d b/gas/testsuite/gas/ia64/group-2.d +index 7370367..cc8413f 100644 +--- a/gas/testsuite/gas/ia64/group-2.d ++++ b/gas/testsuite/gas/ia64/group-2.d +@@ -25,12 +25,12 @@ Section Headers: + 0000000000000018 0000000000000000 ALG 5 5 8 + \[ 8\] \.rela\.gnu\.linkonc RELA 0000000000000000 .* + 0000000000000048 0000000000000018 I 10 7 8 +- \[ 9\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ +- 0000000000000081 0000000000000000 0 0 1 +- \[10\] \.symtab SYMTAB 0000000000000000 .* +- 00000000000000d8 0000000000000018 11 9 8 +- \[11\] \.strtab STRTAB 0000000000000000 .* ++ \[ 9\] \.symtab SYMTAB 0000000000000000 .* ++ 00000000000000d8 0000000000000018 10 9 8 ++ \[10\] \.strtab STRTAB 0000000000000000 .* + 0000000000000005 0000000000000000 0 0 1 ++ \[11\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ ++ 0000000000000081 0000000000000000 0 0 1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/ia64/secname-ilp32.d b/gas/testsuite/gas/ia64/secname-ilp32.d +index 4146307..0b8a771 100644 +--- a/gas/testsuite/gas/ia64/secname-ilp32.d ++++ b/gas/testsuite/gas/ia64/secname-ilp32.d +@@ -12,8 +12,8 @@ Section Headers: + \[ 2\] .data PROGBITS 00000000 000040 000000 00 WA 0 0 1 + \[ 3\] .bss NOBITS 00000000 000040 000000 00 WA 0 0 1 + \[ 4\] .foo PROGBITS 00000000 000040 000008 00 WA 0 0 8 +- \[ 5\] .shstrtab STRTAB 00000000 [0-9a-f]+ 000031 00 0 0 1 +- \[ 6\] .symtab SYMTAB 00000000 [0-9a-f]+ 000050 10 7 5 4 +- \[ 7\] .strtab STRTAB 00000000 [0-9a-f]+ 000001 00 0 0 1 ++ \[ 5\] .symtab SYMTAB 00000000 [0-9a-f]+ 000050 10 6 5 4 ++ \[ 6\] .strtab STRTAB 00000000 [0-9a-f]+ 000001 00 0 0 1 ++ \[ 7\] .shstrtab STRTAB 00000000 [0-9a-f]+ 000031 00 0 0 1 + Key to Flags: + #... +diff --git a/gas/testsuite/gas/ia64/secname.d b/gas/testsuite/gas/ia64/secname.d +index 79f1e33..9d02e1a 100644 +--- a/gas/testsuite/gas/ia64/secname.d ++++ b/gas/testsuite/gas/ia64/secname.d +@@ -16,11 +16,11 @@ Section Headers: + 0000000000000000 0000000000000000 WA 0 0 1 + \[ 4\] \.foo PROGBITS 0000000000000000 00000040 + 0000000000000008 0000000000000000 WA 0 0 8 +- \[ 5\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ +- 0000000000000031 0000000000000000 0 0 1 +- \[ 6\] \.symtab SYMTAB 0000000000000000 .* +- 0000000000000078 0000000000000018 7 5 8 +- \[ 7\] \.strtab STRTAB 0000000000000000 .* ++ \[ 5\] \.symtab SYMTAB 0000000000000000 .* ++ 0000000000000078 0000000000000018 6 5 8 ++ \[ 6\] \.strtab STRTAB 0000000000000000 .* + 0000000000000001 0000000000000000 0 0 1 ++ \[ 7\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ ++ 0000000000000031 0000000000000000 0 0 1 + Key to Flags: + #... +diff --git a/gas/testsuite/gas/ia64/unwind-ilp32.d b/gas/testsuite/gas/ia64/unwind-ilp32.d +index cd25b0d..e96f89b 100644 +--- a/gas/testsuite/gas/ia64/unwind-ilp32.d ++++ b/gas/testsuite/gas/ia64/unwind-ilp32.d +@@ -13,8 +13,8 @@ Section Headers: + \[ 3\] .bss NOBITS 00000000 000040 000000 00 WA 0 0 1 + \[ 4\] .IA_64.unwind_inf PROGBITS 00000000 000040 000008 00 A 0 0 8 + \[ 5\] .IA_64.unwind IA_64_UNWIND 00000000 000048 000008 00 AL 1 1 8 +- \[ 6\] .shstrtab STRTAB 00000000 [0-9a-f]+ 00004d 00 0 0 1 +- \[ 7\] .symtab SYMTAB 00000000 [0-9a-f]+ 000060 10 8 6 4 +- \[ 8\] .strtab STRTAB 00000000 [0-9a-f]+ 000001 00 0 0 1 ++ \[ 6\] .symtab SYMTAB 00000000 [0-9a-f]+ 000060 10 7 6 4 ++ \[ 7\] .strtab STRTAB 00000000 [0-9a-f]+ 000001 00 0 0 1 ++ \[ 8\] .shstrtab STRTAB 00000000 [0-9a-f]+ 00004d 00 0 0 1 + Key to Flags: + #... +diff --git a/gas/testsuite/gas/ia64/unwind.d b/gas/testsuite/gas/ia64/unwind.d +index ce71a7a..bdb7af8 100644 +--- a/gas/testsuite/gas/ia64/unwind.d ++++ b/gas/testsuite/gas/ia64/unwind.d +@@ -18,11 +18,11 @@ Section Headers: + 0000000000000008 0000000000000000 A 0 0 8 + \[ 5\] \.IA_64\.unwind IA_64_UNWIND 0000000000000000 00000048 + 0000000000000008 0000000000000000 AL 1 1 8 +- \[ 6\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ +- 000000000000004d 0000000000000000 0 0 1 +- \[ 7\] \.symtab SYMTAB 0000000000000000 .* +- 0000000000000090 0000000000000018 8 6 8 +- \[ 8\] \.strtab STRTAB 0000000000000000 .* ++ \[ 6\] \.symtab SYMTAB 0000000000000000 .* ++ 0000000000000090 0000000000000018 7 6 8 ++ \[ 7\] \.strtab STRTAB 0000000000000000 .* + 0000000000000001 0000000000000000 0 0 1 ++ \[ 8\] \.shstrtab STRTAB 0000000000000000 [0-9a-f]+ ++ 000000000000004d 0000000000000000 0 0 1 + Key to Flags: + #... +diff --git a/gas/testsuite/gas/ia64/xdata-ilp32.d b/gas/testsuite/gas/ia64/xdata-ilp32.d +index 8c0bb30..e5dd507 100644 +--- a/gas/testsuite/gas/ia64/xdata-ilp32.d ++++ b/gas/testsuite/gas/ia64/xdata-ilp32.d +@@ -23,7 +23,7 @@ Section Headers: + \[13\] \.xreal\[4\] PROGBITS 00000000 [[:xdigit:]]+ 000020 00 A 0 0 16 + \[14\] \.xstr<1> PROGBITS 00000000 [[:xdigit:]]+ 000003 00 A 0 0 1 + \[15\] \.xstr\{2\} PROGBITS 00000000 [[:xdigit:]]+ 000004 00 A 0 0 1 +- \[16\] .shstrtab STRTAB 00000000 [[:xdigit:]]+ [[:xdigit:]]+ 00 0 0 1 +- \[17\] .symtab SYMTAB 00000000 [[:xdigit:]]+ [[:xdigit:]]+ 10 18 15 4 +- \[18\] .strtab STRTAB 00000000 [[:xdigit:]]+ [[:xdigit:]]+ 00 0 0 1 ++ \[16\] .symtab SYMTAB 00000000 [[:xdigit:]]+ [[:xdigit:]]+ 10 17 15 4 ++ \[17\] .strtab STRTAB 00000000 [[:xdigit:]]+ [[:xdigit:]]+ 00 0 0 1 ++ \[18\] .shstrtab STRTAB 00000000 [[:xdigit:]]+ [[:xdigit:]]+ 00 0 0 1 + #pass +diff --git a/gas/testsuite/gas/ia64/xdata.d b/gas/testsuite/gas/ia64/xdata.d +index dc23b78..eb12819 100644 +--- a/gas/testsuite/gas/ia64/xdata.d ++++ b/gas/testsuite/gas/ia64/xdata.d +@@ -38,10 +38,10 @@ Section Headers: + 0000000000000003 0000000000000000 A 0 0 1 + \[15\] \.xstr\{2\} PROGBITS 0000000000000000 [[:xdigit:]]+ + 0000000000000004 0000000000000000 A 0 0 1 +- \[16\] \.shstrtab STRTAB 0000000000000000 [[:xdigit:]]+ ++ \[16\] \.symtab SYMTAB 0000000000000000 [[:xdigit:]]+ ++ [[:xdigit:]]+ 0000000000000018 17 15 8 ++ \[17\] \.strtab STRTAB 0000000000000000 [[:xdigit:]]+ + [[:xdigit:]]+ 0000000000000000 0 0 1 +- \[17\] \.symtab SYMTAB 0000000000000000 [[:xdigit:]]+ +- [[:xdigit:]]+ 0000000000000018 18 15 8 +- \[18\] \.strtab STRTAB 0000000000000000 [[:xdigit:]]+ ++ \[18\] \.shstrtab STRTAB 0000000000000000 [[:xdigit:]]+ + [[:xdigit:]]+ 0000000000000000 0 0 1 + #pass +diff --git a/gas/testsuite/gas/mmix/bspec-1.d b/gas/testsuite/gas/mmix/bspec-1.d +index a18d242..4bbda8d 100644 +--- a/gas/testsuite/gas/mmix/bspec-1.d ++++ b/gas/testsuite/gas/mmix/bspec-1.d +@@ -4,7 +4,7 @@ There are 9 section headers, starting at offset .*: + +\[ 4\] \.MMIX\.spec_data\.2 +PROGBITS +0+ +0+44 + +0+4 +0+ +0 +0 +4 + +\[ 5\] \.rela\.MMIX\.spec_d +RELA +0+ +.* +- +0+18 +0+18 +I +7 +4 +8 ++ +0+18 +0+18 +I +6 +4 +8 + #... + Relocation section '\.rela\.MMIX\.spec_data\.2' at offset 0x[0-9a-f]+ contains 1 entries: + .* +diff --git a/gas/testsuite/gas/mmix/bspec-2.d b/gas/testsuite/gas/mmix/bspec-2.d +index a9ce03d..ab3afd3 100644 +--- a/gas/testsuite/gas/mmix/bspec-2.d ++++ b/gas/testsuite/gas/mmix/bspec-2.d +@@ -4,11 +4,11 @@ There are 11 section headers, starting at offset .*: + \[ 4\] \.MMIX\.spec_data\.2 PROGBITS 0+ 0+48 + 0+10 0+ 0 0 8 + \[ 5\] \.rela\.MMIX\.spec_d RELA 0+ .* +- +0+30 0+18 +I +9 +4 +8 ++ +0+30 0+18 +I +8 +4 +8 + \[ 6\] \.MMIX\.spec_data\.3 PROGBITS 0+ 0+58 + 0+8 0+ 0 0 8 + \[ 7\] \.rela\.MMIX\.spec_d RELA 0+ .* +- +0+18 +0+18 +I +9 +6 +8 ++ +0+18 +0+18 +I +8 +6 +8 + #... + Relocation section '\.rela\.MMIX\.spec_data\.2' at offset .* contains 2 entries: + .* +diff --git a/gas/testsuite/gas/mmix/byte-1.d b/gas/testsuite/gas/mmix/byte-1.d +index b6c2768..a77eb08 100644 +--- a/gas/testsuite/gas/mmix/byte-1.d ++++ b/gas/testsuite/gas/mmix/byte-1.d +@@ -12,12 +12,12 @@ Section Headers: + +0000000000000000 +0000000000000000 +WA +0 +0 +1 + +\[ 3\] \.bss +NOBITS +0000000000000000 +00000056 + +0000000000000000 +0000000000000000 +WA +0 +0 +1 +- +\[ 4\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ +- +000000000000002c +0000000000000000 +0 +0 +1 +- +\[ 5\] \.symtab +SYMTAB +0000000000000000 .* +- +00000000000000c0 +0000000000000018 +6 +7 +8 +- +\[ 6\] \.strtab +STRTAB +0000000000000000 .* ++ +\[ 4\] \.symtab +SYMTAB +0000000000000000 .* ++ +00000000000000c0 +0000000000000018 +5 +7 +8 ++ +\[ 5\] \.strtab +STRTAB +0000000000000000 .* + +0000000000000018 +0000000000000000 +0 +0 +1 ++ +\[ 6\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ ++ +000000000000002c +0000000000000000 +0 +0 +1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/mmix/loc-1.d b/gas/testsuite/gas/mmix/loc-1.d +index e45b1d5..e46247d 100644 +--- a/gas/testsuite/gas/mmix/loc-1.d ++++ b/gas/testsuite/gas/mmix/loc-1.d +@@ -13,12 +13,12 @@ Section Headers: + +0000000000000004 +0000000000000000 +WA +0 +0 +4 + +\[ 3\] \.bss +NOBITS +0000000000000000 +00000064 + +0000000000000000 +0000000000000000 +WA +0 +0 +1 +- +\[ 4\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ +- +000000000000002c +0000000000000000 +0 +0 +1 +- +\[ 5\] \.symtab +SYMTAB +0000000000000000 .* +- +00000000000000c0 +0000000000000018 +6 +6 +8 +- +\[ 6\] \.strtab +STRTAB +0000000000000000 .* ++ +\[ 4\] \.symtab +SYMTAB +0000000000000000 .* ++ +00000000000000c0 +0000000000000018 +5 +6 +8 ++ +\[ 5\] \.strtab +STRTAB +0000000000000000 .* + +000000000000002a +0000000000000000 +0 +0 +1 ++ +\[ 6\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ ++ +000000000000002c +0000000000000000 +0 +0 +1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/mmix/loc-2.d b/gas/testsuite/gas/mmix/loc-2.d +index b92cabb..8d7ec8b 100644 +--- a/gas/testsuite/gas/mmix/loc-2.d ++++ b/gas/testsuite/gas/mmix/loc-2.d +@@ -13,12 +13,12 @@ Section Headers: + +0000000000000000 +0000000000000000 +WA +0 +0 +1 + +\[ 3\] \.bss +NOBITS +0000000000000000 +00000048 + +0000000000000000 +0000000000000000 +WA +0 +0 +1 +- +\[ 4\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ +- +000000000000002c +0000000000000000 +0 +0 +1 +- +\[ 5\] \.symtab +SYMTAB +0000000000000000 .* +- +0000000000000090 +0000000000000018 +6 +4 +8 +- +\[ 6\] \.strtab +STRTAB +0000000000000000 .* ++ +\[ 4\] \.symtab +SYMTAB +0000000000000000 .* ++ +0000000000000090 +0000000000000018 +5 +4 +8 ++ +\[ 5\] \.strtab +STRTAB +0000000000000000 .* + +000000000000001a +0000000000000000 +0 +0 +1 ++ +\[ 6\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ ++ +000000000000002c +0000000000000000 +0 +0 +1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/mmix/loc-3.d b/gas/testsuite/gas/mmix/loc-3.d +index 2c477db..14a68fa 100644 +--- a/gas/testsuite/gas/mmix/loc-3.d ++++ b/gas/testsuite/gas/mmix/loc-3.d +@@ -12,12 +12,12 @@ Section Headers: + +0000000000000008 +0000000000000000 +WA +0 +0 +4 + +\[ 3\] \.bss +NOBITS +0000000000000000 +00000054 + +0000000000000000 +0000000000000000 +WA +0 +0 +1 +- +\[ 4\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ +- +000000000000002c +0000000000000000 +0 +0 +1 +- +\[ 5\] \.symtab +SYMTAB +0000000000000000 .* +- +00000000000000c0 +0000000000000018 +6 +5 +8 +- +\[ 6\] \.strtab +STRTAB +0000000000000000 .* ++ +\[ 4\] \.symtab +SYMTAB +0000000000000000 .* ++ +00000000000000c0 +0000000000000018 +5 +5 +8 ++ +\[ 5\] \.strtab +STRTAB +0000000000000000 .* + +000000000000002e +0000000000000000 +0 +0 +1 ++ +\[ 6\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ ++ +000000000000002c +0000000000000000 +0 +0 +1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/mmix/loc-4.d b/gas/testsuite/gas/mmix/loc-4.d +index 1efc084..935cc18 100644 +--- a/gas/testsuite/gas/mmix/loc-4.d ++++ b/gas/testsuite/gas/mmix/loc-4.d +@@ -12,12 +12,12 @@ Section Headers: + +0000000000000004 +0000000000000000 +WA +0 +0 +4 + +\[ 3\] \.bss +NOBITS +0000000000000000 +0000005c + +0000000000000000 +0000000000000000 +WA +0 +0 +1 +- +\[ 4\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ +- +000000000000002c +0000000000000000 +0 +0 +1 +- +\[ 5\] \.symtab +SYMTAB +0000000000000000 .* +- +00000000000000c0 +0000000000000018 +6 +5 +8 +- +\[ 6\] \.strtab +STRTAB +0000000000000000 .* ++ +\[ 4\] \.symtab +SYMTAB +0000000000000000 .* ++ +00000000000000c0 +0000000000000018 +5 +5 +8 ++ +\[ 5\] \.strtab +STRTAB +0000000000000000 .* + +000000000000003b +0000000000000000 +0 +0 +1 ++ +\[ 6\] \.shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ ++ +000000000000002c +0000000000000000 +0 +0 +1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/mmix/loc-5.d b/gas/testsuite/gas/mmix/loc-5.d +index fa80a86..a8e7545 100644 +--- a/gas/testsuite/gas/mmix/loc-5.d ++++ b/gas/testsuite/gas/mmix/loc-5.d +@@ -12,12 +12,12 @@ Section Headers: + +0+24 +0+ +WA +0 +0 +4 + +\[ 3\] \.bss +NOBITS +0+ +0+6c + +0+ +0+ +WA +0 +0 +1 +- +\[ 4\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +- +0+2c +0+ +0 +0 +1 +- +\[ 5\] \.symtab +SYMTAB +0+ .* +- +0+c0 +0+18 +6 +6 +8 +- +\[ 6\] \.strtab +STRTAB +0+ .* ++ +\[ 4\] \.symtab +SYMTAB +0+ .* ++ +0+c0 +0+18 +5 +6 +8 ++ +\[ 5\] \.strtab +STRTAB +0+ .* + +0+27 +0+ +0 +0 +1 ++ +\[ 6\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ ++ +0+2c +0+ +0 +0 +1 + Key to Flags: + #... + +diff --git a/gas/testsuite/gas/tic6x/scomm-directive-4.d b/gas/testsuite/gas/tic6x/scomm-directive-4.d +index 7822e8f..219673d 100644 +--- a/gas/testsuite/gas/tic6x/scomm-directive-4.d ++++ b/gas/testsuite/gas/tic6x/scomm-directive-4.d +@@ -12,9 +12,9 @@ Section Headers: + \[ 2\] \.data PROGBITS 00000000 000034 000000 00 WA 0 0 1 + \[ 3\] \.bss NOBITS 00000000 000034 000000 00 WA 0 0 1 + \[ 4\] \.c6xabi\.attribute C6000_ATTRIBUTE 00000000 000034 000013 00 0 0 1 +- \[ 5\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00003f 00 0 0 1 +- \[ 6\] \.symtab SYMTAB 00000000 [0-9a-f]+ 0000d0 10 7 5 4 +- \[ 7\] \.strtab STRTAB 00000000 [0-9a-f]+ 00001d 00 0 0 1 ++ \[ 5\] \.symtab SYMTAB 00000000 [0-9a-f]+ 0000d0 10 6 5 4 ++ \[ 6\] \.strtab STRTAB 00000000 [0-9a-f]+ 00001d 00 0 0 1 ++ \[ 7\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00003f 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-alpha/tlsbin.rd b/ld/testsuite/ld-alpha/tlsbin.rd +index 2184e5e..21fb11a 100644 +--- a/ld/testsuite/ld-alpha/tlsbin.rd ++++ b/ld/testsuite/ld-alpha/tlsbin.rd +@@ -24,9 +24,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +4 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + + Elf file type is EXEC \(Executable file\) +diff --git a/ld/testsuite/ld-alpha/tlsbinr.rd b/ld/testsuite/ld-alpha/tlsbinr.rd +index 0329ba9..8b7b76a 100644 +--- a/ld/testsuite/ld-alpha/tlsbinr.rd ++++ b/ld/testsuite/ld-alpha/tlsbinr.rd +@@ -24,9 +24,9 @@ Section Headers: + +\[[ 0-9]+\] \.tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +1 + +\[[ 0-9]+\] \.dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +4 +0 +8 + +\[[ 0-9]+\] \.got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +WA +0 +0 +8 +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + #... + + Elf file type is EXEC \(Executable file\) +diff --git a/ld/testsuite/ld-alpha/tlspic.rd b/ld/testsuite/ld-alpha/tlspic.rd +index 7a97847..f1fb974 100644 +--- a/ld/testsuite/ld-alpha/tlspic.rd ++++ b/ld/testsuite/ld-alpha/tlspic.rd +@@ -23,9 +23,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + + Elf file type is DYN \(Shared object file\) +diff --git a/ld/testsuite/ld-cris/libdso-2.d b/ld/testsuite/ld-cris/libdso-2.d +index 3b4777a..aa4a7c8 100644 +--- a/ld/testsuite/ld-cris/libdso-2.d ++++ b/ld/testsuite/ld-cris/libdso-2.d +@@ -21,9 +21,9 @@ There are 13 section headers.* + +\[ 7\] \.text +PROGBITS .* + +\[ 8\] \.dynamic +DYNAMIC +.* + +\[ 9\] \.got +PROGBITS .* +- +\[10\] \.shstrtab +STRTAB +.* +- +\[11\] \.symtab +SYMTAB +.* +- +\[12\] \.strtab +STRTAB +.* ++ +\[10\] \.symtab +SYMTAB +.* ++ +\[11\] \.strtab +STRTAB +.* ++ +\[12\] \.shstrtab +STRTAB +.* + #... + Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entries: + #... +diff --git a/ld/testsuite/ld-i386/nogot1.d b/ld/testsuite/ld-i386/nogot1.d +index a6c8832..018c24d 100644 +--- a/ld/testsuite/ld-i386/nogot1.d ++++ b/ld/testsuite/ld-i386/nogot1.d +@@ -4,5 +4,6 @@ + + #... + [ ]*\[.*\][ ]+\.dynamic[ ]+DYNAMIC.* ++#... + [ ]*\[.*\][ ]+.*STRTAB.* + #pass +diff --git a/ld/testsuite/ld-i386/pr12718.d b/ld/testsuite/ld-i386/pr12718.d +index 87905c3..ec51540 100644 +--- a/ld/testsuite/ld-i386/pr12718.d ++++ b/ld/testsuite/ld-i386/pr12718.d +@@ -9,8 +9,8 @@ Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES +Flg +Lk +Inf +Al + +\[ 0\] +NULL +0+ +0+ +0+ +0+ +0 +0 +0 + +\[ 1\] +.text +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +000006 00 +AX +0 +0 +1 +- +\[ 2\] +.shstrtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +0+ +0 +0 +1 +- +\[ 3\] +.symtab +SYMTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 10 +4 +[0-9] +4 +- +\[ 4\] +.strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 00 +0 +0 +1 ++ +\[ 2\] +.symtab +SYMTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 10 +3 +[0-9] +4 ++ +\[ 3\] +.strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 00 +0 +0 +1 ++ +\[ 4\] +.shstrtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +0+ +0 +0 +1 + Key to Flags: + #pass +diff --git a/ld/testsuite/ld-i386/pr12921.d b/ld/testsuite/ld-i386/pr12921.d +index c72b04c..e49079b 100644 +--- a/ld/testsuite/ld-i386/pr12921.d ++++ b/ld/testsuite/ld-i386/pr12921.d +@@ -11,8 +11,8 @@ Section Headers: + +\[ 1\] .text +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+1 00 +AX +0 +0 +4096 + +\[ 2\] .data +PROGBITS +[0-9a-f]+ +[0-9a-f]+000 +0+20 +00 +WA +0 +0 +4096 + +\[ 3\] .bss +NOBITS +[0-9a-f]+ +[0-9a-f]+020 +0+10000 +00 +WA +0 +0 +4096 +- +\[ 4\] .shstrtab +STRTAB +0+ +[0-9a-f]+ +0+2c +00 +0 +0 +1 +- +\[ 5\] .symtab +SYMTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +10 +6 +[0-9] +4 +- +\[ 6\] .strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +00 +0 +0 +1 ++ +\[ 4\] .symtab +SYMTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +10 +5 +[0-9] +4 ++ +\[ 5\] .strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +00 +0 +0 +1 ++ +\[ 6\] .shstrtab +STRTAB +0+ +[0-9a-f]+ +0+2c +00 +0 +0 +1 + Key to Flags: + #pass +diff --git a/ld/testsuite/ld-i386/tlsbin-nacl.rd b/ld/testsuite/ld-i386/tlsbin-nacl.rd +index 1e1cf7c..89a0673 100644 +--- a/ld/testsuite/ld-i386/tlsbin-nacl.rd ++++ b/ld/testsuite/ld-i386/tlsbin-nacl.rd +@@ -23,9 +23,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +0*10031060 .* + +\[[ 0-9]+\] \.got +PROGBITS +0*10031100 .* + +\[[ 0-9]+\] \.got\.plt +PROGBITS +0*10031124 .* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsbin.rd b/ld/testsuite/ld-i386/tlsbin.rd +index 12b3e81..23fffd1 100644 +--- a/ld/testsuite/ld-i386/tlsbin.rd ++++ b/ld/testsuite/ld-i386/tlsbin.rd +@@ -23,9 +23,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +0+804a060 .* + +\[[ 0-9]+\] \.got +PROGBITS +0+804a100 .* + +\[[ 0-9]+\] \.got\.plt +PROGBITS +0+804a124 .* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsbin2-nacl.rd b/ld/testsuite/ld-i386/tlsbin2-nacl.rd +index b23bfe0..0011716 100644 +--- a/ld/testsuite/ld-i386/tlsbin2-nacl.rd ++++ b/ld/testsuite/ld-i386/tlsbin2-nacl.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +0*10031060 .* + +\[[ 0-9]+\] \.got +PROGBITS +0*100310e0 .* + +\[[ 0-9]+\] \.got\.plt +PROGBITS +0*10031108 .* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsbin2.rd b/ld/testsuite/ld-i386/tlsbin2.rd +index 05d4ddb..e34d167 100644 +--- a/ld/testsuite/ld-i386/tlsbin2.rd ++++ b/ld/testsuite/ld-i386/tlsbin2.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +0+804a060 .* + +\[[ 0-9]+\] \.got +PROGBITS +0+804a0e0 .* + +\[[ 0-9]+\] \.got\.plt +PROGBITS +0+804a108 .* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsbindesc-nacl.rd b/ld/testsuite/ld-i386/tlsbindesc-nacl.rd +index 51cffc0..39c60a5 100644 +--- a/ld/testsuite/ld-i386/tlsbindesc-nacl.rd ++++ b/ld/testsuite/ld-i386/tlsbindesc-nacl.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +0*10031060 .* + +\[[ 0-9]+\] \.got +PROGBITS +0*100310e0 .* + +\[[ 0-9]+\] \.got\.plt +PROGBITS +0*10031104 .* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsbindesc.rd b/ld/testsuite/ld-i386/tlsbindesc.rd +index 7f7194c..7cc85f1 100644 +--- a/ld/testsuite/ld-i386/tlsbindesc.rd ++++ b/ld/testsuite/ld-i386/tlsbindesc.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +0+804a060 .* + +\[[ 0-9]+\] \.got +PROGBITS +0+804a0e0 .* + +\[[ 0-9]+\] \.got\.plt +PROGBITS +0+804a104 .* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsdesc-nacl.rd b/ld/testsuite/ld-i386/tlsdesc-nacl.rd +index b28744f..20c8ea2 100644 +--- a/ld/testsuite/ld-i386/tlsdesc-nacl.rd ++++ b/ld/testsuite/ld-i386/tlsdesc-nacl.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsdesc.rd b/ld/testsuite/ld-i386/tlsdesc.rd +index 68695ff..3486847 100644 +--- a/ld/testsuite/ld-i386/tlsdesc.rd ++++ b/ld/testsuite/ld-i386/tlsdesc.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsgdesc-nacl.rd b/ld/testsuite/ld-i386/tlsgdesc-nacl.rd +index ba5fa62..407bf2c 100644 +--- a/ld/testsuite/ld-i386/tlsgdesc-nacl.rd ++++ b/ld/testsuite/ld-i386/tlsgdesc-nacl.rd +@@ -19,9 +19,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsgdesc.rd b/ld/testsuite/ld-i386/tlsgdesc.rd +index 929ffa2..269cede 100644 +--- a/ld/testsuite/ld-i386/tlsgdesc.rd ++++ b/ld/testsuite/ld-i386/tlsgdesc.rd +@@ -19,9 +19,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsnopic-nacl.rd b/ld/testsuite/ld-i386/tlsnopic-nacl.rd +index b14164a..15e7eea 100644 +--- a/ld/testsuite/ld-i386/tlsnopic-nacl.rd ++++ b/ld/testsuite/ld-i386/tlsnopic-nacl.rd +@@ -19,9 +19,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +0*10010284 .* + +\[[ 0-9]+\] \.got +PROGBITS +0*10010304 .* + +\[[ 0-9]+\] \.got.plt +PROGBITS +0*1001031c .* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlsnopic.rd b/ld/testsuite/ld-i386/tlsnopic.rd +index b754158..b60fb1d 100644 +--- a/ld/testsuite/ld-i386/tlsnopic.rd ++++ b/ld/testsuite/ld-i386/tlsnopic.rd +@@ -19,9 +19,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +0+20f4 .* + +\[[ 0-9]+\] \.got +PROGBITS +0+2174 .* + +\[[ 0-9]+\] \.got.plt +PROGBITS +0+218c .* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlspic-nacl.rd b/ld/testsuite/ld-i386/tlspic-nacl.rd +index b7d3e35..9645e35 100644 +--- a/ld/testsuite/ld-i386/tlspic-nacl.rd ++++ b/ld/testsuite/ld-i386/tlspic-nacl.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlspic.rd b/ld/testsuite/ld-i386/tlspic.rd +index f693760..6b915e5 100644 +--- a/ld/testsuite/ld-i386/tlspic.rd ++++ b/ld/testsuite/ld-i386/tlspic.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlspic2-nacl.rd b/ld/testsuite/ld-i386/tlspic2-nacl.rd +index 560e840..5fb6ba6 100644 +--- a/ld/testsuite/ld-i386/tlspic2-nacl.rd ++++ b/ld/testsuite/ld-i386/tlspic2-nacl.rd +@@ -20,9 +20,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-i386/tlspic2.rd b/ld/testsuite/ld-i386/tlspic2.rd +index a135547..ab00063 100644 +--- a/ld/testsuite/ld-i386/tlspic2.rd ++++ b/ld/testsuite/ld-i386/tlspic2.rd +@@ -20,9 +20,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-ia64/tlsbin.rd b/ld/testsuite/ld-ia64/tlsbin.rd +index ab2dacd..08c6a59 100644 +--- a/ld/testsuite/ld-ia64/tlsbin.rd ++++ b/ld/testsuite/ld-ia64/tlsbin.rd +@@ -25,9 +25,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +60+1[0-9a-f]+ 0+1[0-9a-f]+ 0+150 10 +WA +4 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +60+1318 0+1318 0+48 00 WAp +0 +0 +8 + +\[[ 0-9]+\] .IA_64.pltoff +.* +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + + Elf file type is EXEC \(Executable file\) +diff --git a/ld/testsuite/ld-ia64/tlspic.rd b/ld/testsuite/ld-ia64/tlspic.rd +index 9666f86..cfcf8ed 100644 +--- a/ld/testsuite/ld-ia64/tlspic.rd ++++ b/ld/testsuite/ld-ia64/tlspic.rd +@@ -24,9 +24,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+11[0-9a-f]+ 0+1[0-9a-f]+ 0+140 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+112d8 0+12d8 0+50 00 WAp +0 +0 +8 + +\[[ 0-9]+\] .IA_64.pltoff +.* +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-10.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-10.d +index e3a1c9c..8827e41 100644 +--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-10.d ++++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-10.d +@@ -22,7 +22,7 @@ ELF Header: + Number of program headers: 0 + Size of section headers: 40 \(bytes\) + Number of section headers: 11 +- Section header string table index: 8 ++ Section header string table index: 10 + + Attribute Section: gnu + File Attributes +diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-50.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-50.d +index 5dc46d3..1fcab63 100644 +--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-50.d ++++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-50.d +@@ -22,7 +22,7 @@ ELF Header: + Number of program headers: 0 + Size of section headers: 40 \(bytes\) + Number of section headers: 11 +- Section header string table index: 8 ++ Section header string table index: 10 + Attribute Section: gnu + File Attributes + Tag_GNU_MIPS_ABI_FP: Hard float \(32-bit CPU, Any FPU\) +diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-60.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-60.d +index ea80c18..48a9839 100644 +--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-60.d ++++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-60.d +@@ -22,7 +22,7 @@ ELF Header: + Number of program headers: 0 + Size of section headers: 40 \(bytes\) + Number of section headers: 11 +- Section header string table index: 8 ++ Section header string table index: 10 + Attribute Section: gnu + File Attributes + Tag_GNU_MIPS_ABI_FP: Hard float \(32-bit CPU, 64-bit FPU\) +diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-70.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-70.d +index edbd61f..ca17421 100644 +--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-70.d ++++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-70.d +@@ -22,7 +22,7 @@ ELF Header: + Number of program headers: 0 + Size of section headers: 40 \(bytes\) + Number of section headers: 11 +- Section header string table index: 8 ++ Section header string table index: 10 + Attribute Section: gnu + File Attributes + Tag_GNU_MIPS_ABI_FP: Hard float compat \(32-bit CPU, 64-bit FPU\) +diff --git a/ld/testsuite/ld-mmix/bspec1.d b/ld/testsuite/ld-mmix/bspec1.d +index 6440bbe..3d07d2d 100644 +--- a/ld/testsuite/ld-mmix/bspec1.d ++++ b/ld/testsuite/ld-mmix/bspec1.d +@@ -14,12 +14,12 @@ Section Headers: + +0+4 +0+ +AX +0 +0 +4 + +\[ 2\] \.MMIX\.spec_data\.2 PROGBITS +0+ +0+7c + +0+4 +0+ +0 +0 +4 +- +\[ 3\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +- +0+33 +0+ +0 +0 +1 +- +\[ 4\] \.symtab +SYMTAB +0+ .* +- +0+d8 +0+18 +5 +3 +8 +- +\[ 5\] \.strtab +STRTAB +0+ .* ++ +\[ 3\] \.symtab +SYMTAB +0+ .* ++ +0+d8 +0+18 +4 +3 +8 ++ +\[ 4\] \.strtab +STRTAB +0+ .* + +0+26 +0+ +0 +0 +1 ++ +\[ 5\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ ++ +0+33 +0+ +0 +0 +1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-mmix/bspec2.d b/ld/testsuite/ld-mmix/bspec2.d +index e881b08..b18fe47 100644 +--- a/ld/testsuite/ld-mmix/bspec2.d ++++ b/ld/testsuite/ld-mmix/bspec2.d +@@ -19,12 +19,12 @@ Section Headers: + +0+8 +0+ +0 +0 +4 + +\[ 3\] \.MMIX\.spec_data\.3 PROGBITS +0+ +0+84 + +0+4 +0+ +0 +0 +4 +- +\[ 4\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +- +0+45 +0+ +0 +0 +1 +- +\[ 5\] \.symtab +SYMTAB +0+ .* +- +0+108 +0+18 +6 +4 +8 +- +\[ 6\] \.strtab +STRTAB +0+ .* ++ +\[ 4\] \.symtab +SYMTAB +0+ .* ++ +0+108 +0+18 +5 +4 +8 ++ +\[ 5\] \.strtab +STRTAB +0+ .* + +0+2b +0+ +0 +0 +1 ++ +\[ 6\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ ++ +0+45 +0+ +0 +0 +1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-mmix/local1.d b/ld/testsuite/ld-mmix/local1.d +index 478d17b..41a67c2 100644 +--- a/ld/testsuite/ld-mmix/local1.d ++++ b/ld/testsuite/ld-mmix/local1.d +@@ -21,12 +21,12 @@ Section Headers: + +0+8 +0+ +AX +0 +0 +4 + +\[ 2\] \.MMIX\.reg_content PROGBITS +0+7e8 +0+80 + +0+10 +0+ +W +0 +0 +1 +- +\[ 3\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +- +0+34 +0+ +0 +0 +1 +- +\[ 4\] \.symtab +SYMTAB +0+ +[0-9a-f]+ +- +[0-9a-f]+ +0+18 +5 +[0-9] +8 +- +\[ 5\] \.strtab +STRTAB +0+ +[0-9a-f]+ ++ +\[ 3\] \.symtab +SYMTAB +0+ +[0-9a-f]+ ++ +[0-9a-f]+ +0+18 +4 +[0-9] +8 ++ +\[ 4\] \.strtab +STRTAB +0+ +[0-9a-f]+ + +[0-9a-f]+ +0+ +0 +0 +1 ++ +\[ 5\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ ++ +0+34 +0+ +0 +0 +1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-mmix/local3.d b/ld/testsuite/ld-mmix/local3.d +index 9b9001a..74840d3 100644 +--- a/ld/testsuite/ld-mmix/local3.d ++++ b/ld/testsuite/ld-mmix/local3.d +@@ -19,12 +19,12 @@ Section Headers: + +0+8 +0+ +AX +0 +0 +4 + +\[ 2\] \.MMIX\.reg_content PROGBITS +0+7e8 +0+80 + +0+10 +0+ +W +0 +0 +1 +- +\[ 3\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +- +0+34 +0+ +0 +0 +1 +- +\[ 4\] \.symtab +SYMTAB +0+ +[0-9a-f]+ +- +[0-9a-f]+ +0+18 +5 +[0-9] +8 +- +\[ 5\] \.strtab +STRTAB +0+ +[0-9a-f]+ ++ +\[ 3\] \.symtab +SYMTAB +0+ +[0-9a-f]+ ++ +[0-9a-f]+ +0+18 +4 +[0-9] +8 ++ +\[ 4\] \.strtab +STRTAB +0+ +[0-9a-f]+ + +[0-9a-f]+ +0+ +0 +0 +1 ++ +\[ 5\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ ++ +0+34 +0+ +0 +0 +1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-mmix/local5.d b/ld/testsuite/ld-mmix/local5.d +index 93bacd3..ae81364 100644 +--- a/ld/testsuite/ld-mmix/local5.d ++++ b/ld/testsuite/ld-mmix/local5.d +@@ -20,12 +20,12 @@ Section Headers: + +0+c +0+ +AX +0 +0 +4 + +\[ 2\] \.MMIX\.reg_content PROGBITS +0+7e8 +0+84 + +0+10 +0+ +W +0 +0 +1 +- +\[ 3\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +- +0+34 +0+ +0 +0 +1 +- +\[ 4\] \.symtab +SYMTAB +0+ +[0-9a-f]+ +- +[0-9a-f]+ +0+18 +5 +[0-9] +8 +- +\[ 5\] \.strtab +STRTAB +0+ +[0-9a-f]+ ++ +\[ 3\] \.symtab +SYMTAB +0+ +[0-9a-f]+ ++ +[0-9a-f]+ +0+18 +4 +[0-9] +8 ++ +\[ 4\] \.strtab +STRTAB +0+ +[0-9a-f]+ + +[0-9a-f]+ +0+ +0 +0 +1 ++ +\[ 5\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ ++ +0+34 +0+ +0 +0 +1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-mmix/local7.d b/ld/testsuite/ld-mmix/local7.d +index 1495bf1..6d80cc9 100644 +--- a/ld/testsuite/ld-mmix/local7.d ++++ b/ld/testsuite/ld-mmix/local7.d +@@ -21,12 +21,12 @@ Section Headers: + +0+c +0+ +AX +0 +0 +4 + +\[ 2\] \.MMIX\.reg_content PROGBITS +0+7e8 +0+84 + +0+10 +0+ +W +0 +0 +1 +- +\[ 3\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +- +0+34 +0+ +0 +0 +1 +- +\[ 4\] \.symtab +SYMTAB +0+ +[0-9a-f]+ +- +[0-9a-f]+ +0+18 +5 +[0-9] +8 +- +\[ 5\] \.strtab +STRTAB +0+ +[0-9a-f]+ ++ +\[ 3\] \.symtab +SYMTAB +0+ +[0-9a-f]+ ++ +[0-9a-f]+ +0+18 +4 +[0-9] +8 ++ +\[ 4\] \.strtab +STRTAB +0+ +[0-9a-f]+ + +[0-9a-f]+ +0+ +0 +0 +1 ++ +\[ 5\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ ++ +0+34 +0+ +0 +0 +1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-mmix/undef-3.d b/ld/testsuite/ld-mmix/undef-3.d +index 94eeeaa..6afb52b 100644 +--- a/ld/testsuite/ld-mmix/undef-3.d ++++ b/ld/testsuite/ld-mmix/undef-3.d +@@ -11,11 +11,11 @@ Section Headers: + +0+ +0+ +0 +0 +0 + +\[ 1\] \.text +PROGBITS +0+ +0+78 + +0+4 +0+ +AX +0 +0 +4 +- +\[ 2\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ ++ +\[ 2\] \.symtab +SYMTAB +0+ .* ++ +0+a8 +0+18 +3 +2 +8 ++ +\[ 3\] \.strtab +STRTAB +0+ .* + +0+21 +0+ +0 +0 +1 +- +\[ 3\] \.symtab +SYMTAB +0+ .* +- +0+a8 +0+18 +4 +2 +8 +- +\[ 4\] \.strtab +STRTAB +0+ .* ++ +\[ 4\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ + +0+21 +0+ +0 +0 +1 + Key to Flags: + #... +diff --git a/ld/testsuite/ld-powerpc/tlsexe.r b/ld/testsuite/ld-powerpc/tlsexe.r +index db72ad7..11da4a8 100644 +--- a/ld/testsuite/ld-powerpc/tlsexe.r ++++ b/ld/testsuite/ld-powerpc/tlsexe.r +@@ -23,9 +23,9 @@ Section Headers: + +\[[ 0-9]+\] \.opd .* + +\[[ 0-9]+\] \.got +PROGBITS .* 0+30 08 +WA +0 +0 +256 + +\[[ 0-9]+\] \.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + #... + + Elf file type is EXEC \(Executable file\) +diff --git a/ld/testsuite/ld-powerpc/tlsexe32.r b/ld/testsuite/ld-powerpc/tlsexe32.r +index a3304ec..baa3ee6 100644 +--- a/ld/testsuite/ld-powerpc/tlsexe32.r ++++ b/ld/testsuite/ld-powerpc/tlsexe32.r +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 08 +WA +4 +0 +4 + +\[[ 0-9]+\] \.got +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000018 04 +WA +0 +0 +4 + +\[[ 0-9]+\] \.plt +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000004 00 +WA +0 +0 +4 +- +\[[ 0-9]+\] \.shstrtab +STRTAB +.* + +\[[ 0-9]+\] \.symtab +SYMTAB +.* + +\[[ 0-9]+\] \.strtab +STRTAB +.* ++ +\[[ 0-9]+\] \.shstrtab +STRTAB +.* + #... + + Elf file type is EXEC \(Executable file\) +diff --git a/ld/testsuite/ld-powerpc/tlsexetoc.r b/ld/testsuite/ld-powerpc/tlsexetoc.r +index 56716bb..5c4a490 100644 +--- a/ld/testsuite/ld-powerpc/tlsexetoc.r ++++ b/ld/testsuite/ld-powerpc/tlsexetoc.r +@@ -23,9 +23,9 @@ Section Headers: + +\[[ 0-9]+\] \.opd .* + +\[[ 0-9]+\] \.got +PROGBITS .* 0+58 08 +WA +0 +0 +256 + +\[[ 0-9]+\] \.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + #... + + Elf file type is EXEC \(Executable file\) +diff --git a/ld/testsuite/ld-powerpc/tlsso.r b/ld/testsuite/ld-powerpc/tlsso.r +index fd3002b..4ba6173 100644 +--- a/ld/testsuite/ld-powerpc/tlsso.r ++++ b/ld/testsuite/ld-powerpc/tlsso.r +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] \.opd .* + +\[[ 0-9]+\] \.got .* + +\[[ 0-9]+\] \.plt .* +- +\[[ 0-9]+\] \.shstrtab .* + +\[[ 0-9]+\] \.symtab .* + +\[[ 0-9]+\] \.strtab .* ++ +\[[ 0-9]+\] \.shstrtab .* + #... + + Elf file type is DYN \(Shared object file\) +diff --git a/ld/testsuite/ld-powerpc/tlsso32.r b/ld/testsuite/ld-powerpc/tlsso32.r +index 4d12c48..bc3b7c0 100644 +--- a/ld/testsuite/ld-powerpc/tlsso32.r ++++ b/ld/testsuite/ld-powerpc/tlsso32.r +@@ -20,9 +20,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC .* 08 +WA +3 +0 +4 + +\[[ 0-9]+\] \.got +PROGBITS .* 0+30 04 +WA +0 +0 +4 + +\[[ 0-9]+\] \.plt +PROGBITS .* 0+4 00 +WA +0 +0 +4 +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + #... + + Elf file type is DYN \(Shared object file\) +diff --git a/ld/testsuite/ld-powerpc/tlstocso.r b/ld/testsuite/ld-powerpc/tlstocso.r +index 765bf08..bf7cf84 100644 +--- a/ld/testsuite/ld-powerpc/tlstocso.r ++++ b/ld/testsuite/ld-powerpc/tlstocso.r +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] \.opd .* + +\[[ 0-9]+\] \.got .* + +\[[ 0-9]+\] \.plt .* +- +\[[ 0-9]+\] \.shstrtab .* + +\[[ 0-9]+\] \.symtab .* + +\[[ 0-9]+\] \.strtab .* ++ +\[[ 0-9]+\] \.shstrtab .* + #... + + Elf file type is DYN \(Shared object file\) +diff --git a/ld/testsuite/ld-s390/tlsbin.rd b/ld/testsuite/ld-s390/tlsbin.rd +index 32c883a..b45fc29 100644 +--- a/ld/testsuite/ld-s390/tlsbin.rd ++++ b/ld/testsuite/ld-s390/tlsbin.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS .* 0+40 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC .* + +\[[ 0-9]+\] .got +PROGBITS .* +- +\[[ 0-9]+\] .shstrtab .* + +\[[ 0-9]+\] .symtab .* + +\[[ 0-9]+\] .strtab .* ++ +\[[ 0-9]+\] .shstrtab .* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-s390/tlsbin_64.rd b/ld/testsuite/ld-s390/tlsbin_64.rd +index 38d5789..f7caa16 100644 +--- a/ld/testsuite/ld-s390/tlsbin_64.rd ++++ b/ld/testsuite/ld-s390/tlsbin_64.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS .* 0+40 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC .* + +\[[ 0-9]+\] .got +PROGBITS .* +- +\[[ 0-9]+\] .shstrtab .* + +\[[ 0-9]+\] .symtab .* + +\[[ 0-9]+\] .strtab .* ++ +\[[ 0-9]+\] .shstrtab .* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-s390/tlspic.rd b/ld/testsuite/ld-s390/tlspic.rd +index 07d29c2..5159863 100644 +--- a/ld/testsuite/ld-s390/tlspic.rd ++++ b/ld/testsuite/ld-s390/tlspic.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS .* 0+20 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC .* + +\[[ 0-9]+\] .got +PROGBITS .* +- +\[[ 0-9]+\] .shstrtab .* + +\[[ 0-9]+\] .symtab .* + +\[[ 0-9]+\] .strtab .* ++ +\[[ 0-9]+\] .shstrtab .* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-s390/tlspic_64.rd b/ld/testsuite/ld-s390/tlspic_64.rd +index 6197f8a..7f8dc1b 100644 +--- a/ld/testsuite/ld-s390/tlspic_64.rd ++++ b/ld/testsuite/ld-s390/tlspic_64.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS .* 0+20 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC .* + +\[[ 0-9]+\] .got +PROGBITS .* +- +\[[ 0-9]+\] .shstrtab .* + +\[[ 0-9]+\] .symtab .* + +\[[ 0-9]+\] .strtab .* ++ +\[[ 0-9]+\] .shstrtab .* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sh/sh64/crange1.rd b/ld/testsuite/ld-sh/sh64/crange1.rd +index e22d502..83c1e9b 100644 +--- a/ld/testsuite/ld-sh/sh64/crange1.rd ++++ b/ld/testsuite/ld-sh/sh64/crange1.rd +@@ -7,9 +7,9 @@ Section Headers: + +\[ 2\] \.text +PROGBITS +00001004 000084 000018 00 AXp +0 +0 +4 + +\[ 3\] \.stack +PROGBITS +00080000 000100 000004 00 +WA +0 +0 +1 + +\[ 4\] \.cranges +LOUSER\+1 +00000000 000104 00001e 00 +W +0 +0 +1 +- +\[ 5\] \.shstrtab +STRTAB +.* +- +\[ 6\] \.symtab +SYMTAB +.* +- +\[ 7\] \.strtab +STRTAB +.* ++ +\[ 5\] \.symtab +SYMTAB +.* ++ +\[ 6\] \.strtab +STRTAB +.* ++ +\[ 7\] \.shstrtab +STRTAB +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sh/sh64/crange2.rd b/ld/testsuite/ld-sh/sh64/crange2.rd +index 5074087..e7416e1 100644 +--- a/ld/testsuite/ld-sh/sh64/crange2.rd ++++ b/ld/testsuite/ld-sh/sh64/crange2.rd +@@ -7,9 +7,9 @@ Section Headers: + +\[ 2\] \.text +PROGBITS +00001004 000084 00005c 00 AXp +0 +0 +4 + +\[ 3\] \.stack +PROGBITS +00080000 000100 000004 00 +WA +0 +0 +1 + +\[ 4\] \.cranges +LOUSER\+1 +00000000 000104 000046 00 +W +0 +0 +1 +- +\[ 5\] \.shstrtab +STRTAB +.* +- +\[ 6\] \.symtab +SYMTAB +.* +- +\[ 7\] \.strtab +STRTAB +.* ++ +\[ 5\] \.symtab +SYMTAB +.* ++ +\[ 6\] \.strtab +STRTAB +.* ++ +\[ 7\] \.shstrtab +STRTAB +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sh/sh64/crange3-cmpct.rd b/ld/testsuite/ld-sh/sh64/crange3-cmpct.rd +index d4f090e..9f5f595 100644 +--- a/ld/testsuite/ld-sh/sh64/crange3-cmpct.rd ++++ b/ld/testsuite/ld-sh/sh64/crange3-cmpct.rd +@@ -17,7 +17,7 @@ ELF Header: + +Number of program headers: +2 + +Size of section headers: +40 \(bytes\) + +Number of section headers: +8 +- +Section header string table index: 5 ++ +Section header string table index: 7 + + Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al +@@ -26,9 +26,9 @@ Section Headers: + +\[ 2\] \.text +PROGBITS +00001004 000084 0000d8 00 AXp +0 +0 +4 + +\[ 3\] \.stack +PROGBITS +00080000 000180 000004 00 +WA +0 +0 +1 + +\[ 4\] \.cranges +LOUSER\+1 +00000000 000184 00003c 00 +W +0 +0 +1 +- +\[ 5\] \.shstrtab +STRTAB +.* +- +\[ 6\] \.symtab +SYMTAB +.* +- +\[ 7\] \.strtab +STRTAB +.* ++ +\[ 5\] \.symtab +SYMTAB +.* ++ +\[ 6\] \.strtab +STRTAB +.* ++ +\[ 7\] \.shstrtab +STRTAB +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sh/sh64/crange3-media.rd b/ld/testsuite/ld-sh/sh64/crange3-media.rd +index 5a856d4..926925c 100644 +--- a/ld/testsuite/ld-sh/sh64/crange3-media.rd ++++ b/ld/testsuite/ld-sh/sh64/crange3-media.rd +@@ -17,7 +17,7 @@ ELF Header: + +Number of program headers: +2 + +Size of section headers: +40 \(bytes\) + +Number of section headers: +8 +- +Section header string table index: 5 ++ +Section header string table index: 7 + + Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al +@@ -26,9 +26,9 @@ Section Headers: + +\[ 2\] \.text +PROGBITS +00001004 000084 0000d8 00 AXp +0 +0 +4 + +\[ 3\] \.stack +PROGBITS +00080000 000180 000004 00 +WA +0 +0 +1 + +\[ 4\] \.cranges +LOUSER\+1 +00000000 000184 00003c 00 +W +0 +0 +1 +- +\[ 5\] \.shstrtab +STRTAB +.* +- +\[ 6\] \.symtab +SYMTAB +.* +- +\[ 7\] \.strtab +STRTAB +.* ++ +\[ 5\] \.symtab +SYMTAB +.* ++ +\[ 6\] \.strtab +STRTAB +.* ++ +\[ 7\] \.shstrtab +STRTAB +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sh/sh64/crange3.rd b/ld/testsuite/ld-sh/sh64/crange3.rd +index b495861..8870e0b 100644 +--- a/ld/testsuite/ld-sh/sh64/crange3.rd ++++ b/ld/testsuite/ld-sh/sh64/crange3.rd +@@ -7,9 +7,9 @@ Section Headers: + +\[ 2\] \.text +PROGBITS +00001004 000084 0000d8 00 AXp +0 +0 +4 + +\[ 3\] \.stack +PROGBITS +00080000 000180 000004 00 +WA +0 +0 +1 + +\[ 4\] \.cranges +LOUSER\+1 +00000000 000184 00003c 00 +W +0 +0 +1 +- +\[ 5\] \.shstrtab +STRTAB +.* +- +\[ 6\] \.symtab +SYMTAB +.* +- +\[ 7\] \.strtab +STRTAB +.* ++ +\[ 5\] \.symtab +SYMTAB +.* ++ +\[ 6\] \.strtab +STRTAB +.* ++ +\[ 7\] \.shstrtab +STRTAB +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sh/sh64/crangerel1.rd b/ld/testsuite/ld-sh/sh64/crangerel1.rd +index 90d71c5..3443f2a 100644 +--- a/ld/testsuite/ld-sh/sh64/crangerel1.rd ++++ b/ld/testsuite/ld-sh/sh64/crangerel1.rd +@@ -10,9 +10,9 @@ Section Headers: + +\[ 5\] \.stack +PROGBITS +00000000 00004c 000004 00 +WA +0 +0 +1 + +\[ 6\] \.cranges +PROGBITS +00000000 000050 00001e 00 +W +0 +0 +1 + +\[ 7\] \.rela\.cranges +RELA +00000000 [0-9a-f]+ 000024 0c +I +9 +6 +4 +- +\[ 8\] \.shstrtab +STRTAB +00000000 [0-9a-f]+ 00004d 00 +0 +0 +1 +- +\[ 9\] \.symtab +SYMTAB .* +- +\[10\] \.strtab +STRTAB .* ++ +\[ 8\] \.symtab +SYMTAB .* ++ +\[ 9\] \.strtab +STRTAB .* ++ +\[10\] \.shstrtab +STRTAB +00000000 [0-9a-f]+ 00004d 00 +0 +0 +1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sh/sh64/crangerel2.rd b/ld/testsuite/ld-sh/sh64/crangerel2.rd +index 2daede7..a1674b5 100644 +--- a/ld/testsuite/ld-sh/sh64/crangerel2.rd ++++ b/ld/testsuite/ld-sh/sh64/crangerel2.rd +@@ -10,9 +10,9 @@ Section Headers: + +\[ 5\] \.stack +PROGBITS +00000000 000090 000004 00 +WA +0 +0 +1 + +\[ 6\] \.cranges +PROGBITS +00000000 000094 000046 00 +W +0 +0 +1 + +\[ 7\] \.rela\.cranges +RELA +00000000 [0-9a-f]+ 000054 0c +I +9 +6 +4 +- +\[ 8\] \.shstrtab +STRTAB +00000000 [0-9a-f]+ 00004d 00 +0 +0 +1 +- +\[ 9\] \.symtab +SYMTAB +00000000 [0-9a-f]+ [0-9a-f]+ 10 +10 +[0-9]+ +4 +- +\[10\] \.strtab +STRTAB +00000000 [0-9a-f]+ [0-9a-f]+ 00 +0 +0 +1 ++ +\[ 8\] \.symtab +SYMTAB +00000000 [0-9a-f]+ [0-9a-f]+ 10 +8 +[0-9]+ +4 ++ +\[ 9\] \.strtab +STRTAB +00000000 [0-9a-f]+ [0-9a-f]+ 00 +0 +0 +1 ++ +\[10\] \.shstrtab +STRTAB +00000000 [0-9a-f]+ 00004d 00 +0 +0 +1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sh/tlsbin-2.d b/ld/testsuite/ld-sh/tlsbin-2.d +index 167270f..6958e45 100644 +--- a/ld/testsuite/ld-sh/tlsbin-2.d ++++ b/ld/testsuite/ld-sh/tlsbin-2.d +@@ -23,9 +23,9 @@ Section Headers: + #... + +\[[0-9a-f]+\] \.got +PROGBITS .* + #... +- +\[[0-9a-f]+\] \.shstrtab .* + +\[[0-9a-f]+\] \.symtab .* + +\[[0-9a-f]+\] \.strtab .* ++ +\[[0-9a-f]+\] \.shstrtab .* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sh/tlspic-2.d b/ld/testsuite/ld-sh/tlspic-2.d +index 0b47878..42baf1d 100644 +--- a/ld/testsuite/ld-sh/tlspic-2.d ++++ b/ld/testsuite/ld-sh/tlspic-2.d +@@ -22,9 +22,9 @@ Section Headers: + #... + +\[[0-9a-f]+\] \.got +PROGBITS .* + #... +- +\[[0-9a-f]+\] \.shstrtab .* + +\[[0-9a-f]+\] \.symtab .* + +\[[0-9a-f]+\] \.strtab .* ++ +\[[0-9a-f]+\] \.shstrtab .* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-sparc/gotop32.rd b/ld/testsuite/ld-sparc/gotop32.rd +index 3b5b942..1813719 100644 +--- a/ld/testsuite/ld-sparc/gotop32.rd ++++ b/ld/testsuite/ld-sparc/gotop32.rd +@@ -17,9 +17,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+12000 0+2000 0+70 08 +WA +3 +0 +4 + +\[[ 0-9]+\] .got +PROGBITS +0+12070 0+2070 0+8 04 +WA +0 +0 +4 + +\[[ 0-9]+\] .data +PROGBITS +0+13000 0+3000 0+8 00 +WA +0 +0 4096 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + + Elf file type is DYN \(Shared object file\) +diff --git a/ld/testsuite/ld-sparc/gotop64.rd b/ld/testsuite/ld-sparc/gotop64.rd +index 2d3ffec..578fb2b 100644 +--- a/ld/testsuite/ld-sparc/gotop64.rd ++++ b/ld/testsuite/ld-sparc/gotop64.rd +@@ -17,9 +17,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+102000 0+2000 0+e0 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+1020e0 0+20e0 0+10 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .data +PROGBITS +0+103000 0+3000 0+8 00 +WA +0 +0 4096 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + + Elf file type is DYN \(Shared object file\) +diff --git a/ld/testsuite/ld-sparc/tlssunbin32.rd b/ld/testsuite/ld-sparc/tlssunbin32.rd +index 7212732..3de615f 100644 +--- a/ld/testsuite/ld-sparc/tlssunbin32.rd ++++ b/ld/testsuite/ld-sparc/tlssunbin32.rd +@@ -19,9 +19,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS +0+231f4 0+31f4 0+40 00 WAT +0 +0 +4 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+231f4 0+31f4 0+80 08 +WA +4 +0 +4 + +\[[ 0-9]+\] .got +PROGBITS +0+23274 0+3274 0+14 04 +WA +0 +0 +4 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + + Elf file type is EXEC \(Executable file\) +diff --git a/ld/testsuite/ld-sparc/tlssunbin64.rd b/ld/testsuite/ld-sparc/tlssunbin64.rd +index 5480dab..2297d2e 100644 +--- a/ld/testsuite/ld-sparc/tlssunbin64.rd ++++ b/ld/testsuite/ld-sparc/tlssunbin64.rd +@@ -19,9 +19,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS +0+202204 0+2204 0+40 00 WAT +0 +0 +4 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+202208 0+2208 0+100 10 +WA +4 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+202308 0+2308 0+28 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + + Elf file type is EXEC \(Executable file\) +diff --git a/ld/testsuite/ld-sparc/tlssunnopic32.rd b/ld/testsuite/ld-sparc/tlssunnopic32.rd +index 21d07c0..bfb7cb8 100644 +--- a/ld/testsuite/ld-sparc/tlssunnopic32.rd ++++ b/ld/testsuite/ld-sparc/tlssunnopic32.rd +@@ -18,9 +18,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS +0+12000 0+2000 0+24 0+ WAT +0 +0 +4 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+12000 0+2000 0+80 08 +WA +3 +0 +4 + +\[[ 0-9]+\] .got +PROGBITS +0+12080 0+2080 0+1c 04 +WA +0 +0 +4 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + Elf file type is DYN \(Shared object file\) + Entry point 0x1000 +diff --git a/ld/testsuite/ld-sparc/tlssunnopic64.rd b/ld/testsuite/ld-sparc/tlssunnopic64.rd +index 6825aa9..88fe05f 100644 +--- a/ld/testsuite/ld-sparc/tlssunnopic64.rd ++++ b/ld/testsuite/ld-sparc/tlssunnopic64.rd +@@ -18,9 +18,9 @@ Section Headers: + +\[[ 0-9]+\] .tbss +NOBITS +0+102000 0+2000 0+24 0+ WAT +0 +0 +4 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+102000 0+2000 0+100 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+102100 0+2100 0+38 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + Elf file type is DYN \(Shared object file\) + Entry point 0x1000 +diff --git a/ld/testsuite/ld-sparc/tlssunpic32.rd b/ld/testsuite/ld-sparc/tlssunpic32.rd +index 4d96736..519b5df 100644 +--- a/ld/testsuite/ld-sparc/tlssunpic32.rd ++++ b/ld/testsuite/ld-sparc/tlssunpic32.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+12060 0+2060 0+98 08 +WA +3 +0 +4 + +\[[ 0-9]+\] .got +PROGBITS +0+120f8 0+20f8 0+4c 04 +WA +0 +0 +4 + +\[[ 0-9]+\] .plt +.* +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + + Elf file type is DYN \(Shared object file\) +diff --git a/ld/testsuite/ld-sparc/tlssunpic64.rd b/ld/testsuite/ld-sparc/tlssunpic64.rd +index 6f91fee..fa00bbf 100644 +--- a/ld/testsuite/ld-sparc/tlssunpic64.rd ++++ b/ld/testsuite/ld-sparc/tlssunpic64.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+102060 0+2060 0+130 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+102190 0+2190 0+98 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .plt +.* +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + #... + + Elf file type is DYN \(Shared object file\) +diff --git a/ld/testsuite/ld-tic6x/common.d b/ld/testsuite/ld-tic6x/common.d +index 30521fc..f2a7b1b 100644 +--- a/ld/testsuite/ld-tic6x/common.d ++++ b/ld/testsuite/ld-tic6x/common.d +@@ -11,9 +11,9 @@ Section Headers: + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] \.far NOBITS 00000080 000080 000008 00 WA 0 0 4 + \[ 2\] \.bss NOBITS 00000100 000080 000004 00 WA 0 0 4 +- \[ 3\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000025 00 0 0 1 +- \[ 4\] \.symtab SYMTAB 00000000 [0-9a-f]+ 000050 10 5 3 4 +- \[ 5\] \.strtab STRTAB 00000000 [0-9a-f]+ 000005 00 0 0 1 ++ \[ 3\] \.symtab SYMTAB 00000000 [0-9a-f]+ 000050 10 4 3 4 ++ \[ 4\] \.strtab STRTAB 00000000 [0-9a-f]+ 000005 00 0 0 1 ++ \[ 5\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000025 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/shlib-1.rd b/ld/testsuite/ld-tic6x/shlib-1.rd +index a07ddca..77ec3d7 100644 +--- a/ld/testsuite/ld-tic6x/shlib-1.rd ++++ b/ld/testsuite/ld-tic6x/shlib-1.rd +@@ -16,9 +16,9 @@ Section Headers: + \[11\] \.neardata PROGBITS 10000128 002128 000008 00 WA 0 0 4 + \[12\] \.bss NOBITS 10000130 002130 000004 00 WA 0 0 4 + \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00 0 0 1 +- \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 +- \[15\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 16 [0-9]+ 4 +- \[16\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 15 [0-9]+ 4 ++ \[15\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[16\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/shlib-1b.rd b/ld/testsuite/ld-tic6x/shlib-1b.rd +index a07ddca..77ec3d7 100644 +--- a/ld/testsuite/ld-tic6x/shlib-1b.rd ++++ b/ld/testsuite/ld-tic6x/shlib-1b.rd +@@ -16,9 +16,9 @@ Section Headers: + \[11\] \.neardata PROGBITS 10000128 002128 000008 00 WA 0 0 4 + \[12\] \.bss NOBITS 10000130 002130 000004 00 WA 0 0 4 + \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00 0 0 1 +- \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 +- \[15\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 16 [0-9]+ 4 +- \[16\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 15 [0-9]+ 4 ++ \[15\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[16\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/shlib-1r.rd b/ld/testsuite/ld-tic6x/shlib-1r.rd +index a07ddca..77ec3d7 100644 +--- a/ld/testsuite/ld-tic6x/shlib-1r.rd ++++ b/ld/testsuite/ld-tic6x/shlib-1r.rd +@@ -16,9 +16,9 @@ Section Headers: + \[11\] \.neardata PROGBITS 10000128 002128 000008 00 WA 0 0 4 + \[12\] \.bss NOBITS 10000130 002130 000004 00 WA 0 0 4 + \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00 0 0 1 +- \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 +- \[15\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 16 [0-9]+ 4 +- \[16\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 15 [0-9]+ 4 ++ \[15\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[16\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/shlib-1rb.rd b/ld/testsuite/ld-tic6x/shlib-1rb.rd +index a07ddca..77ec3d7 100644 +--- a/ld/testsuite/ld-tic6x/shlib-1rb.rd ++++ b/ld/testsuite/ld-tic6x/shlib-1rb.rd +@@ -16,9 +16,9 @@ Section Headers: + \[11\] \.neardata PROGBITS 10000128 002128 000008 00 WA 0 0 4 + \[12\] \.bss NOBITS 10000130 002130 000004 00 WA 0 0 4 + \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00 0 0 1 +- \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 +- \[15\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 16 [0-9]+ 4 +- \[16\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 15 [0-9]+ 4 ++ \[15\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[16\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/shlib-app-1.rd b/ld/testsuite/ld-tic6x/shlib-app-1.rd +index f0e67c9..c3ddcd3 100644 +--- a/ld/testsuite/ld-tic6x/shlib-app-1.rd ++++ b/ld/testsuite/ld-tic6x/shlib-app-1.rd +@@ -17,9 +17,9 @@ Section Headers: + \[12\] \.neardata PROGBITS 100000c0 0020c0 00000c 00 WA 0 0 4 + \[13\] \.bss NOBITS 100000cc 0020cc 000004 00 WA 0 0 4 + \[14\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020cc 000019 00 0 0 1 +- \[15\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000080 00 0 0 1 +- \[16\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 17 [0-9]+ 4 +- \[17\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[15\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 16 [0-9]+ 4 ++ \[16\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[17\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000080 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/shlib-app-1b.rd b/ld/testsuite/ld-tic6x/shlib-app-1b.rd +index 19a7371..2f9d0f6 100644 +--- a/ld/testsuite/ld-tic6x/shlib-app-1b.rd ++++ b/ld/testsuite/ld-tic6x/shlib-app-1b.rd +@@ -17,9 +17,9 @@ Section Headers: + \[12\] \.neardata PROGBITS 100000c0 0020c0 00000c 00 WA 0 0 4 + \[13\] \.bss NOBITS 100000cc 0020cc 000004 00 WA 0 0 4 + \[14\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020cc 000019 00 0 0 1 +- \[15\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000080 00 0 0 1 +- \[16\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 17 [0-9]+ 4 +- \[17\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[15\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 16 [0-9]+ 4 ++ \[16\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[17\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000080 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/shlib-app-1r.rd b/ld/testsuite/ld-tic6x/shlib-app-1r.rd +index f4fcf6b..2cf8c58 100644 +--- a/ld/testsuite/ld-tic6x/shlib-app-1r.rd ++++ b/ld/testsuite/ld-tic6x/shlib-app-1r.rd +@@ -16,9 +16,9 @@ Section Headers: + \[11\] \.neardata PROGBITS 100000c0 0020c0 000004 00 WA 0 0 4 + \[12\] \.bss NOBITS 100000c4 0020c4 000004 00 WA 0 0 4 + \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020c4 000019 00 0 0 1 +- \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 +- \[15\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 16 [0-9]+ 4 +- \[16\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 15 [0-9]+ 4 ++ \[15\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[16\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/shlib-app-1rb.rd b/ld/testsuite/ld-tic6x/shlib-app-1rb.rd +index 3b7b6a9..3cb0256 100644 +--- a/ld/testsuite/ld-tic6x/shlib-app-1rb.rd ++++ b/ld/testsuite/ld-tic6x/shlib-app-1rb.rd +@@ -16,9 +16,9 @@ Section Headers: + \[11\] \.neardata PROGBITS 100000c0 0020c0 000004 00 WA 0 0 4 + \[12\] \.bss NOBITS 100000c4 0020c4 000004 00 WA 0 0 4 + \[13\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020c4 000019 00 0 0 1 +- \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 +- \[15\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 16 [0-9]+ 4 +- \[16\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 15 [0-9]+ 4 ++ \[15\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[16\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 00007b 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/shlib-noindex.rd b/ld/testsuite/ld-tic6x/shlib-noindex.rd +index fa03130..0a29c63 100644 +--- a/ld/testsuite/ld-tic6x/shlib-noindex.rd ++++ b/ld/testsuite/ld-tic6x/shlib-noindex.rd +@@ -17,9 +17,9 @@ Section Headers: + \[12\] \.neardata PROGBITS 10000128 002128 000008 00 WA 0 0 4 + \[13\] \.bss NOBITS 10000130 002130 000004 00 WA 0 0 4 + \[14\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 002130 000019 00 0 0 1 +- \[15\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000080 00 0 0 1 +- \[16\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 17 [0-9]+ 4 +- \[17\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[15\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 16 [0-9]+ 4 ++ \[16\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[17\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000080 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/static-app-1.rd b/ld/testsuite/ld-tic6x/static-app-1.rd +index c1bfc2f..27d2d23 100644 +--- a/ld/testsuite/ld-tic6x/static-app-1.rd ++++ b/ld/testsuite/ld-tic6x/static-app-1.rd +@@ -14,9 +14,9 @@ Section Headers: + \[ 9\] \.neardata PROGBITS 100000e0 0020e0 000014 00 WA 0 0 4 + \[10\] \.bss NOBITS 100000f4 0020f4 000004 00 WA 0 0 4 + \[11\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020f4 000019 00 0 0 1 +- \[12\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000071 00 0 0 1 +- \[13\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 14 [0-9]+ 4 +- \[14\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[12\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 13 [0-9]+ 4 ++ \[13\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000071 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/static-app-1b.rd b/ld/testsuite/ld-tic6x/static-app-1b.rd +index c1bfc2f..27d2d23 100644 +--- a/ld/testsuite/ld-tic6x/static-app-1b.rd ++++ b/ld/testsuite/ld-tic6x/static-app-1b.rd +@@ -14,9 +14,9 @@ Section Headers: + \[ 9\] \.neardata PROGBITS 100000e0 0020e0 000014 00 WA 0 0 4 + \[10\] \.bss NOBITS 100000f4 0020f4 000004 00 WA 0 0 4 + \[11\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020f4 000019 00 0 0 1 +- \[12\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000071 00 0 0 1 +- \[13\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 14 [0-9]+ 4 +- \[14\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[12\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 13 [0-9]+ 4 ++ \[13\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000071 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/static-app-1r.rd b/ld/testsuite/ld-tic6x/static-app-1r.rd +index af8341e..9f3ed9b 100644 +--- a/ld/testsuite/ld-tic6x/static-app-1r.rd ++++ b/ld/testsuite/ld-tic6x/static-app-1r.rd +@@ -14,9 +14,9 @@ Section Headers: + \[ 9\] \.neardata PROGBITS 100000e0 0020e0 00000c 00 WA 0 0 4 + \[10\] \.bss NOBITS 100000ec 0020ec 000004 00 WA 0 0 4 + \[11\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020ec 000019 00 0 0 1 +- \[12\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000071 00 0 0 1 +- \[13\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 14 [0-9]+ 4 +- \[14\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[12\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 13 [0-9]+ 4 ++ \[13\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000071 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-tic6x/static-app-1rb.rd b/ld/testsuite/ld-tic6x/static-app-1rb.rd +index af8341e..9f3ed9b 100644 +--- a/ld/testsuite/ld-tic6x/static-app-1rb.rd ++++ b/ld/testsuite/ld-tic6x/static-app-1rb.rd +@@ -14,9 +14,9 @@ Section Headers: + \[ 9\] \.neardata PROGBITS 100000e0 0020e0 00000c 00 WA 0 0 4 + \[10\] \.bss NOBITS 100000ec 0020ec 000004 00 WA 0 0 4 + \[11\] \.c6xabi\.attributes C6000_ATTRIBUTES 00000000 0020ec 000019 00 0 0 1 +- \[12\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000071 00 0 0 1 +- \[13\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 14 [0-9]+ 4 +- \[14\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[12\] \.symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 13 [0-9]+ 4 ++ \[13\] \.strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[14\] \.shstrtab STRTAB 00000000 [0-9a-f]+ 000071 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/ilp32-4-nacl.d b/ld/testsuite/ld-x86-64/ilp32-4-nacl.d +index 296c406..f560ae3 100644 +--- a/ld/testsuite/ld-x86-64/ilp32-4-nacl.d ++++ b/ld/testsuite/ld-x86-64/ilp32-4-nacl.d +@@ -14,9 +14,9 @@ Section Headers: + +\[ 3\] \.dynsym +DYNSYM +100000dc +0+dc +0+50 +10 +A +4 +1 +4 + +\[ 4\] \.dynstr +STRTAB +1000012c +0+12c +0+19 +00 +A +0 +0 +1 + +\[ 5\] \.dynamic +DYNAMIC +10010148 +0+148 +0+58 +08 +WA +4 +0 +4 +- +\[ 6\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +0+40 +00 +0 +0 +1 +- +\[ 7\] \.symtab +SYMTAB +0+0 +[0-9a-f]+ +[0-9a-f]+ +10 +8 +[0-9] +4 +- +\[ 8\] \.strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +00 +0 +0 +1 ++ +\[ 6\] \.symtab +SYMTAB +0+0 +[0-9a-f]+ +[0-9a-f]+ +10 +7 +[0-9] +4 ++ +\[ 7\] \.strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +00 +0 +0 +1 ++ +\[ 8\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +0+40 +00 +0 +0 +1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/ilp32-4.d b/ld/testsuite/ld-x86-64/ilp32-4.d +index 7f1391f..658ad49 100644 +--- a/ld/testsuite/ld-x86-64/ilp32-4.d ++++ b/ld/testsuite/ld-x86-64/ilp32-4.d +@@ -13,9 +13,9 @@ Section Headers: + \[ 3\] .dynstr STRTAB 0000010c 00010c 000019 00 A 0 0 1 + \[ 4\] .text PROGBITS 00000125 000125 000001 00 AX 0 0 1 + \[ 5\] .dynamic DYNAMIC 00200128 000128 000058 08 WA 3 0 4 +- \[ 6\] .shstrtab STRTAB 00000000 [0-9a-f]+ 000040 00 0 0 1 +- \[ 7\] .symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 8 [0-9] 4 +- \[ 8\] .strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[ 6\] .symtab SYMTAB 00000000 [0-9a-f]+ [0-9a-f]+ 10 7 [0-9] 4 ++ \[ 7\] .strtab STRTAB 00000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[ 8\] .shstrtab STRTAB 00000000 [0-9a-f]+ 000040 00 0 0 1 + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/nogot1.d b/ld/testsuite/ld-x86-64/nogot1.d +index f6c4cf1..823a28a 100644 +--- a/ld/testsuite/ld-x86-64/nogot1.d ++++ b/ld/testsuite/ld-x86-64/nogot1.d +@@ -4,5 +4,6 @@ + + #... + [ ]*\[.*\][ ]+\.dynamic[ ]+DYNAMIC.* ++#... + [ ]*\[.*\][ ]+.*STRTAB.* + #pass +diff --git a/ld/testsuite/ld-x86-64/pr12718.d b/ld/testsuite/ld-x86-64/pr12718.d +index 4b81d71..07d1732 100644 +--- a/ld/testsuite/ld-x86-64/pr12718.d ++++ b/ld/testsuite/ld-x86-64/pr12718.d +@@ -9,8 +9,8 @@ Section Headers: + +\[Nr\] Name +Type +Address +Off +Size +ES +Flg +Lk +Inf +Al + +\[ 0\] +NULL +0+ +0+ +0+ +0+ +0 +0 +0 + +\[ 1\] +.text +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +000006 00 +AX +0 +0 +1 +- +\[ 2\] +.shstrtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +0+ +0 +0 +1 +- +\[ 3\] +.symtab +SYMTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 18 +4 +[0-9] +8 +- +\[ 4\] +.strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 00 +0 +0 +1 ++ +\[ 2\] +.symtab +SYMTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 18 +3 +[0-9] +8 ++ +\[ 3\] +.strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 00 +0 +0 +1 ++ +\[ 4\] +.shstrtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +0+ +0 +0 +1 + Key to Flags: + #pass +diff --git a/ld/testsuite/ld-x86-64/pr12921.d b/ld/testsuite/ld-x86-64/pr12921.d +index 8d09616..6fe6abe 100644 +--- a/ld/testsuite/ld-x86-64/pr12921.d ++++ b/ld/testsuite/ld-x86-64/pr12921.d +@@ -11,8 +11,8 @@ Section Headers: + +\[ 1\] .text +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+1 00 +AX +0 +0 +4096 + +\[ 2\] .data +PROGBITS +[0-9a-f]+ +[0-9a-f]+000 +0+28 +00 +WA +0 +0 +4096 + +\[ 3\] .bss +NOBITS +[0-9a-f]+ +[0-9a-f]+028 +0+10000 +00 +WA +0 +0 +4096 +- +\[ 4\] .shstrtab +STRTAB +0+ +[0-9a-f]+ +0+2c +00 +0 +0 +1 +- +\[ 5\] .symtab +SYMTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +18 +6 +[0-9] +8 +- +\[ 6\] .strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +00 +0 +0 +1 ++ +\[ 4\] .symtab +SYMTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +18 +5 +[0-9] +8 ++ +\[ 5\] .strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +00 +0 +0 +1 ++ +\[ 6\] .shstrtab +STRTAB +0+ +[0-9a-f]+ +0+2c +00 +0 +0 +1 + Key to Flags: + #pass +diff --git a/ld/testsuite/ld-x86-64/split-by-file-nacl.rd b/ld/testsuite/ld-x86-64/split-by-file-nacl.rd +index d11988a..4e3e74a 100644 +--- a/ld/testsuite/ld-x86-64/split-by-file-nacl.rd ++++ b/ld/testsuite/ld-x86-64/split-by-file-nacl.rd +@@ -8,8 +8,8 @@ Section Headers: + \[ 3\] .data PROGBITS 0000000000000000 000043 000000 00 WA 0 0 1 + \[ 4\] .bss NOBITS 0000000000000000 000043 000000 00 WA 0 0 1 + \[ 5\] .foo.0 PROGBITS 0000000000000003 000043 000003 00 AXl 0 0 1 +- \[ 6\] .shstrtab STRTAB 0000000000000000 [0-9a-f]+ 000038 00 0 0 1 +- \[ 7\] .symtab SYMTAB 0000000000000000 [0-9a-f]+ [0-9a-f]+ 18 8 [0-9] 8 +- \[ 8\] .strtab STRTAB 0000000000000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[ 6\] .symtab SYMTAB 0000000000000000 [0-9a-f]+ [0-9a-f]+ 18 7 [0-9] 8 ++ \[ 7\] .strtab STRTAB 0000000000000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[ 8\] .shstrtab STRTAB 0000000000000000 [0-9a-f]+ 000038 00 0 0 1 + Key to Flags: + #pass +diff --git a/ld/testsuite/ld-x86-64/split-by-file.rd b/ld/testsuite/ld-x86-64/split-by-file.rd +index d11988a..4e3e74a 100644 +--- a/ld/testsuite/ld-x86-64/split-by-file.rd ++++ b/ld/testsuite/ld-x86-64/split-by-file.rd +@@ -8,8 +8,8 @@ Section Headers: + \[ 3\] .data PROGBITS 0000000000000000 000043 000000 00 WA 0 0 1 + \[ 4\] .bss NOBITS 0000000000000000 000043 000000 00 WA 0 0 1 + \[ 5\] .foo.0 PROGBITS 0000000000000003 000043 000003 00 AXl 0 0 1 +- \[ 6\] .shstrtab STRTAB 0000000000000000 [0-9a-f]+ 000038 00 0 0 1 +- \[ 7\] .symtab SYMTAB 0000000000000000 [0-9a-f]+ [0-9a-f]+ 18 8 [0-9] 8 +- \[ 8\] .strtab STRTAB 0000000000000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[ 6\] .symtab SYMTAB 0000000000000000 [0-9a-f]+ [0-9a-f]+ 18 7 [0-9] 8 ++ \[ 7\] .strtab STRTAB 0000000000000000 [0-9a-f]+ [0-9a-f]+ 00 0 0 1 ++ \[ 8\] .shstrtab STRTAB 0000000000000000 [0-9a-f]+ 000038 00 0 0 1 + Key to Flags: + #pass +diff --git a/ld/testsuite/ld-x86-64/tlsbin-nacl.rd b/ld/testsuite/ld-x86-64/tlsbin-nacl.rd +index 5de5e1a..4284644 100644 +--- a/ld/testsuite/ld-x86-64/tlsbin-nacl.rd ++++ b/ld/testsuite/ld-x86-64/tlsbin-nacl.rd +@@ -23,9 +23,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+10030410 [0-9a-f]+ 0+140 10 +WA +6 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+10030550 [0-9a-f]+ 0+20 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+10030570 [0-9a-f]+ 0+20 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlsbin.rd b/ld/testsuite/ld-x86-64/tlsbin.rd +index 6f73b98..a34775d 100644 +--- a/ld/testsuite/ld-x86-64/tlsbin.rd ++++ b/ld/testsuite/ld-x86-64/tlsbin.rd +@@ -23,9 +23,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+601298 0+1298 0+140 10 +WA +4 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+6013d8 0+13d8 0+20 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+6013f8 0+13f8 0+20 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlsbin2-nacl.rd b/ld/testsuite/ld-x86-64/tlsbin2-nacl.rd +index 110927b..1f5b782 100644 +--- a/ld/testsuite/ld-x86-64/tlsbin2-nacl.rd ++++ b/ld/testsuite/ld-x86-64/tlsbin2-nacl.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+10030410 [0-9a-f]+ 0+100 10 +WA +5 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+10030510 [0-9a-f]+ 0+28 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+10030538 [0-9a-f]+ 0+18 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlsbin2.rd b/ld/testsuite/ld-x86-64/tlsbin2.rd +index b283648..5fb1599 100644 +--- a/ld/testsuite/ld-x86-64/tlsbin2.rd ++++ b/ld/testsuite/ld-x86-64/tlsbin2.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+601298 0+1298 0+100 10 +WA +4 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+601398 0+1398 0+28 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+6013c0 0+13c0 0+18 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd b/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd +index 39a5abe..2c046f4 100644 +--- a/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd ++++ b/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+100303d0 0+3d0 0+100 10 +WA +5 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+100304d0 0+4d0 0+20 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+100304f0 0+4f0 0+18 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlsbindesc.rd b/ld/testsuite/ld-x86-64/tlsbindesc.rd +index 8c9a342..c94014a 100644 +--- a/ld/testsuite/ld-x86-64/tlsbindesc.rd ++++ b/ld/testsuite/ld-x86-64/tlsbindesc.rd +@@ -21,9 +21,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+601260 0+1260 0+100 10 +WA +4 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+601360 0+1360 0+20 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+601380 0+1380 0+18 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlsdesc-nacl.rd b/ld/testsuite/ld-x86-64/tlsdesc-nacl.rd +index db196a5..7c9d77a 100644 +--- a/ld/testsuite/ld-x86-64/tlsdesc-nacl.rd ++++ b/ld/testsuite/ld-x86-64/tlsdesc-nacl.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+100104b0 [0-9a-f]+ 0+150 10 +WA +5 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+10010600 [0-9a-f]+ 0+48 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+10010648 [0-9a-f]+ 0+68 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlsdesc.rd b/ld/testsuite/ld-x86-64/tlsdesc.rd +index 6a636a0..18060c0 100644 +--- a/ld/testsuite/ld-x86-64/tlsdesc.rd ++++ b/ld/testsuite/ld-x86-64/tlsdesc.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+2011b8 0+11b8 0+150 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+201308 0+1308 0+48 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+201350 0+1350 0+68 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlsgdesc-nacl.rd b/ld/testsuite/ld-x86-64/tlsgdesc-nacl.rd +index 8614af5..934ba03 100644 +--- a/ld/testsuite/ld-x86-64/tlsgdesc-nacl.rd ++++ b/ld/testsuite/ld-x86-64/tlsgdesc-nacl.rd +@@ -19,9 +19,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlsgdesc.rd b/ld/testsuite/ld-x86-64/tlsgdesc.rd +index 5d845c7..729d12e6 100644 +--- a/ld/testsuite/ld-x86-64/tlsgdesc.rd ++++ b/ld/testsuite/ld-x86-64/tlsgdesc.rd +@@ -19,9 +19,9 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* +- +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* ++ +\[[ 0-9]+\] \.shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlspic-nacl.rd b/ld/testsuite/ld-x86-64/tlspic-nacl.rd +index f98e39b..740e399 100644 +--- a/ld/testsuite/ld-x86-64/tlspic-nacl.rd ++++ b/ld/testsuite/ld-x86-64/tlspic-nacl.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+10010510 [0-9a-f]+ 0+130 10 +WA +5 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+10010640 [0-9a-f]+ 0+90 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+100106d0 [0-9a-f]+ 0+20 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlspic.rd b/ld/testsuite/ld-x86-64/tlspic.rd +index 589666b..3f5d544 100644 +--- a/ld/testsuite/ld-x86-64/tlspic.rd ++++ b/ld/testsuite/ld-x86-64/tlspic.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+201380 0+1380 0+130 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+2014b0 0+14b0 0+90 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+201540 0+1540 0+20 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlspic2-nacl.rd b/ld/testsuite/ld-x86-64/tlspic2-nacl.rd +index 1919b3f..cbc0a75 100644 +--- a/ld/testsuite/ld-x86-64/tlspic2-nacl.rd ++++ b/ld/testsuite/ld-x86-64/tlspic2-nacl.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+10010528 [0-9a-f]+ 0+130 10 +WA +5 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+10010658 [0-9a-f]+ 0+98 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+100106f0 [0-9a-f]+ 0+20 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-x86-64/tlspic2.rd b/ld/testsuite/ld-x86-64/tlspic2.rd +index 3c7b8c1..684ae21 100644 +--- a/ld/testsuite/ld-x86-64/tlspic2.rd ++++ b/ld/testsuite/ld-x86-64/tlspic2.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+201380 0+1380 0+100 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+201480 0+1480 0+98 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+201518 0+1518 0+18 08 +WA +0 +0 +8 +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-xtensa/tlsbin.rd b/ld/testsuite/ld-xtensa/tlsbin.rd +index 2361139..dcd2b04 100644 +--- a/ld/testsuite/ld-xtensa/tlsbin.rd ++++ b/ld/testsuite/ld-xtensa/tlsbin.rd +@@ -22,9 +22,9 @@ Section Headers: + +\[[ 0-9]+\] .xtensa.info +NOTE +0+ .* + +\[[ 0-9]+\] .xt.lit +PROGBITS +0+ .* + +\[[ 0-9]+\] .xt.prop +PROGBITS +0+ .* +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + +diff --git a/ld/testsuite/ld-xtensa/tlspic.rd b/ld/testsuite/ld-xtensa/tlspic.rd +index 379334c..b6f7067 100644 +--- a/ld/testsuite/ld-xtensa/tlspic.rd ++++ b/ld/testsuite/ld-xtensa/tlspic.rd +@@ -23,9 +23,9 @@ Section Headers: + +\[[ 0-9]+\] .xtensa.info +NOTE +0+ .* + +\[[ 0-9]+\] .xt.lit +PROGBITS +0+ .* + +\[[ 0-9]+\] .xt.prop +PROGBITS +0+ .* +- +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* ++ +\[[ 0-9]+\] .shstrtab +.* + Key to Flags: + #... + diff --git a/SOURCES/binutils-2.27-power9.patch b/SOURCES/binutils-2.27-power9.patch new file mode 100644 index 0000000..e632e80 --- /dev/null +++ b/SOURCES/binutils-2.27-power9.patch @@ -0,0 +1,452 @@ +diff -rup binutils-2.27.orig/bfd/elf32-ppc.c binutils-2.27/bfd/elf32-ppc.c +--- binutils-2.27.orig/bfd/elf32-ppc.c 2016-09-28 08:49:28.280430815 +0100 ++++ binutils-2.27/bfd/elf32-ppc.c 2016-09-28 08:53:48.133843615 +0100 +@@ -3946,7 +3946,8 @@ is_branch_reloc (enum elf_ppc_reloc_type + || r_type == R_PPC_ADDR24 + || r_type == R_PPC_ADDR14 + || r_type == R_PPC_ADDR14_BRTAKEN +- || r_type == R_PPC_ADDR14_BRNTAKEN); ++ || r_type == R_PPC_ADDR14_BRNTAKEN ++ || r_type == R_PPC_VLE_REL24); + } + + static void +@@ -4897,6 +4898,7 @@ ppc_elf_vle_split16 (bfd *output_bfd, bf + insn = bfd_get_32 (output_bfd, loc); + top5 = value & 0xf800; + top5 = top5 << (split16_format == split16a_type ? 9 : 5); ++ insn &= (split16_format == split16a_type ? ~0x1f007ff : ~0x1f07ff); + insn |= top5; + insn |= value & 0x7ff; + bfd_put_32 (output_bfd, insn, loc); +diff -rup binutils-2.27.orig/gas/testsuite/gas/ppc/power9.d binutils-2.27/gas/testsuite/gas/ppc/power9.d +--- binutils-2.27.orig/gas/testsuite/gas/ppc/power9.d 2016-09-28 08:49:28.783433550 +0100 ++++ binutils-2.27/gas/testsuite/gas/ppc/power9.d 2016-09-28 08:53:47.423839755 +0100 +@@ -280,14 +280,6 @@ Disassembly of section \.text: + .*: (7f a8 49 80|80 49 a8 7f) cmprb cr7,1,r8,r9 + .*: (7d e0 01 00|00 01 e0 7d) setb r15,cr0 + .*: (7d fc 01 00|00 01 fc 7d) setb r15,cr7 +-.*: (7e 00 01 01|01 01 00 7e) setbool r16,lt +-.*: (7e 01 01 01|01 01 01 7e) setbool r16,gt +-.*: (7e 02 01 01|01 01 02 7e) setbool r16,eq +-.*: (7e 03 01 01|01 01 03 7e) setbool r16,so +-.*: (7e 1c 01 01|01 01 1c 7e) setbool r16,4\*cr7\+lt +-.*: (7e 1d 01 01|01 01 1d 7e) setbool r16,4\*cr7\+gt +-.*: (7e 1e 01 01|01 01 1e 7e) setbool r16,4\*cr7\+eq +-.*: (7e 1f 01 01|01 01 1f 7e) setbool r16,4\*cr7\+so + .*: (7f 40 52 1a|1a 52 40 7f) lxvl vs26,0,r10 + .*: (7f 14 52 1b|1b 52 14 7f) lxvl vs56,r20,r10 + .*: (7f 60 5b 1a|1a 5b 60 7f) stxvl vs27,0,r11 +@@ -331,6 +323,7 @@ Disassembly of section \.text: + .*: (4c e0 80 04|04 80 e0 4c) addpcis r7,-32768 + .*: (4c e0 80 04|04 80 e0 4c) addpcis r7,-32768 + .*: (7c 00 02 a4|a4 02 00 7c) slbsync ++.*: (7d 40 06 a4|a4 06 40 7d) slbiag r10 + .*: (7d 40 5b a4|a4 5b 40 7d) slbieg r10,r11 + .*: (7c 60 27 26|26 27 60 7c) slbmfee r3,r4 + .*: (7c 60 27 26|26 27 60 7c) slbmfee r3,r4 +@@ -344,14 +337,9 @@ Disassembly of section \.text: + .*: (7c 00 1a 24|24 1a 00 7c) tlbiel r3 + .*: (7c 00 1a 24|24 1a 00 7c) tlbiel r3 + .*: (7c 8f 1a 24|24 1a 8f 7c) tlbiel r3,r4,3,1,1 +-.*: (7c 0c 6e 0c|0c 6e 0c 7c) copy r12,r13 +-.*: (7c 2c 6e 0c|0c 6e 2c 7c) copy_first r12,r13 +-.*: (7c 2c 6e 0c|0c 6e 2c 7c) copy_first r12,r13 +-.*: (7c 0a 5f 0c|0c 5f 0a 7c) paste r10,r11 +-.*: (7c 0a 5f 0c|0c 5f 0a 7c) paste r10,r11 +-.*: (7c 2a 5f 0d|0d 5f 2a 7c) paste_last r10,r11 +-.*: (7c 2a 5f 0d|0d 5f 2a 7c) paste_last r10,r11 +-.*: (7c 00 06 8c|8c 06 00 7c) cp_abort ++.*: (7c 2c 6e 0c|0c 6e 2c 7c) copy r12,r13 ++.*: (7c 2a 5f 0d|0d 5f 2a 7c) paste\. r10,r11 ++.*: (7c 00 06 8c|8c 06 00 7c) cpabort + .*: (7c 00 04 ac|ac 04 00 7c) hwsync + .*: (7c 00 04 ac|ac 04 00 7c) hwsync + .*: (7c 00 04 ac|ac 04 00 7c) hwsync +@@ -359,8 +347,6 @@ Disassembly of section \.text: + .*: (7c 20 04 ac|ac 04 20 7c) lwsync + .*: (7c 40 04 ac|ac 04 40 7c) ptesync + .*: (7c 40 04 ac|ac 04 40 7c) ptesync +-.*: (7c 07 04 ac|ac 04 07 7c) sync 0,7 +-.*: (7c 28 04 ac|ac 04 28 7c) sync 1,8 + .*: (7e 80 04 cc|cc 04 80 7e) ldat r20,0,0 + .*: (7e 8a e4 cc|cc e4 8a 7e) ldat r20,r10,28 + .*: (7e a0 04 8c|8c 04 a0 7e) lwat r21,0,0 +@@ -373,8 +359,6 @@ Disassembly of section \.text: + .*: (7c 00 f6 e4|e4 f6 00 7c) rmieg r30 + .*: (7d 40 7a 6a|6a 7a 40 7d) ldmx r10,0,r15 + .*: (7d 43 7a 6a|6a 7a 43 7d) ldmx r10,r3,r15 +-.*: (7d 60 83 6a|6a 83 60 7d) lwzmx r11,0,r16 +-.*: (7d 63 83 6a|6a 83 63 7d) lwzmx r11,r3,r16 + .*: (4c 00 02 e4|e4 02 00 4c) stop + .*: (7c 00 00 3c|3c 00 00 7c) wait + .*: (7c 00 00 3c|3c 00 00 7c) wait +@@ -397,9 +381,6 @@ Disassembly of section \.text: + .*: (7d 6c 69 54|54 69 6c 7d) addex r11,r12,r13,0 + .*: (7d 6c 6b 54|54 6b 6c 7d) addex r11,r12,r13,1 + .*: (7d 6c 6d 54|54 6d 6c 7d) addex r11,r12,r13,2 +-.*: (7e b6 b9 55|55 b9 b6 7e) addex\. r21,r22,r23,0 +-.*: (7e b6 bb 55|55 bb b6 7e) addex\. r21,r22,r23,1 +-.*: (7e b6 bd 55|55 bd b6 7e) addex\. r21,r22,r23,2 + .*: (ff 20 04 8e|8e 04 20 ff) mffs f25 + .*: (ff 20 04 8f|8f 04 20 ff) mffs\. f25 + .*: (ff 41 04 8e|8e 04 41 ff) mffsce f26 +@@ -410,12 +391,4 @@ Disassembly of section \.text: + .*: (ff d7 04 8e|8e 04 d7 ff) mffscrni f30,0 + .*: (ff d7 1c 8e|8e 1c d7 ff) mffscrni f30,3 + .*: (ff f8 04 8e|8e 04 f8 ff) mffsl f31 +-.*: (7e 8a 01 76|76 01 8a 7e) brd r10,r20 +-.*: (7e ab 01 b6|b6 01 ab 7e) brh r11,r21 +-.*: (7e cc 01 36|36 01 cc 7e) brw r12,r22 +-.*: (11 6a 63 77|77 63 6a 11) nandxor r10,r11,r12,r13 +-.*: (12 b4 b5 f6|f6 b5 b4 12) xor3 r20,r21,r22,r23 +-.*: (11 6a 60 34|34 60 6a 11) rldixor r10,r11,0,r12 +-.*: (11 6a 66 f4|f4 66 6a 11) rldixor r10,r11,27,r12 +-.*: (11 6a 67 f5|f5 67 6a 11) rldixor r10,r11,63,r12 + #pass +diff -rup binutils-2.27.orig/gas/testsuite/gas/ppc/power9.s binutils-2.27/gas/testsuite/gas/ppc/power9.s +--- binutils-2.27.orig/gas/testsuite/gas/ppc/power9.s 2016-09-28 08:49:28.783433550 +0100 ++++ binutils-2.27/gas/testsuite/gas/ppc/power9.s 2016-09-28 08:53:47.424839761 +0100 +@@ -271,14 +271,6 @@ power9: + cmprb 7,1,8,9 + setb 15,0 + setb 15,7 +- setbool 16,0 +- setbool 16,1 +- setbool 16,2 +- setbool 16,3 +- setbool 16,28 +- setbool 16,29 +- setbool 16,30 +- setbool 16,31 + lxvl 26,0,10 + lxvl 56,20,10 + stxvl 27,0,11 +@@ -322,6 +314,7 @@ power9: + addpcis 7,-0x8000 + subpcis 7,0x8000 + slbsync ++ slbiag 10 + slbieg 10,11 + slbmfee 3,4 + slbmfee 3,4,0 +@@ -335,23 +328,16 @@ power9: + tlbiel 3 + tlbiel 3,0,0,0,0 + tlbiel 3,4,3,1,1 +- copy 12,13,0 +- copy_first 12,13 +- copy 12,13,1 +- paste 10,11,0 +- paste 10,11 +- paste. 10,11,1 +- paste_last 10,11 +- cp_abort ++ copy 12,13 ++ paste. 10,11 ++ cpabort + hwsync + sync +- sync 0,0x0 ++ sync 0 + lwsync +- sync 1,0x0 ++ sync 1 + ptesync +- sync 2,0x0 +- sync 0,0x7 +- sync 1,0x8 ++ sync 2 + ldat 20,0,0x0 + ldat 20,10,0x1c + lwat 21,0,0x0 +@@ -364,8 +350,6 @@ power9: + rmieg 30 + ldmx 10,0,15 + ldmx 10,3,15 +- lwzmx 11,0,16 +- lwzmx 11,3,16 + stop + wait + wait 0 +@@ -388,9 +372,6 @@ power9: + addex 11,12,13,0 + addex 11,12,13,1 + addex 11,12,13,2 +- addex. 21,22,23,0 +- addex. 21,22,23,1 +- addex. 21,22,23,2 + mffs 25 + mffs. 25 + mffsce 26 +@@ -401,11 +382,3 @@ power9: + mffscrni 30,0 + mffscrni 30,3 + mffsl 31 +- brd 10,20 +- brh 11,21 +- brw 12,22 +- nandxor 10,11,12,13 +- xor3 20,21,22,23 +- rldixor 10,11,0,12 +- rldixor 10,11,27,12 +- rldixor 10,11,63,12 +diff -rup binutils-2.27.orig/include/opcode/ppc.h binutils-2.27/include/opcode/ppc.h +--- binutils-2.27.orig/include/opcode/ppc.h 2016-09-28 08:49:28.845433887 +0100 ++++ binutils-2.27/include/opcode/ppc.h 2016-09-28 08:53:48.132843610 +0100 +@@ -214,6 +214,9 @@ extern const int vle_num_opcodes; + /* Opcode is supported by Vector-Scalar (VSX) Unit from ISA 2.08. */ + #define PPC_OPCODE_VSX3 0x40000000000ull + ++/* Opcode is supported by e200z4. */ ++#define PPC_OPCODE_E200Z4 0x80000000000ull ++ + /* A macro to extract the major opcode from an instruction. */ + #define PPC_OP(i) (((i) >> 26) & 0x3f) + +diff -rup binutils-2.27.orig/opcodes/ppc-dis.c binutils-2.27/opcodes/ppc-dis.c +--- binutils-2.27.orig/opcodes/ppc-dis.c 2016-09-28 08:49:29.236436013 +0100 ++++ binutils-2.27/opcodes/ppc-dis.c 2016-09-28 08:58:35.525406139 +0100 +@@ -105,6 +105,11 @@ struct ppc_mopt ppc_opts[] = { + 0 }, + { "com", PPC_OPCODE_COMMON, + 0 }, ++ { "e200z4", (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE| PPC_OPCODE_SPE ++ | PPC_OPCODE_ISEL | PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK ++ | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI ++ | PPC_OPCODE_E500 | PPC_OPCODE_E200Z4), ++ PPC_OPCODE_VLE }, + { "e300", PPC_OPCODE_PPC | PPC_OPCODE_E300, + 0 }, + { "e500", (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_SPE +diff -rup binutils-2.27.orig/opcodes/ppc-opc.c binutils-2.27/opcodes/ppc-opc.c +--- binutils-2.27.orig/opcodes/ppc-opc.c 2016-09-28 08:49:29.236436013 +0100 ++++ binutils-2.27/opcodes/ppc-opc.c 2016-09-28 08:58:16.374302016 +0100 +@@ -2374,6 +2374,12 @@ extract_vleil (unsigned long insn, + #define OPVUP(x,vup) (OP (x) | ((((unsigned long)(vup)) & 0xff) << 8)) + #define OPVUP_MASK OPVUP (0x3f, 0xff) + ++/* The main opcode combined with an update code and the RT fields specified in ++ D form instruction. Used for VLE volatile context save/restore ++ instructions. */ ++#define OPVUPRT(x,vup,rt) (OPVUP (x, vup) | ((((unsigned long)(rt)) & 0x1f) << 21)) ++#define OPVUPRT_MASK OPVUPRT (0x3f, 0xff, 0x1f) ++ + /* An A form instruction. */ + #define A(op, xop, rc) (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1) | (((unsigned long)(rc)) & 1)) + #define A_MASK A (0x3f, 0x1f, 1) +@@ -3055,6 +3061,7 @@ extract_vleil (unsigned long insn, + #define E6500 PPC_OPCODE_E6500 + #define PPCVLE PPC_OPCODE_VLE + #define PPCHTM PPC_OPCODE_HTM ++#define E200Z4 PPC_OPCODE_E200Z4 + /* The list of embedded processors that use the embedded operand ordering + for the 3 operand dcbt and dcbtst instructions. */ + #define DCBT_EO (PPC_OPCODE_E500 | PPC_OPCODE_E500MC | PPC_OPCODE_476 \ +@@ -3161,7 +3168,6 @@ const struct powerpc_opcode powerpc_opco + {"machhwu.", XO (4, 12,0,1), XO_MASK, MULHW, 0, {RT, RA, RB}}, + {"ps_muls1", A (4, 13,0), AFRB_MASK, PPCPS, 0, {FRT, FRA, FRC}}, + {"ps_muls1.", A (4, 13,1), AFRB_MASK, PPCPS, 0, {FRT, FRA, FRC}}, +-{"rldixor", VXASH(4,26), VXASH_MASK, POWER9, 0, {RA, RS, SH6, RB}}, + {"ps_madds0", A (4, 14,0), A_MASK, PPCPS, 0, {FRT, FRA, FRC, FRB}}, + {"ps_madds0.", A (4, 14,1), A_MASK, PPCPS, 0, {FRT, FRA, FRC, FRB}}, + {"ps_madds1", A (4, 15,0), A_MASK, PPCPS, 0, {FRT, FRA, FRC, FRB}}, +@@ -3203,8 +3209,6 @@ const struct powerpc_opcode powerpc_opco + {"ps_msub.", A (4, 28,1), A_MASK, PPCPS, 0, {FRT, FRA, FRC, FRB}}, + {"ps_madd", A (4, 29,0), A_MASK, PPCPS, 0, {FRT, FRA, FRC, FRB}}, + {"ps_madd.", A (4, 29,1), A_MASK, PPCPS, 0, {FRT, FRA, FRC, FRB}}, +-{"xor3", VXA(4, 54), VXA_MASK, POWER9, 0, {RA, RS, RB, RC}}, +-{"nandxor", VXA(4, 55), VXA_MASK, POWER9, 0, {RA, RS, RB, RC}}, + {"vpermr", VXA(4, 59), VXA_MASK, PPCVEC3, 0, {VD, VA, VB, VC}}, + {"ps_nmsub", A (4, 30,0), A_MASK, PPCPS, 0, {FRT, FRA, FRC, FRB}}, + {"vaddeuqm", VXA(4, 60), VXA_MASK, PPCVEC2, 0, {VD, VA, VB, VC}}, +@@ -4943,8 +4947,7 @@ const struct powerpc_opcode powerpc_opco + + {"dcbfep", XRT(31,127,0), XRT_MASK, E500MC|PPCA2, 0, {RA0, RB}}, + +-{"setb", VX(31,256), VXVB_MASK|(3<<16), POWER9, 0, {RT, BFA}}, +-{"setbool", VX(31,257), VXVB_MASK, POWER9, 0, {RT, BA}}, ++{"setb", X(31,128), XRB_MASK|(3<<16), POWER9, 0, {RT, BFA}}, + + {"wrtee", X(31,131), XRARB_MASK, PPC403|BOOKE|PPCA2|PPC476, 0, {RS}}, + +@@ -4994,8 +4997,6 @@ const struct powerpc_opcode powerpc_opco + + {"prtyw", X(31,154), XRB_MASK, POWER6|PPCA2|PPC476, 0, {RA, RS}}, + +-{"brw", X(31,155), XRB_MASK, POWER9, 0, {RA, RS}}, +- + {"stdepx", X(31,157), X_MASK, E500MC|PPCA2, 0, {RS, RA0, RB}}, + + {"stwepx", X(31,159), X_MASK, E500MC|PPCA2, 0, {RS, RA0, RB}}, +@@ -5008,7 +5009,6 @@ const struct powerpc_opcode powerpc_opco + {"sthfcmx", APU(31,167,0), APU_MASK, PPC405, 0, {FCRT, RA, RB}}, + + {"addex", ZRC(31,170,0), Z2_MASK, POWER9, 0, {RT, RA, RB, CY}}, +-{"addex.", ZRC(31,170,1), Z2_MASK, POWER9, 0, {RT, RA, RB, CY}}, + + {"msgclrp", XRTRA(31,174,0,0), XRTRA_MASK, POWER8, 0, {RB}}, + {"dcbtlse", X(31,174), X_MASK, PPCCHLK, E500MC, {CT, RA0, RB}}, +@@ -5033,8 +5033,6 @@ const struct powerpc_opcode powerpc_opco + + {"prtyd", X(31,186), XRB_MASK, POWER6|PPCA2, 0, {RA, RS}}, + +-{"brd", X(31,187), XRB_MASK, POWER9, 0, {RA, RS}}, +- + {"cmprb", X(31,192), XCMP_MASK, POWER9, 0, {BF, L, RA, RB}}, + + {"icblq.", XRC(31,198,1), X_MASK, E6500, 0, {CT, RA0, RB}}, +@@ -5073,8 +5071,6 @@ const struct powerpc_opcode powerpc_opco + {"sleq", XRC(31,217,0), X_MASK, M601, 0, {RA, RS, RB}}, + {"sleq.", XRC(31,217,1), X_MASK, M601, 0, {RA, RS, RB}}, + +-{"brh", X(31,219), XRB_MASK, POWER9, 0, {RA, RS}}, +- + {"stbepx", X(31,223), X_MASK, E500MC|PPCA2, 0, {RS, RA0, RB}}, + + {"cmpeqb", X(31,224), XCMPL_MASK, POWER9, 0, {BF, RA, RB}}, +@@ -5541,8 +5537,6 @@ const struct powerpc_opcode powerpc_opco + + {"mtvsrdd", X(31,435), XX1_MASK, PPCVSX3, 0, {XT6, RA0, RB}}, + +-{"lwzmx", X(31,437), X_MASK, POWER9, 0, {RT, RA0, RB}}, +- + {"ecowx", X(31,438), X_MASK, PPC, E500|TITAN, {RT, RA0, RB}}, + + {"sthux", X(31,439), X_MASK, COM, 0, {RS, RAS, RB}}, +@@ -5815,6 +5809,7 @@ const struct powerpc_opcode powerpc_opco + + {"mcrxr", X(31,512), XBFRARB_MASK, COM, POWER7, {BF}}, + ++{"lbdcbx", X(31,514), X_MASK, E200Z4, 0, {RT, RA, RB}}, + {"lbdx", X(31,515), X_MASK, E500MC, 0, {RT, RA, RB}}, + + {"bblels", X(31,518), X_MASK, PPCBRLK, 0, {0}}, +@@ -5865,6 +5860,7 @@ const struct powerpc_opcode powerpc_opco + {"maskir", XRC(31,541,0), X_MASK, M601, 0, {RA, RS, RB}}, + {"maskir.", XRC(31,541,1), X_MASK, M601, 0, {RA, RS, RB}}, + ++{"lhdcbx", X(31,546), X_MASK, E200Z4, 0, {RT, RA, RB}}, + {"lhdx", X(31,547), X_MASK, E500MC, 0, {RT, RA, RB}}, + + {"lvtrx", X(31,549), X_MASK, PPCVEC2, 0, {VD, RA0, RB}}, +@@ -5888,6 +5884,7 @@ const struct powerpc_opcode powerpc_opco + + {"mcrxrx", X(31,576), XBFRARB_MASK, POWER9, 0, {BF}}, + ++{"lwdcbx", X(31,578), X_MASK, E200Z4, 0, {RT, RA, RB}}, + {"lwdx", X(31,579), X_MASK, E500MC, 0, {RT, RA, RB}}, + + {"lvtlx", X(31,581), X_MASK, PPCVEC2, 0, {VD, RA0, RB}}, +@@ -5906,8 +5903,8 @@ const struct powerpc_opcode powerpc_opco + {"hwsync", XSYNC(31,598,0), 0xffffffff, POWER4, BOOKE|PPC476, {0}}, + {"lwsync", XSYNC(31,598,1), 0xffffffff, PPC, E500, {0}}, + {"ptesync", XSYNC(31,598,2), 0xffffffff, PPC64, 0, {0}}, +-{"sync", X(31,598), XSYNCLE_MASK, POWER9|E6500, 0, {LS, ESYNC}}, +-{"sync", X(31,598), XSYNC_MASK, PPCCOM, BOOKE|PPC476|POWER9, {LS}}, ++{"sync", X(31,598), XSYNCLE_MASK, E6500, 0, {LS, ESYNC}}, ++{"sync", X(31,598), XSYNC_MASK, PPCCOM, BOOKE|PPC476, {LS}}, + {"msync", X(31,598), 0xffffffff, BOOKE|PPCA2|PPC476, 0, {0}}, + {"sync", X(31,598), 0xffffffff, BOOKE|PPC476, E6500, {0}}, + {"lwsync", X(31,598), 0xffffffff, E500, 0, {0}}, +@@ -5938,6 +5935,7 @@ const struct powerpc_opcode powerpc_opco + + {"lfdux", X(31,631), X_MASK, COM, PPCEFS, {FRT, RAS, RB}}, + ++{"stbdcbx", X(31,642), X_MASK, E200Z4, 0, {RS, RA, RB}}, + {"stbdx", X(31,643), X_MASK, E500MC, 0, {RS, RA, RB}}, + + {"stvlx", X(31,647), X_MASK, CELL, 0, {VS, RA0, RB}}, +@@ -5975,6 +5973,7 @@ const struct powerpc_opcode powerpc_opco + {"sre", XRC(31,665,0), X_MASK, M601, 0, {RA, RS, RB}}, + {"sre.", XRC(31,665,1), X_MASK, M601, 0, {RA, RS, RB}}, + ++{"sthdcbx", X(31,674), X_MASK, E200Z4, 0, {RS, RA, RB}}, + {"sthdx", X(31,675), X_MASK, E500MC, 0, {RS, RA, RB}}, + + {"stvfrx", X(31,677), X_MASK, PPCVEC2, 0, {VS, RA0, RB}}, +@@ -5992,6 +5991,7 @@ const struct powerpc_opcode powerpc_opco + {"sriq", XRC(31,696,0), X_MASK, M601, 0, {RA, RS, SH}}, + {"sriq.", XRC(31,696,1), X_MASK, M601, 0, {RA, RS, SH}}, + ++{"stwdcbx", X(31,706), X_MASK, E200Z4, 0, {RS, RA, RB}}, + {"stwdx", X(31,707), X_MASK, E500MC, 0, {RS, RA, RB}}, + + {"stvflx", X(31,709), X_MASK, PPCVEC2, 0, {VS, RA0, RB}}, +@@ -6072,8 +6072,7 @@ const struct powerpc_opcode powerpc_opco + + {"lvsm", X(31,773), X_MASK, PPCVEC2, 0, {VD, RA0, RB}}, + +-{"copy_first", XOPL(31,774,1), XRT_MASK, POWER9, 0, {RA0, RB}}, +-{"copy", X(31,774), XLRT_MASK, POWER9, 0, {RA0, RB, L}}, ++{"copy", XOPL(31,774,1), XRT_MASK, POWER9, 0, {RA0, RB}}, + + {"stvepxl", X(31,775), X_MASK, PPCVEC2, 0, {VS, RA0, RB}}, + {"lvlxl", X(31,775), X_MASK, CELL, 0, {VD, RA0, RB}}, +@@ -6143,7 +6142,7 @@ const struct powerpc_opcode powerpc_opco + + {"lvtlxl", X(31,837), X_MASK, PPCVEC2, 0, {VD, RA0, RB}}, + +-{"cp_abort", X(31,838), XRTRARB_MASK,POWER9, 0, {0}}, ++{"cpabort", X(31,838), XRTRARB_MASK,POWER9, 0, {0}}, + + {"divo", XO(31,331,1,0), XO_MASK, M601, 0, {RT, RA, RB}}, + {"divo.", XO(31,331,1,1), XO_MASK, M601, 0, {RT, RA, RB}}, +@@ -6155,6 +6154,7 @@ const struct powerpc_opcode powerpc_opco + + {"tlbsrx.", XRC(31,850,1), XRT_MASK, PPCA2, 0, {RA0, RB}}, + ++{"slbiag", X(31,850), XRARB_MASK, POWER9, 0, {RS}}, + {"slbmfev", X(31,851), XRLA_MASK, POWER9, 0, {RT, RB, A_L}}, + {"slbmfev", X(31,851), XRA_MASK, PPC64, POWER9, {RT, RB}}, + +@@ -6190,9 +6190,7 @@ const struct powerpc_opcode powerpc_opco + {"extswsli", XS(31,445,0), XS_MASK, POWER9, 0, {RA, RS, SH6}}, + {"extswsli.", XS(31,445,1), XS_MASK, POWER9, 0, {RA, RS, SH6}}, + +-{"paste", XRC(31,902,0), XLRT_MASK, POWER9, 0, {RA0, RB, L0}}, +-{"paste_last", XRCL(31,902,1,1),XRT_MASK, POWER9, 0, {RA0, RB}}, +-{"paste.", XRC(31,902,1), XLRT_MASK, POWER9, 0, {RA0, RB, L1}}, ++{"paste.", XRCL(31,902,1,1),XRT_MASK, POWER9, 0, {RA0, RB}}, + + {"stvlxl", X(31,903), X_MASK, CELL, 0, {VS, RA0, RB}}, + {"stdfcmux", APU(31,903,0), APU_MASK, PPC405, 0, {FCRT, RA, RB}}, +@@ -7070,7 +7068,9 @@ const struct powerpc_opcode vle_opcodes[ + {"se_cmphl", SE_RR(3,3), SE_RR_MASK, PPCVLE, 0, {RX, RY}}, + + {"e_cmpi", SCI8BF(6,0,21), SCI8BF_MASK, PPCVLE, 0, {CRD32, RA, SCLSCI8}}, ++{"e_cmpwi", SCI8BF(6,0,21), SCI8BF_MASK, PPCVLE, 0, {CRD32, RA, SCLSCI8}}, + {"e_cmpli", SCI8BF(6,1,21), SCI8BF_MASK, PPCVLE, 0, {CRD32, RA, SCLSCI8}}, ++{"e_cmplwi", SCI8BF(6,1,21), SCI8BF_MASK, PPCVLE, 0, {CRD32, RA, SCLSCI8}}, + {"e_addi", SCI8(6,16), SCI8_MASK, PPCVLE, 0, {RT, RA, SCLSCI8}}, + {"e_subi", SCI8(6,16), SCI8_MASK, PPCVLE, 0, {RT, RA, SCLSCI8N}}, + {"e_addi.", SCI8(6,17), SCI8_MASK, PPCVLE, 0, {RT, RA, SCLSCI8}}, +@@ -7097,6 +7097,16 @@ const struct powerpc_opcode vle_opcodes[ + {"e_sthu", OPVUP(6,5), OPVUP_MASK, PPCVLE, 0, {RT, D8, RA0}}, + {"e_stwu", OPVUP(6,6), OPVUP_MASK, PPCVLE, 0, {RT, D8, RA0}}, + {"e_stmw", OPVUP(6,9), OPVUP_MASK, PPCVLE, 0, {RT, D8, RA0}}, ++{"e_ldmvgprw", OPVUPRT(6,16,0),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, ++{"e_stmvgprw", OPVUPRT(6,17,0),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, ++{"e_ldmvsprw", OPVUPRT(6,16,1),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, ++{"e_stmvsprw", OPVUPRT(6,17,1),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, ++{"e_ldmvsrrw", OPVUPRT(6,16,4),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, ++{"e_stmvsrrw", OPVUPRT(6,17,4),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, ++{"e_ldmvcsrrw", OPVUPRT(6,16,5),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, ++{"e_stmvcsrrw", OPVUPRT(6,17,5),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, ++{"e_ldmvdsrrw", OPVUPRT(6,16,6),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, ++{"e_stmvdsrrw", OPVUPRT(6,17,6),OPVUPRT_MASK, PPCVLE, 0, {D8, RA0}}, + {"e_add16i", OP(7), OP_MASK, PPCVLE, 0, {RT, RA, SI}}, + {"e_la", OP(7), OP_MASK, PPCVLE, 0, {RT, D, RA0}}, + {"e_sub16i", OP(7), OP_MASK, PPCVLE, 0, {RT, RA, NSI}}, +@@ -7144,10 +7154,8 @@ const struct powerpc_opcode vle_opcodes[ + {"e_cmphl16i", IA16(28,23), IA16_MASK, PPCVLE, 0, {RA, VLEUIMM}}, + {"e_cmph16i", IA16(28,22), IA16_MASK, PPCVLE, 0, {RA, VLESIMM}}, + {"e_cmpl16i", I16A(28,21), I16A_MASK, PPCVLE, 0, {RA, VLEUIMM}}, +-{"e_cmplwi", I16A(28,21), I16A_MASK, PPCVLE, 0, {RA, VLESIMM}}, + {"e_mull2i", I16A(28,20), I16A_MASK, PPCVLE, 0, {RA, VLESIMM}}, + {"e_cmp16i", IA16(28,19), IA16_MASK, PPCVLE, 0, {RA, VLESIMM}}, +-{"e_cmpwi", IA16(28,19), IA16_MASK, PPCVLE, 0, {RA, VLESIMM}}, + {"e_sub2is", I16A(28,18), I16A_MASK, PPCVLE, 0, {RA, VLENSIMM}}, + {"e_add2is", I16A(28,18), I16A_MASK, PPCVLE, 0, {RA, VLESIMM}}, + {"e_sub2i.", I16A(28,17), I16A_MASK, PPCVLE, 0, {RA, VLENSIMM}}, + diff --git a/SOURCES/binutils-rh1038339.patch b/SOURCES/binutils-rh1038339.patch new file mode 100644 index 0000000..26cb06d --- /dev/null +++ b/SOURCES/binutils-rh1038339.patch @@ -0,0 +1,50 @@ +diff -Nrup a/gas/doc/as.texinfo b/gas/doc/as.texinfo +--- a/gas/doc/as.texinfo 2013-02-27 15:28:03.000000000 -0500 ++++ b/gas/doc/as.texinfo 2013-12-11 13:18:39.401021599 -0500 +@@ -723,10 +723,12 @@ assembly. + Remove local absolute symbols from the outgoing symbol table. + + @item -v +-@itemx -version +-Print the @command{as} version. ++@itemx -verbose ++@itemx --verbose ++Print the @command{as} version and continue. + +-@item --version ++@item -version ++@itemx --version + Print the @command{as} version and exit. + + @item -W +@@ -2361,12 +2363,16 @@ For example, it disables the exception f + @section Announce Version: @option{-v} + + @kindex -v +-@kindex -version + @cindex assembler version + @cindex version of assembler + You can find out what version of as is running by including the +-option @samp{-v} (which you can also spell as @samp{-version}) on the +-command line. ++option @samp{-v} (which you can also spell as @samp{-verbose} or ++@samp{--verbose}) on the command line. ++ ++@section Announce Version and Exit: @option{-version} ++@kindex -version ++The @samp{-version} option (which you can also spell as @samp{--version}) ++prints the version of as and exits. + + @node W + @section Control Warnings: @option{-W}, @option{--warn}, @option{--no-warn}, @option{--fatal-warnings} +--- binutils-2.27.orig/gas/doc/as.texinfo 2016-07-18 09:12:45.299152360 +0100 ++++ binutils-2.27/gas/doc/as.texinfo 2016-07-18 09:13:08.637310883 +0100 +@@ -239,7 +239,7 @@ gcc(1), ld(1), and the Info entries for + [@b{-o} @var{objfile}] [@b{-R}] + [@b{--hash-size}=@var{NUM}] [@b{--reduce-memory-overheads}] + [@b{--statistics}] +- [@b{-v}] [@b{-version}] [@b{--version}] ++ [@b{-v}] [@b{-verbose}] [@b{--verbose}] [@b{-version}] [@b{--version}] + [@b{-W}] [@b{--warn}] [@b{--fatal-warnings}] [@b{-w}] [@b{-x}] + [@b{-Z}] [@b{@@@var{FILE}}] + [@b{--sectname-subst}] [@b{--size-check=[error|warning]}] diff --git a/SPECS/binutils.spec b/SPECS/binutils.spec new file mode 100644 index 0000000..e9d3563 --- /dev/null +++ b/SPECS/binutils.spec @@ -0,0 +1,634 @@ +# rpmbuild parameters: +# --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils. +# --with debug: Build without optimizations and without splitting the debuginfo. +# --without testsuite: Do not run the testsuite. Default is to run it. +# --with testsuite: Run the testsuite. Default --with debug is not to run it. + +# For DTS-6 on RHEL-6 we only support x86 and x86_64. +# For DTS-6 on RHEL-7 we also support ppc64, ppc64le, s390x and aarch64 + +%{?scl:%{?scl_package:%scl_package binutils}} + +%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 +# Disable deterministic archives by default. +# This is for package builders who do not want to have to change +# their build scripts to work with deterministic archives. +%define enable_deterministic_archives 0 +# BZ 1342618: Enable support for GCC LTO compilation. +%define enable_lto 1 +# Disable the default generation of compressed debug sections. +%define default_compress_debug 0 + +Summary: A GNU collection of binary utilities +Name: %{?scl_prefix}%{?cross}binutils%{?_with_debug:-debug} +Version: 2.27 +Release: 10%{?dist} +License: GPLv3+ +Group: Development/Tools +URL: http://sources.redhat.com/binutils + +# Note - the Linux Kernel binutils releases are too unstable and contain too +# many controversial patches so we stick with the official FSF version +# instead. + +Source: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2 + +Source2: binutils-2.19.50.0.1-output-format.sed + +Patch01: binutils-2.20.51.0.2-libtool-lib64.patch +Patch02: binutils-2.20.51.0.10-ppc64-pie.patch +Patch03: binutils-2.20.51.0.2-ia64-lib64.patch +Patch04: binutils-2.25-version.patch +Patch05: binutils-2.25-set-long-long.patch +Patch06: binutils-2.20.51.0.10-sec-merge-emit.patch +# Enable -zrelro by default: BZ #621983 +Patch07: binutils-2.22.52.0.1-relro-on-by-default.patch +# Local patch - export demangle.h with the binutils-devel rpm. +Patch08: binutils-2.22.52.0.1-export-demangle.h.patch +# Disable checks that config.h has been included before system headers. BZ #845084 +Patch09: binutils-2.22.52.0.4-no-config-h-check.patch +# Fix addr2line to use the dynamic symbol table if it could not find any ordinary symbols. +Patch10: binutils-2.23.52.0.1-addr2line-dynsymtab.patch +# Fix detections little endian PPC shared libraries +Patch11: binutils-2.24-ldforcele.patch +# Import H.J.Lu's Kernel LTO patch. +Patch12: binutils-2.26-lto.patch +Patch13: binutils-2.23.51.0.3-Provide-std-tr1-hash.patch +Patch14: binutils-rh1038339.patch +Patch15: binutils-2.24-rh919508.patch +# Fix the computation of the value for the sh_info field of the .dynsym section. +Patch16: binutils-2.27-local-dynsym-count.patch +# Sort section headers according to increasing section offset. +Patch17: binutils-2.27-monotonic-section-offsets.patch +# Really enable -z relro by default for aarch64 +Patch18: binutils-2.27-aarch64-relro-default.patch +# Add support for the Power9 architecture +Patch19: binutils-2.27-power9.patch + +Provides: bundled(libiberty) + +%define gold_arches %ix86 x86_64 %arm aarch64 + +%ifarch %gold_arches +%define build_gold both +%else +%define build_gold no +%endif + +%define alternatives_cmd %{!?scl:%{_sbindir}}%{?scl:%{_root_sbindir}}/alternatives +%define alternatives_cmdline %{alternatives_cmd}%{?scl: --altdir %{_sysconfdir}/alternatives --admindir %{_scl_root}/var/lib/alternatives} + +%if 0%{?_with_debug:1} +# 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} +%define run_testsuite 0%{?_with_testsuite:1} +%else +%define run_testsuite 0%{!?_without_testsuite:1} +%endif + +Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel +# BZ 920545: We need pod2man in order to build the manual pages. +BuildRequires: /usr/bin/pod2man +# 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 %{run_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++ +%if 0%{?rhel} >= 7 +BuildRequires: libstdc++-static +%endif +%endif +%endif +Conflicts: gcc-c++ < 4.0.0 +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info +%ifarch ia64 +Obsoletes: gnupro <= 1117-1 +%endif +%{?scl:Requires:%scl_runtime} + +# 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): %{alternatives_cmd} +Requires(preun): %{alternatives_cmd} +%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 +Group: System Environment/Libraries +Provides: binutils-static = %{version}-%{release} +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info +Requires: %{?scl_prefix}binutils = %{version}-%{release} +Requires: zlib-devel +# 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 seperate +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 -b .libtool-lib64~ +%patch02 -p1 -b .ppc64-pie~ +%ifarch ia64 +%if "%{_lib}" == "lib64" +%patch03 -p1 -b .ia64-lib64~ +%endif +%endif +%patch04 -p1 -b .version~ +%patch05 -p1 -b .set-long-long~ +%patch06 -p1 -b .sec-merge-emit~ +%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +%patch07 -p1 -b .relro~ +%endif +%patch08 -p1 -b .export-demangle-h~ +%patch09 -p1 -b .no-config-h-check~ +%patch10 -p1 -b .addr2line~ +%ifarch ppc64le +%patch11 -p1 -b .ldforcele~ +%endif +%patch12 -p1 -b .kernel-lto~ +%patch13 -p1 -b .provide-hash~ +%patch14 -p1 -b .manpage~ +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 + +# We cannot run autotools as there is an exact requirement of autoconf-2.59. + +# On ppc64 and aarch64, we might use 64KiB pages +sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*ppc.c +sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*aarch64.c +sed -i -e '/common_pagesize/s/4 /64 /' gold/powerpc.cc +sed -i -e '/pagesize/s/0x1000,/0x10000,/' gold/aarch64.cc +# LTP sucks +perl -pi -e 's/i\[3-7\]86/i[34567]86/g' */conf* +sed -i -e 's/%''{release}/%{release}/g' bfd/Makefile{.am,.in} +sed -i -e '/^libopcodes_la_\(DEPENDENCIES\|LIBADD\)/s,$, ../bfd/libbfd.la,' opcodes/Makefile.{am,in} +# Build libbfd.so and libopcodes.so with -Bsymbolic-functions if possible. +if gcc %{optflags} -v --help 2>&1 | grep -q -- -Bsymbolic-functions; then +sed -i -e 's/^libbfd_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' bfd/Makefile.{am,in} +sed -i -e 's/^libopcodes_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' opcodes/Makefile.{am,in} +fi +# $PACKAGE is used for the gettext catalog name. +sed -i -e 's/^ PACKAGE=/ PACKAGE=%{?cross}/' */configure +# Undo the name change to run the testsuite. +for tool in binutils gas ld +do + sed -i -e "2aDEJATOOL = $tool" $tool/Makefile.am + sed -i -e "s/^DEJATOOL = .*/DEJATOOL = $tool/" $tool/Makefile.in +done +touch */configure + +%ifarch %{power64} +%define _target_platform %{_arch}-%{_vendor}-%{_host_os} +%endif + +%build +echo target is %{binutils_target} +%ifarch %{power64} +#CFLAGS=`echo $RPM_OPT_FLAGS | sed -e -s "s/-Werror//g"` +#export CFLAGS +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 + +%if 0%{?_with_debug:1} +CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0" +%define enable_shared 0 +%endif + +# We could optimize the cross builds size by --enable-shared but the produced +# binaries may be less convenient in the embedded environment. +# The seemingly unncessary --with-sysroot argument is merely meant to enable +# sysroot capabilities in the resulting executables. That allows customers +# to then use the sysroot capability to set up host-x-host build environments +# easier. +%configure \ + --build=%{_target_platform} --host=%{_target_platform} \ + --target=%{binutils_target} \ + --with-sysroot=/ \ +%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 + $CARGS \ + --enable-plugins \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla/ + +make %{_smp_mflags} tooldir=%{_prefix} all +make %{_smp_mflags} tooldir=%{_prefix} info + +# Do not use %%check as it is run after %%install where libbfd.so is rebuild +# with -fvisibility=hidden no longer being usable in its shared form. +%if !%{run_testsuite} +echo ====================TESTSUITE DISABLED========================= +%else +make -k check < /dev/null || : +echo ====================TESTING========================= +cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum +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.bz2 binutils-%{_target_platform}-*.{sum,log} +uuencode binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}.tar.bz2 +rm -f binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}-*.{sum,log} +%endif + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} +%if %{isnative} +make prefix=%{buildroot}%{_prefix} infodir=%{buildroot}%{_infodir} install-info + +# Rebuild libiberty.a with -fPIC. +# Future: Remove it together with its header file, projects should bundle it. +make -C libiberty clean +make 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 -C bfd clean +make CFLAGS="-g -fPIC $RPM_OPT_FLAGS -fvisibility=hidden" -C bfd + +# Rebuild libopcodes.a with -fPIC. +make -C opcodes clean +make 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,windmc,windres}* + +%if %{enable_shared} +chmod +x %{buildroot}%{_libdir}/lib*.so* +%endif + +# Prevent programs from linking against libbfd and libopcodes +# dynamically, as they are change 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 + +%clean +rm -rf %{buildroot} + +%post +%if "%{build_gold}" == "both" +%__rm -f %{_bindir}/%{?cross}ld +%{alternatives_cmdline} --install %{_bindir}/%{?cross}ld %{?cross}ld \ + %{_bindir}/%{?cross}ld.bfd %{ld_bfd_priority} +%{alternatives_cmdline} --install %{_bindir}/%{?cross}ld %{?cross}ld \ + %{_bindir}/%{?cross}ld.gold %{ld_gold_priority} +%{alternatives_cmdline} --auto %{?cross}ld +%endif +%if %{isnative} +/sbin/ldconfig +# For --excludedocs: +if [ -e %{_infodir}/binutils.info.gz ] +then + /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 +fi +%endif # %{isnative} +exit 0 + +%preun +%if "%{build_gold}" == "both" +if [ $1 = 0 ]; then + %{alternatives_cmdline} --remove %{?cross}ld %{_bindir}/%{?cross}ld.bfd + %{alternatives_cmdline} --remove %{?cross}ld %{_bindir}/%{?cross}ld.gold +fi +%endif +%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 + fi +fi +%endif +exit 0 + +%if %{isnative} +%postun -p /sbin/ldconfig +%endif # %{isnative} + +%files -f %{?cross}binutils.lang +%defattr(-,root,root,-) +%doc README +%{_bindir}/%{?cross}[!l]* +%if "%{build_gold}" == "both" +%{_bindir}/%{?cross}ld.* +%ghost %{_bindir}/%{?cross}ld +%else +%{_bindir}/%{?cross}ld* +%endif +%{_mandir}/man1/* +%if %{enable_shared} +%{_libdir}/lib*.so +%exclude %{_libdir}/libbfd.so +%exclude %{_libdir}/libopcodes.so +%endif + +%if %{isnative} +%{_infodir}/[^b]*info* +%{_infodir}/binutils*info* + +%files devel +%defattr(-,root,root,-) +%{_prefix}/include/* +%{_libdir}/lib*.a +%{_libdir}/libbfd.so +%{_libdir}/libopcodes.so +%{_infodir}/bfd*info* + +%endif # %{isnative} + +%changelog +* Wed Sep 28 2016 Nick Clifton 2.27-10 +- Use correct default sysroot for native targets. +- Add Power9 ISA 3.0 support. + +* Mon Sep 05 2016 Carlos O'Donell 2.27-9 +- Enable '--sysroot' option support for all configurations. + +* Thu Sep 01 2016 Nick Clifton 2.27-8 +- Properly disable the default generation of compressed debug sections. + (#1366182) + +* Thu Aug 18 2016 Nick Clifton 2.27-7 +- Allow -z relro to be enabled by default for the AArch64 target. + (#1367862) + +* Wed Aug 17 2016 Nick Clifton 2.27-6 +- Move .shstrtab section to end of section list so that the monotonic ordering of section offsets is restored. + (#1366145) + +* Fri Aug 12 2016 Nick Clifton 2.27-5 +- Fix the computation of the sh_info field in the header of the .dynsym section. + (#1366185) + +* Thu Aug 04 2016 Nick Clifton 2.27-4 +- Rebase on official FSF binutils 2.27 release. + (#1358353) + +* Thu Jul 21 2016 Nick Clifton 2.27-3 +- Version bump so that the Brew build can be rerun, this time including ppc64 (big-endian) + (#1358353) + +* Wed Jul 20 2016 Nick Clifton 2.27-2 +- Remove sim sources from tarball. + (#1358353) + +* Mon Jul 18 2016 Nick Clifton 2.27-1 +- Rebase on FSF binutils 2.27 release. (#1356661) +- Retire: binutils-2.20.51.0.10-copy-osabi.patch +- Retire: binutils-2.23.2-aarch64-em.patch +- Retire: binutils-2.23.51.0.3-arm-ldralt.patch +- Retire: binutils-2.23.52.0.1-revert-pr15149.patch +- Retire: binutils-2.25.1-gold-testsuite-fixes.patch +- Retire: binutils-2.25-kernel-ld-r.bugfix.patch +- Retire: binutils-2.25-kernel-ld-r.patch +- Retire: binutils-2.25-only-keep-debug.patch +- Retire: binutils-2.25-x86_64-pie-relocs.patch +- Retire: binutils-pr18879.patch +- Retire: binutils-rh1224751.patch +- Retire: binutils-rh1309347.patch +- Retire: binutils-rh895241.patch + +* Mon Apr 04 2016 Patsy Franklin 2.25.1-10 +- Fix a case where a string was being used after the memory + containing the string had been freed. + +* Wed Mar 02 2016 Nick Clifton 2.25.1-9 +- Bump release number by 2 in order to enable build. + +* Wed Mar 02 2016 Nick Clifton 2.25.1-7 +- Fix GOLD testsuite failures. + (#1312376) + +* Thu Feb 25 2016 Nick Clifton 2.25.1-6 +- Change ar's default to be the creation of non-deterministic archives. + +* Thu Feb 18 2016 Nick Clifton 2.25.1-4 +- Add support for Intel Memory Protection Key instructions. + (#1309347) + +* Thu Feb 04 2016 Nick Clifton 2.25.1-2 +- Import patch for FSF PR 18879 + (#1260034) + +* Thu Jan 14 2016 Nick Clifton 2.25.1-1 +- Rebase on FSF binutils 2.25.1 release. +- Retire patch binutils-2.25-x86_64-pie-relocs.patch + +* Tue Sep 22 2015 Nick Clifton 2.25-10 +- Improved patch to preserve the sh_link and sh_info fields in stripped ELF sections. + (#1246390) + +* Wed Aug 5 2015 Nick Clifton 2.25-9 +- Import patch from FSF to preserve the sh_link and sh_info fields in stripped ELF sections. + (#1246390) + +* Tue Aug 4 2015 Jeff Law 2.25-8 +- Backport Cary's patch to silence pedantic warning in gold + (#895241) + +* Thu Jun 4 2015 Jeff Law 2.25-7 +- Resync with Fedora (binutils-2.25) + Reapply DTS specific patches + Backport testsuite patch to fix gold testsuite failure +