From 7c53938cacde6e7342db726b9ec97c96fb680e6a Mon Sep 17 00:00:00 2001 From: David Howells Date: Sep 14 2016 23:30:19 +0000 Subject: Sync with binutils-2.27-4 - Obsolete sh64 --- diff --git a/binutils-2.20.51.0.10-copy-osabi.patch b/binutils-2.20.51.0.10-copy-osabi.patch deleted file mode 100644 index 6bd9f3d..0000000 --- a/binutils-2.20.51.0.10-copy-osabi.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- binutils-2.26.orig/bfd/elf.c 2016-01-25 10:11:33.482288877 +0000 -+++ binutils-2.26/bfd/elf.c 2016-01-25 10:16:48.520223863 +0000 -@@ -1300,6 +1300,13 @@ _bfd_elf_copy_private_bfd_data (bfd *ibf - } - } - -+ /* If the input BFD has the OSABI field set and the -+ output BFD does not, then copy the value. */ -+ if (elf_elfheader (ibfd)->e_ident [EI_OSABI] != ELFOSABI_NONE -+ && elf_elfheader (obfd)->e_ident [EI_OSABI] == ELFOSABI_NONE) -+ elf_elfheader (obfd)->e_ident [EI_OSABI] = -+ elf_elfheader (ibfd)->e_ident [EI_OSABI]; -+ - return TRUE; - } - diff --git a/binutils-2.22.52.0.1-relro-on-by-default.patch b/binutils-2.22.52.0.1-relro-on-by-default.patch index ba8318d..8d9b6c1 100644 --- a/binutils-2.22.52.0.1-relro-on-by-default.patch +++ b/binutils-2.22.52.0.1-relro-on-by-default.patch @@ -1,58 +1,13 @@ -diff -upr ../binutils-2.22.52.0.1.orig/ld/testsuite/config/default.exp ld/testsuite/config/default.exp ---- a/ld/testsuite/config/default.exp 2012-03-06 14:00:31.141957656 +0000 -+++ b/ld/testsuite/config/default.exp 2012-03-06 14:09:33.492940503 +0000 -@@ -23,7 +23,7 @@ - # - - if ![info exists ld] then { -- set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]] -+ set ld "[findfile $base_dir/ld-new $base_dir/ld-new [transform ld]] -znorelro" - } - - if ![info exists as] then { -@@ -60,7 +60,7 @@ if {![file isdirectory tmpdir/ld]} then - catch "exec ln -s ld tmpdir/ld/collect-ld" status - catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status - } --set gcc_B_opt "-B[pwd]/tmpdir/ld/" -+set gcc_B_opt "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro" - - # load the linker path - set ld_L_opt "" -@@ -279,7 +279,7 @@ - } - - if ![info exists LD] then { -- set LD [findfile $base_dir/ld-new ./ld-new [transform ld]] -+ set LD "[findfile $base_dir/ld-new ./ld-new [transform ld]] -znorelro" - } - - if ![info exists LDFLAGS] then { -diff -cpr ../binutils-2.22.52.0.1.orig/ld/testsuite/ld-bootstrap/bootstrap.exp ld/testsuite/ld-bootstrap/bootstrap.exp ---- a/ld/testsuite/ld-bootstrap/bootstrap.exp 2012-03-06 14:00:30.503957676 +0000 -+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp 2012-03-06 15:03:33.949837926 +0000 -@@ -71,7 +71,13 @@ - - # This test can only be run if we have the ld build directory, - # since we need the object files. -- if {$ld != "$objdir/ld-new"} { -+ set ldexe $ld -+ set ldparm [string first " " $ld] -+ if { $ldparm > 0 } then { -+ set ldparm [expr $ldparm - 1] -+ set ldexe [string range $ld 0 $ldparm] -+ } -+ if {$ldexe != "$objdir/ld-new"} { - untested $testname - continue - } ---- binutils-2.26.orig/ld/emultempl/elf32.em 2016-01-25 10:11:33.990291993 +0000 -+++ binutils-2.26/ld/emultempl/elf32.em 2016-01-25 10:21:40.333016777 +0000 -@@ -104,6 +104,7 @@ gld${EMULATION_NAME}_before_parse (void) - 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`; - `if test -n "$CALL_NOP_BYTE" ; then echo link_info.call_nop_byte = $CALL_NOP_BYTE; fi`; -+ link_info.relro = TRUE; - } - - EOF +--- 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/binutils-2.23.2-aarch64-em.patch b/binutils-2.23.2-aarch64-em.patch deleted file mode 100644 index 1ee8a9e..0000000 --- a/binutils-2.23.2-aarch64-em.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/ld/emultempl/aarch64elf.em 2013-06-05 09:46:17.499278813 +0100 -+++ b/ld/emultempl/aarch64elf.em 2013-06-05 09:54:36.981292659 +0100 -@@ -271,7 +271,7 @@ gld${EMULATION_NAME}_after_allocation (v - } - - static void --gld${EMULATION_NAME}_finish (void) -+gld${EMULATION_NAME}_local_finish (void) - { - if (!bfd_link_relocatable (&link_info)) - { -@@ -276,7 +276,7 @@ - } - } - -- finish_default (); -+ gld${EMULATION_NAME}_finish (); - } - - /* This is a convenient point to tell BFD about target specific flags. -@@ -413,4 +413,4 @@ - LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse - - # Call the extra arm-elf function --LDEMUL_FINISH=gld${EMULATION_NAME}_finish -+LDEMUL_FINISH=gld${EMULATION_NAME}_local_finish diff --git a/binutils-2.23.52.0.1-addr2line-dynsymtab.patch b/binutils-2.23.52.0.1-addr2line-dynsymtab.patch index 944f4fd..6abaf53 100644 --- a/binutils-2.23.52.0.1-addr2line-dynsymtab.patch +++ b/binutils-2.23.52.0.1-addr2line-dynsymtab.patch @@ -4,7 +4,7 @@ bfd_malloc (strlen (debug_file_directory) + 1 + (canon_dirlen > dirlen ? canon_dirlen : dirlen) + strlen (".debug/") -+#define FEDORA_LIB_DEBUG_DIR "/usr/lib/debug/" ++#define FEDORA_LIB_DEBUG_DIR "/usr/lib/debug" + + strlen (FEDORA_LIB_DEBUG_DIR) + strlen ("usr/") + strlen (base) + 1); diff --git a/binutils-2.25-kernel-ld-r.patch b/binutils-2.25-kernel-ld-r.patch deleted file mode 100644 index edf99f3..0000000 --- a/binutils-2.25-kernel-ld-r.patch +++ /dev/null @@ -1,2347 +0,0 @@ -diff -rup binutils-2.25/bfd/bfd.c binutils-2.25.patched/bfd/bfd.c ---- binutils-2.25/bfd/bfd.c 2014-11-04 09:54:41.000000000 +0000 -+++ binutils-2.25.patched/bfd/bfd.c 2015-02-02 16:10:13.853438622 +0000 -@@ -221,6 +229,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; - . -diff -rup binutils-2.25/bfd/bfd-in2.h binutils-2.25.patched/bfd/bfd-in2.h ---- binutils-2.25/bfd/bfd-in2.h 2015-02-02 16:11:06.706681097 +0000 -+++ binutils-2.25.patched/bfd/bfd-in2.h 2015-02-02 16:10:13.841438566 +0000 -@@ -1078,6 +1078,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. */ -@@ -1650,6 +1653,9 @@ extern asection _bfd_std_section[4]; - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) - -+/* GNU object-only section name. */ -+#define GNU_OBJECT_ONLY_SECTION_NAME ".gnu_object_only" -+ - /* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -@@ -6446,6 +6460,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; - -diff -rup binutils-2.25/bfd/elf.c binutils-2.25.patched/bfd/elf.c ---- binutils-2.25/bfd/elf.c 2015-02-02 16:11:06.700681069 +0000 -+++ binutils-2.25.patched/bfd/elf.c 2015-02-02 16:10:13.833438530 +0000 -@@ -2208,6 +2208,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.25/bfd/format.c binutils-2.25.patched/bfd/format.c ---- binutils-2.25/bfd/format.c 2014-10-14 08:32:02.000000000 +0100 -+++ binutils-2.25.patched/bfd/format.c 2015-02-02 16:10:13.857438640 +0000 -@@ -94,6 +94,33 @@ bfd_check_format (bfd *abfd, bfd_format - return bfd_check_format_matches (abfd, format, 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; -+ } -+} -+ - struct bfd_preserve - { - void *marker; -@@ -221,7 +248,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) - { -@@ -449,6 +479,9 @@ 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.25/bfd/opncls.c binutils-2.25.patched/bfd/opncls.c ---- binutils-2.25/bfd/opncls.c 2015-02-02 16:11:06.707681101 +0000 -+++ binutils-2.25.patched/bfd/opncls.c 2015-02-02 16:10:13.866438681 +0000 -@@ -1711,3 +1711,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.25/bfd/plugin.c binutils-2.25.patched/bfd/plugin.c ---- binutils-2.25/bfd/plugin.c 2014-11-04 09:54:41.000000000 +0000 -+++ binutils-2.25.patched/bfd/plugin.c 2015-02-02 16:10:49.164600619 +0000 -@@ -129,6 +129,139 @@ 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_check_format (nbfd, bfd_object)) -+ { -+ (*_bfd_error_handler) -+ (_("%s: failed to open to extract object only section: %s"), -+ abfd->filename, bfd_errmsg (bfd_get_error ())); -+ 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, -@@ -140,11 +273,13 @@ add_symbols (void * handle, - - plugin_data->nsyms = nsyms; - plugin_data->syms = syms; -+ abfd->tdata.plugin_data = plugin_data; -+ -+ bfd_plugin_get_symbols_in_object_only (abfd); - -- if (nsyms != 0) -+ if ((nsyms + plugin_data->object_only_nsyms) != 0) - abfd->flags |= HAS_SYMS; - -- abfd->tdata.plugin_data = plugin_data; - return LDPS_OK; - } - -@@ -390,7 +525,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); - -@@ -424,12 +560,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++) - { -@@ -442,10 +573,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: -@@ -453,15 +585,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.25/bfd/plugin.h binutils-2.25.patched/bfd/plugin.h ---- binutils-2.25/bfd/plugin.h 2014-10-14 08:32:02.000000000 +0100 -+++ binutils-2.25.patched/bfd/plugin.h 2015-02-02 16:10:13.854438626 +0000 -@@ -30,6 +30,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.25/bfd/section.c binutils-2.25.patched/bfd/section.c ---- binutils-2.25/bfd/section.c 2014-10-14 08:32:02.000000000 +0100 -+++ binutils-2.25.patched/bfd/section.c 2015-02-02 16:10:13.829438511 +0000 -@@ -595,6 +595,9 @@ CODE_FRAGMENT - . || ((SEC) == bfd_com_section_ptr) \ - . || ((SEC) == bfd_ind_section_ptr)) - . -+.{* GNU object-only section name. *} -+.#define GNU_OBJECT_ONLY_SECTION_NAME ".gnu_object_only" -+. - .{* Macros to handle insertion and deletion of a bfd's sections. These - . only handle the list pointers, ie. do not adjust section_count, - . target_index etc. *} -diff -rup binutils-2.25/binutils/objcopy.c binutils-2.25.patched/binutils/objcopy.c ---- binutils-2.25/binutils/objcopy.c 2014-12-23 08:47:10.000000000 +0000 -+++ binutils-2.25.patched/binutils/objcopy.c 2015-02-02 16:10:13.883438759 +0000 -@@ -1009,30 +1009,6 @@ is_specified_symbol (const char *name, h - return htab_find (htab, name) != NULL; - } - --/* Return a pointer to the symbol used as a signature for GROUP. */ -- --static asymbol * --group_signature (asection *group) --{ -- 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; --} -- - /* Return TRUE if the section is a DWO section. */ - - static bfd_boolean -@@ -1114,7 +1090,7 @@ is_strip_section (bfd *abfd ATTRIBUTE_UN - /* PR binutils/3181 - If we are going to strip the group signature symbol, then - strip the group section too. */ -- gsym = group_signature (sec); -+ gsym = bfd_group_signature (sec, isympp); - if (gsym != NULL) - gname = gsym->name; - else -@@ -2823,7 +2799,7 @@ setup_section (bfd *ibfd, sec_ptr isecti - - if ((isection->flags & SEC_GROUP) != 0) - { -- asymbol *gsym = group_signature (isection); -+ asymbol *gsym = bfd_group_signature (isection, isympp); - - if (gsym != NULL) - { -diff -rup binutils-2.25/binutils/readelf.c binutils-2.25.patched/binutils/readelf.c ---- binutils-2.25/binutils/readelf.c 2014-12-23 08:47:10.000000000 +0000 -+++ binutils-2.25.patched/binutils/readelf.c 2015-02-02 16:10:13.882438755 +0000 -@@ -3624,6 +3624,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.25/include/bfdlink.h binutils-2.25.patched/include/bfdlink.h ---- binutils-2.25/include/bfdlink.h 2014-12-23 08:47:10.000000000 +0000 -+++ binutils-2.25.patched/include/bfdlink.h 2015-02-02 16:10:13.656437718 +0000 -@@ -389,6 +389,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.25/include/elf/common.h binutils-2.25.patched/include/elf/common.h ---- binutils-2.25/include/elf/common.h 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/include/elf/common.h 2015-02-02 16:10:13.650437690 +0000 -@@ -472,6 +472,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.25/ld/emultempl/alphaelf.em binutils-2.25.patched/ld/emultempl/alphaelf.em ---- binutils-2.25/ld/emultempl/alphaelf.em 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/emultempl/alphaelf.em 2015-02-02 16:10:13.667437768 +0000 -@@ -100,7 +100,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.25/ld/emultempl/armelf.em binutils-2.25.patched/ld/emultempl/armelf.em ---- binutils-2.25/ld/emultempl/armelf.em 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/emultempl/armelf.em 2015-02-02 16:10:13.668437773 +0000 -@@ -370,7 +370,7 @@ gld${EMULATION_NAME}_after_allocation (v - } - - static void --gld${EMULATION_NAME}_finish (void) -+arm_finish (void) - { - struct bfd_link_hash_entry * h; - -@@ -393,7 +393,7 @@ gld${EMULATION_NAME}_finish (void) - } - } - -- finish_default (); -+ gld${EMULATION_NAME}_finish (); - - if (thumb_entry_symbol) - { -@@ -702,4 +702,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=arm_finish -diff -rup binutils-2.25/ld/emultempl/elf32.em binutils-2.25.patched/ld/emultempl/elf32.em ---- binutils-2.25/ld/emultempl/elf32.em 2015-02-02 16:11:06.703681083 +0000 -+++ binutils-2.25.patched/ld/emultempl/elf32.em 2015-02-02 16:10:13.667437768 +0000 -@@ -65,6 +65,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 -@@ -1730,6 +1731,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. */ - -@@ -1738,7 +1741,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, -@@ -1768,6 +1771,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, -@@ -1780,7 +1784,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; -@@ -1857,15 +1860,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; - } - -@@ -1937,6 +1947,27 @@ gld${EMULATION_NAME}_place_orphan (asect - EOF - fi - -+fragment <flags & BFD_PLUGIN) == 0) -+ && ! symbol_warning (warning, symbol, abfd)) - { - bfd *b; - /* Search all input files for a reference to SYMBOL. */ -@@ -1493,3 +1477,38 @@ notice (struct bfd_link_info *info, - - return TRUE; - } -+ -+/* Parse the linker script. */ -+ -+void -+ld_parse_linker_script (void) -+{ -+ /* 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.25/ld/ldmain.h binutils-2.25.patched/ld/ldmain.h ---- binutils-2.25/ld/ldmain.h 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/ldmain.h 2015-02-02 16:10:13.665437759 +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.25/ld/lexsup.c binutils-2.25.patched/ld/lexsup.c ---- binutils-2.25/ld/lexsup.c 2014-11-04 09:54:41.000000000 +0000 -+++ binutils-2.25.patched/ld/lexsup.c 2015-02-02 16:10:13.809438420 +0000 -@@ -166,6 +166,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 }, -diff -rup binutils-2.25/ld/plugin.c binutils-2.25.patched/ld/plugin.c ---- binutils-2.25/ld/plugin.c 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/plugin.c 2015-02-02 16:10:13.669437777 +0000 -@@ -39,6 +39,9 @@ - /* 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. */ -@@ -229,6 +232,17 @@ plugin_opt_plugin_arg (const char *arg) - return 0; - } - -+ /* Ignore -pass-through= from GCC driver. */ -+ if (*arg == '-') -+ { -+ const char *p; -+ for (p = arg + 1; p; p++) -+ if (*p != '-') -+ break; -+ if (strncmp (p, "pass-through=", 13) == 0) -+ return 0; -+ } -+ - newarg = xmalloc (sizeof *newarg); - newarg->arg = arg; - newarg->next = NULL; -@@ -935,14 +952,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.25/ld/plugin.h binutils-2.25.patched/ld/plugin.h ---- binutils-2.25/ld/plugin.h 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/plugin.h 2015-02-02 16:10:13.668437773 +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.25/ld/scripttempl/armbpabi.sc binutils-2.25.patched/ld/scripttempl/armbpabi.sc ---- binutils-2.25/ld/scripttempl/armbpabi.sc 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/scripttempl/armbpabi.sc 2015-02-02 16:10:13.660437736 +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.25/ld/scripttempl/elf32sh-symbian.sc binutils-2.25.patched/ld/scripttempl/elf32sh-symbian.sc ---- binutils-2.25/ld/scripttempl/elf32sh-symbian.sc 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/scripttempl/elf32sh-symbian.sc 2015-02-02 16:10:13.660437736 +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.25/ld/scripttempl/elf64hppa.sc binutils-2.25.patched/ld/scripttempl/elf64hppa.sc ---- binutils-2.25/ld/scripttempl/elf64hppa.sc 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/scripttempl/elf64hppa.sc 2015-02-02 16:10:13.662437745 +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.25/ld/scripttempl/elf.sc binutils-2.25.patched/ld/scripttempl/elf.sc ---- binutils-2.25/ld/scripttempl/elf.sc 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/scripttempl/elf.sc 2015-02-02 16:10:13.660437736 +0000 -@@ -165,7 +165,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.25/ld/scripttempl/elfxtensa.sc binutils-2.25.patched/ld/scripttempl/elfxtensa.sc ---- binutils-2.25/ld/scripttempl/elfxtensa.sc 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/scripttempl/elfxtensa.sc 2015-02-02 16:10:13.661437741 +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.25/ld/scripttempl/mep.sc binutils-2.25.patched/ld/scripttempl/mep.sc ---- binutils-2.25/ld/scripttempl/mep.sc 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/scripttempl/mep.sc 2015-02-02 16:10:13.662437745 +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.25/ld/scripttempl/pep.sc binutils-2.25.patched/ld/scripttempl/pep.sc ---- binutils-2.25/ld/scripttempl/pep.sc 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/scripttempl/pep.sc 2015-02-02 16:10:13.660437736 +0000 -@@ -170,6 +170,7 @@ SECTIONS - *(.drectve) - ${RELOCATING+ *(.note.GNU-stack)} - ${RELOCATING+ *(.gnu.lto_*)} -+ ${RELOCATING+ *(.gnu_object_only)} - } - - .idata ${RELOCATING+BLOCK(__section_alignment__)} : -diff -rup binutils-2.25/ld/scripttempl/pe.sc binutils-2.25.patched/ld/scripttempl/pe.sc ---- binutils-2.25/ld/scripttempl/pe.sc 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/scripttempl/pe.sc 2015-02-02 16:10:13.662437745 +0000 -@@ -165,6 +165,7 @@ SECTIONS - *(.drectve) - ${RELOCATING+ *(.note.GNU-stack)} - ${RELOCATING+ *(.gnu.lto_*)} -+ ${RELOCATING+ *(.gnu_object_only)} - } - - .idata ${RELOCATING+BLOCK(__section_alignment__)} : ---- binutils-2.26.orig/ld/plugin.c 2016-01-25 10:28:36.904576217 +0000 -+++ binutils-2.26/ld/plugin.c 2016-01-25 10:47:19.864448255 +0000 -@@ -1196,6 +1196,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. */ - - /* BFD archive handling caches elements so we can't call ---- binutils-2.26.orig/ld/lexsup.c 2016-01-25 10:28:36.904576217 +0000 -+++ binutils-2.26/ld/lexsup.c 2016-01-25 10:45:22.879732578 +0000 -@@ -1023,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; ---- binutils-2.26.orig/ld/ldmain.c 2016-01-25 10:28:36.904576217 +0000 -+++ binutils-2.26/ld/ldmain.c 2016-01-25 10:44:07.086268897 +0000 -@@ -786,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); - ---- binutils-2.26.orig/ld/ldlang.h 2016-01-25 10:28:36.904576217 +0000 -+++ binutils-2.26/ld/ldlang.h 2016-01-25 10:42:57.531843385 +0000 -@@ -693,4 +693,45 @@ lang_ld_feature (char *); - extern void - lang_print_memory_usage (void); - -+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 ---- binutils-2.26.orig/ld/ldlang.c 2016-01-25 10:28:36.904576217 +0000 -+++ binutils-2.26/ld/ldlang.c 2016-01-25 10:42:00.040491670 +0000 -@@ -93,6 +93,10 @@ static void lang_do_version_exports_sect - static void lang_finalize_version_expr_head - (struct bfd_elf_version_expr_head *); - static void lang_do_memory_regions (void); -+static void cmdline_lists_init (void); -+static void cmdline_get_object_only_input_files (void); -+static void print_cmdline_list (cmdline_union_type *); -+static bfd_boolean cmdline_on_object_only_archive_list_p (bfd *); - - /* Exported variables. */ - const char *output_target; -@@ -8284,6 +8288,962 @@ lang_ld_feature (char *str) - } - } - -+ -+static void -+cmdline_lists_init (void) -+{ -+ cmdline_object_only_file_list.tail -+ = &cmdline_object_only_file_list.head; -+ cmdline_object_only_archive_list.tail -+ = &cmdline_object_only_archive_list.head; -+ cmdline_temp_object_only_list.tail -+ = &cmdline_temp_object_only_list.head; -+} -+ -+/* Allocate an item with TYPE and DATA. */ -+ -+static cmdline_union_type * -+cmdline_list_new (cmdline_enum_type type, void *data) -+{ -+ cmdline_union_type *new_opt; -+ -+ new_opt = (cmdline_union_type *) stat_alloc (sizeof (*new_opt)); -+ new_opt->header.type = type; -+ switch (type) -+ { -+ default: -+ break; -+ case cmdline_is_file_enum: -+ new_opt->file.filename = (const char *) data; -+ break; -+ case cmdline_is_bfd_enum: -+ new_opt->abfd.abfd = (bfd *) data; -+ break; -+ } -+ return new_opt; -+} -+ -+/* Append an item with TYPE and DATA to LIST. */ -+ -+static void -+cmdline_list_append (cmdline_list_type *list, cmdline_enum_type type, -+ void *data) -+{ -+ cmdline_union_type *new_opt = cmdline_list_new (type, data); -+ new_opt->header.next = NULL; -+ *list->tail = new_opt; -+ list->tail = &new_opt->header.next; -+} -+ -+static void -+print_cmdline_list (cmdline_union_type *c) -+{ -+ for (; c != NULL; c = c->header.next) -+ switch (c->header.type) -+ { -+ default: -+ abort (); -+ case cmdline_is_file_enum: -+ info_msg (" %s", c->file.filename); -+ break; -+ case cmdline_is_bfd_enum: -+ info_msg (" [%B]", c->abfd.abfd); -+ break; -+ } -+ -+ info_msg ("\n"); -+} -+ -+/* Return TRUE if ABFD is on cmdline_object_only_archive_list. */ -+ -+static bfd_boolean -+cmdline_on_object_only_archive_list_p (bfd *abfd) -+{ -+ cmdline_union_type *c, *next; -+ bfd *archive, *obfd, *oarchive; -+ ufile_ptr origin = abfd->origin; -+ -+ archive = bfd_my_archive (abfd); -+ 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; -+ obfd = c->abfd.abfd; -+ oarchive = bfd_my_archive (obfd); -+ -+ /* The list is grouped by archive file name and sorted by member -+ origin. */ -+ if (strcmp (archive->filename, oarchive->filename) != 0) -+ continue; -+ -+ if (origin == obfd->origin) -+ return TRUE; -+ else if (origin < obfd->origin) -+ return FALSE; -+ } -+ -+ return FALSE; -+} -+ -+/* Append an item with TYPE and DATA to cmdline_object_only_file_list -+ or cmdline_object_only_archive_list if needed. */ -+ -+static void -+cmdline_object_only_list_append (cmdline_enum_type type, void *data) -+{ -+ cmdline_union_type *c; -+ cmdline_union_type *new_opt, *next, **prev; -+ bfd *abfd, *archive; -+ bfd *obfd, *oarchive; -+ bfd *nbfd, *narchive; -+ ufile_ptr origin, norigin; -+ -+ /* Put it on cmdline_object_only_file_list if it isn't an archive -+ member. */ -+ switch (type) -+ { -+ default: -+ abort (); -+ case cmdline_is_bfd_enum: -+ abfd = (bfd *) data; -+ archive = bfd_my_archive (abfd); -+ 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 = bfd_my_archive (obfd); -+ -+ 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 = bfd_my_archive (nbfd); -+ 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; -+} -+ -+ -+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 (bfd_my_archive (abfd)) -+ 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 = bfd_my_archive (abfd); -+ -+ /* 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 = bfd_my_archive (nbfd); -+ } -+ 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; -+ const 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; -+ } -+ ofilename = 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")); -+ } -+ -+ return; -+ -+loser: -+ if (isympp) -+ free (isympp); -+ if (osympp) -+ free (osympp); -+ if (obfd) -+ bfd_close (obfd); -+ if (ofilename) -+ unlink (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); -+ -+ 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; -+ -+ cmdline_get_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 (); -+ -+ 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; -+ } -+} -+ - /* Pretty print memory amount. */ - - static void ---- binutils-2.26.orig/ld/emultempl/ppc64elf.em 2016-01-25 10:28:36.756575308 +0000 -+++ binutils-2.26/ld/emultempl/ppc64elf.em 2016-01-25 10:36:29.882471865 +0000 -@@ -928,4 +928,4 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS= - LDEMUL_AFTER_OPEN=ppc_after_open - LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation - LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation --LDEMUL_FINISH=gld${EMULATION_NAME}_finish -+LDEMUL_FINISH=ppc_finish ---- binutils-2.26.orig/bfd/bfd-in2.h 2016-01-25 10:28:36.444573391 +0000 -+++ binutils-2.26/bfd/bfd-in2.h 2016-01-25 10:34:45.072830672 +0000 -@@ -6517,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. */ -@@ -6807,6 +6815,9 @@ struct bfd - - /* For input BFDs, the build ID, if the object has one. */ - const struct bfd_build_id *build_id; -+ -+ /* LTO object type. */ -+ unsigned int lto_type : 2; - }; - - /* See note beside bfd_set_section_userdata. */ -@@ -7019,6 +7030,8 @@ void bfd_emul_set_commonpagesize (const - - char *bfd_demangle (bfd *, const char *, int); - -+asymbol *bfd_group_signature (asection *group, asymbol **isympp); -+ - void bfd_update_compression_header - (bfd *abfd, bfd_byte *contents, asection *sec); - ---- binutils-2.26.orig/bfd/bfd.c 2016-01-25 10:28:36.444573391 +0000 -+++ binutils-2.26/bfd/bfd.c 2016-01-25 10:32:20.635947052 +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. *} -@@ -347,6 +355,9 @@ CODE_FRAGMENT - . - . {* For input BFDs, the build ID, if the object has one. *} - . const struct bfd_build_id *build_id; -+. -+. {* LTO object type. *} -+. unsigned int lto_type : 2; - .}; - . - .{* See note beside bfd_set_section_userdata. *} -@@ -1962,6 +1973,39 @@ bfd_demangle (bfd *abfd, const char *nam - } - - /* -+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; -+} -+ -+/* - FUNCTION - bfd_update_compression_header - ---- binutils-2.26.orig/ld/emultempl/ppc32elf.em 2016-01-25 12:41:21.857975805 +0000 -+++ binutils-2.26/ld/emultempl/ppc32elf.em 2016-01-25 12:43:56.424910846 +0000 -@@ -215,7 +215,7 @@ ppc_finish (void) - { - if (params.ppc476_workaround) - lang_for_each_statement (no_zero_padding); -- finish_default (); -+ gld${EMULATION_NAME}_finish (); - } - - EOF ---- binutils-2.26.orig/ld/emultempl/avrelf.em 2016-01-26 11:00:32.210889045 +0000 -+++ binutils-2.26/ld/emultempl/avrelf.em 2016-01-26 11:00:41.222943557 +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 --git a/binutils-2.25.1-aarch64-pr18668.patch b/binutils-2.25.1-aarch64-pr18668.patch deleted file mode 100644 index 2d2b9aa..0000000 --- a/binutils-2.25.1-aarch64-pr18668.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- binutils-2.25.1.orif/bfd/elfnn-aarch64.c 2015-09-11 18:23:24.318028989 +0100 -+++ binutils-2.25.1/bfd/elfnn-aarch64.c 2015-09-11 18:23:35.510092848 +0100 -@@ -2207,9 +2207,11 @@ aarch64_type_of_stub (struct bfd_link_in - globals = elf_aarch64_hash_table (info); - via_plt_p = (globals->root.splt != NULL && hash != NULL - && hash->root.plt.offset != (bfd_vma) - 1); -- -+ /* Make sure call to plt stub can fit into the branch range. */ - if (via_plt_p) -- return stub_type; -+ destination = (globals->root.splt->output_section->vma -+ + globals->root.splt->output_offset -+ + hash->root.plt.offset); - - /* Determine where the call point is. */ - location = (input_sec->output_offset -@@ -4392,38 +4394,25 @@ elfNN_aarch64_final_link_relocate (reloc - /* If the call goes through a PLT entry, make sure to - check distance to the right destination address. */ - if (via_plt_p) -- { -- value = (splt->output_section->vma -- + splt->output_offset + h->plt.offset); -- *unresolved_reloc_p = FALSE; -- } -+ value = (splt->output_section->vma -+ + splt->output_offset + h->plt.offset); - -- /* If the target symbol is global and marked as a function the -- relocation applies a function call or a tail call. In this -- situation we can veneer out of range branches. The veneers -- use IP0 and IP1 hence cannot be used arbitrary out of range -- branches that occur within the body of a function. */ -- if (h && h->type == STT_FUNC) -- { -- /* Check if a stub has to be inserted because the destination -- is too far away. */ -- if (! aarch64_valid_branch_p (value, place)) -- { -- /* The target is out of reach, so redirect the branch to -- the local stub for this function. */ -- struct elf_aarch64_stub_hash_entry *stub_entry; -- stub_entry = elfNN_aarch64_get_stub_entry (input_section, -- sym_sec, h, -- rel, globals); -- if (stub_entry != NULL) -- value = (stub_entry->stub_offset -- + stub_entry->stub_sec->output_offset -- + stub_entry->stub_sec->output_section->vma); -- } -- } -+ /* Check if a stub has to be inserted because the destination -+ is too far away. */ -+ struct elf_aarch64_stub_hash_entry *stub_entry = NULL; -+ if (! aarch64_valid_branch_p (value, place)) -+ /* The target is out of reach, so redirect the branch to -+ the local stub for this function. */ -+ stub_entry = elfNN_aarch64_get_stub_entry (input_section, sym_sec, h, -+ rel, globals); -+ if (stub_entry != NULL) -+ value = (stub_entry->stub_offset -+ + stub_entry->stub_sec->output_offset -+ + stub_entry->stub_sec->output_section->vma); - } - value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value, - signed_addend, weak_undef_p); -+ *unresolved_reloc_p = FALSE; - break; - - case BFD_RELOC_AARCH64_ADR_LO21_PCREL: diff --git a/binutils-2.25.1-cleansweep.patch b/binutils-2.25.1-cleansweep.patch index a121f99..2603d13 100644 --- a/binutils-2.25.1-cleansweep.patch +++ b/binutils-2.25.1-cleansweep.patch @@ -12,22 +12,6 @@ # 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" ---- ../binutils-2.26.orig/binutils/ar.c 2016-01-25 11:16:43.491152038 +0000 -+++ binutils/ar.c 2016-01-25 11:18:22.209750390 +0000 -@@ -768,11 +768,11 @@ main (int argc, char **argv) - - if (newer_only && deterministic > 0) - fatal (_("`u' is not meaningful with the `D' option.")); -- -+#if 0 - if (newer_only && deterministic < 0 && DEFAULT_AR_DETERMINISTIC) - non_fatal (_("\ - `u' modifier ignored since `D' is the default (see `U')")); -- -+#endif - default_deterministic (); - - if (postype != pos_default) --- ../binutils-2.26.orig/ld/testsuite/ld-size/size.exp 2016-01-27 15:51:27.223093570 +0000 +++ ld/testsuite/ld-size/size.exp 2016-01-27 16:00:04.262015016 +0000 @@ -113,37 +113,6 @@ run_cc_link_tests [list \ diff --git a/binutils-2.25.1-dynamic_list.patch b/binutils-2.25.1-dynamic_list.patch deleted file mode 100644 index 0d35735..0000000 --- a/binutils-2.25.1-dynamic_list.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff -up binutils-2.25.1/gold/layout.cc.dynamic_list~ binutils-2.25.1/gold/layout.cc ---- binutils-2.25.1/gold/layout.cc.dynamic_list~ 2014-10-14 02:32:04.000000000 -0500 -+++ binutils-2.25.1/gold/layout.cc 2015-08-06 10:45:35.022531546 -0500 -@@ -4857,7 +4857,8 @@ Layout::finish_dynamic_section(const Inp - flags |= elfcpp::DF_STATIC_TLS; - if (parameters->options().origin()) - flags |= elfcpp::DF_ORIGIN; -- if (parameters->options().Bsymbolic()) -+ if (parameters->options().Bsymbolic() -+ && !parameters->options().have_dynamic_list()) - { - flags |= elfcpp::DF_SYMBOLIC; - // Add DT_SYMBOLIC for compatibility with older loaders. -diff -up binutils-2.25.1/gold/options.cc.dynamic_list~ binutils-2.25.1/gold/options.cc ---- binutils-2.25.1/gold/options.cc.dynamic_list~ 2014-10-14 02:32:04.000000000 -0500 -+++ binutils-2.25.1/gold/options.cc 2015-08-06 10:45:35.023531554 -0500 -@@ -1200,13 +1200,6 @@ General_options::finalize() - // in the path, as appropriate. - this->add_sysroot(); - -- // --dynamic-list overrides -Bsymbolic and -Bsymbolic-functions. -- if (this->have_dynamic_list()) -- { -- this->set_Bsymbolic(false); -- this->set_Bsymbolic_functions(false); -- } -- - // Now that we've normalized the options, check for contradictory ones. - if (this->shared() && this->is_static()) - gold_fatal(_("-shared and -static are incompatible")); -diff -up binutils-2.25.1/gold/symtab.h.dynamic_list~ binutils-2.25.1/gold/symtab.h ---- binutils-2.25.1/gold/symtab.h.dynamic_list~ 2014-10-14 02:32:04.000000000 -0500 -+++ binutils-2.25.1/gold/symtab.h 2015-08-06 10:45:35.023531554 -0500 -@@ -604,10 +604,8 @@ class Symbol - if (parameters->options().in_dynamic_list(this->name())) - return true; - -- // If the user used -Bsymbolic or provided a --dynamic-list script, -- // then nothing (else) is preemptible. -- if (parameters->options().Bsymbolic() -- || parameters->options().have_dynamic_list()) -+ // If the user used -Bsymbolic, then nothing (else) is preemptible. -+ if (parameters->options().Bsymbolic()) - return false; - - // If the user used -Bsymbolic-functions, then functions are not -diff -up binutils-2.25.1/gold/testsuite/Makefile.am.dynamic_list~ binutils-2.25.1/gold/testsuite/Makefile.am ---- binutils-2.25.1/gold/testsuite/Makefile.am.dynamic_list~ 2015-07-21 03:20:58.000000000 -0500 -+++ binutils-2.25.1/gold/testsuite/Makefile.am 2015-08-06 10:45:35.024531563 -0500 -@@ -1516,7 +1516,7 @@ dynamic_list_lib1.o: dynamic_list_lib1.c - $(CXXCOMPILE) -c -fpic -o $@ $< - - dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t -- $(CXXLINK) -Bgcctestdir/ -shared -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o -+ $(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o - dynamic_list_lib2.o: dynamic_list_lib2.cc - $(CXXCOMPILE) -c -fpic -o $@ $< - -diff -up binutils-2.25.1/gold/testsuite/Makefile.in.dynamic_list~ binutils-2.25.1/gold/testsuite/Makefile.in ---- binutils-2.25.1/gold/testsuite/Makefile.in.dynamic_list~ 2015-07-21 03:20:58.000000000 -0500 -+++ binutils-2.25.1/gold/testsuite/Makefile.in 2015-08-06 10:45:35.025531571 -0500 -@@ -5277,7 +5277,7 @@ uninstall-am: - @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $< - - @GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t --@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o -+@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o - @GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list_lib2.o: dynamic_list_lib2.cc - @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $< - diff --git a/binutils-2.25.1-ihex-parsing.patch b/binutils-2.25.1-ihex-parsing.patch deleted file mode 100644 index 4b515fd..0000000 --- a/binutils-2.25.1-ihex-parsing.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff -rup binutils-2.25.1.orig/bfd/ihex.c binutils-2.25.1/bfd/ihex.c ---- binutils-2.25.1.orig/bfd/ihex.c 2015-08-04 17:10:24.766693094 +0100 -+++ binutils-2.25.1/bfd/ihex.c 2015-08-04 17:10:44.824807881 +0100 -@@ -219,7 +219,7 @@ ihex_bad_byte (bfd *abfd, unsigned int l - char buf[10]; - - if (! ISPRINT (c)) -- sprintf (buf, "\\%03o", (unsigned int) c); -+ sprintf (buf, "\\%03o", (unsigned int) c & 0xff); - else - { - buf[0] = c; -@@ -276,7 +276,7 @@ ihex_scan (bfd *abfd) - else - { - file_ptr pos; -- char hdr[8]; -+ unsigned char hdr[8]; - unsigned int i; - unsigned int len; - bfd_vma addr; -@@ -553,7 +553,7 @@ ihex_read_section (bfd *abfd, asection * - error = FALSE; - while ((c = ihex_get_byte (abfd, &error)) != EOF) - { -- char hdr[8]; -+ unsigned char hdr[8]; - unsigned int len; - unsigned int type; - unsigned int i; -diff -rup binutils-2.25.1.orig/bfd/srec.c binutils-2.25.1/bfd/srec.c ---- binutils-2.25.1.orig/bfd/srec.c 2015-08-04 17:10:24.774693139 +0100 -+++ binutils-2.25.1/bfd/srec.c 2015-08-04 17:10:44.824807881 +0100 -@@ -249,7 +249,7 @@ srec_bad_byte (bfd *abfd, - char buf[40]; - - if (! ISPRINT (c)) -- sprintf (buf, "\\%03o", (unsigned int) c); -+ sprintf (buf, "\\%03o", (unsigned int) c & 0xff); - else - { - buf[0] = c; -diff -rup binutils-2.25.1.orig/binutils/readelf.c binutils-2.25.1/binutils/readelf.c ---- binutils-2.25.1.orig/binutils/readelf.c 2015-08-04 17:10:24.856693609 +0100 -+++ binutils-2.25.1/binutils/readelf.c 2015-08-04 17:10:44.829807910 +0100 -@@ -13838,7 +13838,7 @@ process_mips_specific (FILE * file) - len = sizeof (* eopt); - while (len < option->size) - { -- char datum = * ((char *) eopt + offset + len); -+ unsigned char datum = * ((unsigned char *) eopt + offset + len); - - if (ISPRINT (datum)) - printf ("%c", datum); -Only in binutils-2.25.1/binutils: readelf.c.orig diff --git a/binutils-2.25.1-plugin-format-checking.patch b/binutils-2.25.1-plugin-format-checking.patch deleted file mode 100644 index 127c0b2..0000000 --- a/binutils-2.25.1-plugin-format-checking.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff -rup binutils-2.25.1.orig/bfd/plugin.c binutils-2.25.1/bfd/plugin.c ---- binutils-2.25.1.orig/bfd/plugin.c 2015-11-05 11:40:58.400941923 +0000 -+++ binutils-2.25.1/bfd/plugin.c 2015-11-05 15:50:37.046908541 +0000 -@@ -135,8 +135,9 @@ static asection bfd_plugin_fake_common_s - = BFD_FAKE_SECTION (bfd_plugin_fake_common_section, SEC_IS_COMMON, 0, - NULL, 0); - --/* Get symbols from object only section. */ -+static bfd_boolean in_get_symbols = FALSE; - -+/* Get symbols from object only section. */ - static void - bfd_plugin_get_symbols_in_object_only (bfd *abfd) - { -@@ -153,7 +154,8 @@ bfd_plugin_get_symbols_in_object_only (b - if (abfd->sections == NULL && abfd->my_archive == NULL) - { - nbfd = bfd_openr (abfd->filename, NULL); -- if (nbfd == NULL || !bfd_check_format (nbfd, bfd_object)) -+ -+ if (nbfd == NULL) - { - (*_bfd_error_handler) - (_("%s: failed to open to extract object only section: %s"), -@@ -161,6 +163,22 @@ bfd_plugin_get_symbols_in_object_only (b - bfd_close (nbfd); - return; - } -+ else -+ { -+ /* Note that we are calling bfd_check_format from inside -+ bfd_plugin_get_symbols_in_object_only. bfd_check_format -+ will iterate through the known list of formats, including -+ the "plugin" format, and we do not want to end up in a -+ recursive loop. */ -+ in_get_symbols = TRUE; -+ if (!bfd_check_format (nbfd, bfd_object)) -+ { -+ in_get_symbols = FALSE; -+ bfd_close (nbfd); -+ return; -+ } -+ in_get_symbols = FALSE; -+ } - } - else - { -@@ -515,6 +515,12 @@ load_plugin (bfd *abfd) - static const bfd_target * - bfd_plugin_object_p (bfd *abfd) - { -+ /* If in_get_symbols is TRUE then this function is being called from -+ bfd_check_format. We do not want to iterate again - we will just -+ end up in an infinite loop. So return NULL here. */ -+ if (in_get_symbols) -+ return NULL; -+ - if (ld_plugin_object_p) - return ld_plugin_object_p (abfd); - diff --git a/binutils-2.26-bad-aliasing.patch b/binutils-2.26-bad-aliasing.patch deleted file mode 100644 index c8f2447..0000000 --- a/binutils-2.26-bad-aliasing.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff -rup binutils-2.26.orig/bfd/libaout.h binutils-2.26/bfd/libaout.h ---- binutils-2.26.orig/bfd/libaout.h 2016-03-15 09:50:29.080059305 +0000 -+++ binutils-2.26/bfd/libaout.h 2016-03-15 09:53:26.178070524 +0000 -@@ -448,9 +448,7 @@ struct aout_data_struct - #define obj_aout_sym_hashes(bfd) (adata (bfd).sym_hashes) - #define obj_aout_dynamic_info(bfd) (adata (bfd).dynamic_info) - --/* We take the address of the first element of an asymbol to ensure that the -- macro is only ever applied to an asymbol. */ --#define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd)) -+#define aout_symbol(asymbol) ((aout_symbol_type *) (asymbol)) - - /* Information we keep for each a.out section. This is currently only - used by the a.out backend linker. */ -diff -rup binutils-2.26.orig/bfd/libcoff.h binutils-2.26/bfd/libcoff.h ---- binutils-2.26.orig/bfd/libcoff.h 2016-03-15 09:50:29.080059305 +0000 -+++ binutils-2.26/bfd/libcoff.h 2016-03-15 09:54:02.826279784 +0000 -@@ -192,9 +192,7 @@ struct xcoff_tdata - - #define xcoff_data(abfd) ((abfd)->tdata.xcoff_obj_data) - --/* We take the address of the first element of an asymbol to ensure that the -- macro is only ever applied to an asymbol. */ --#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd))) -+#define coffsymbol(asymbol) ((coff_symbol_type *) (asymbol)) - - /* Tdata for sections in XCOFF files. This is used by the linker. */ - -diff -rup binutils-2.26.orig/bfd/libcoff-in.h binutils-2.26/bfd/libcoff-in.h ---- binutils-2.26.orig/bfd/libcoff-in.h 2016-03-15 09:50:29.080059305 +0000 -+++ binutils-2.26/bfd/libcoff-in.h 2016-03-15 09:53:44.989177935 +0000 -@@ -188,9 +188,7 @@ struct xcoff_tdata - - #define xcoff_data(abfd) ((abfd)->tdata.xcoff_obj_data) - --/* We take the address of the first element of an asymbol to ensure that the -- macro is only ever applied to an asymbol. */ --#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd))) -+#define coffsymbol(asymbol) ((coff_symbol_type *) (asymbol)) - - /* Tdata for sections in XCOFF files. This is used by the linker. */ - ---- binutils-2.26.orig/gas/config/obj-elf.h 2016-03-15 09:50:29.143059664 +0000 -+++ binutils-2.26/gas/config/obj-elf.h 2016-03-15 10:36:26.342646864 +0000 -@@ -93,8 +93,8 @@ extern void elf_begin (void); - #define LOCAL_LABEL_PREFIX '.' - #endif - --/* should be conditional on address size! */ --#define elf_symbol(asymbol) ((elf_symbol_type *) (&(asymbol)->the_bfd)) -+/* Should be conditional on address size! */ -+#define elf_symbol(asymbol) ((elf_symbol_type *) (asymbol)) - - #ifndef S_GET_SIZE - #define S_GET_SIZE(S) \ diff --git a/binutils-2.26-fix-compile-warnings.patch b/binutils-2.26-fix-compile-warnings.patch index 70f5060..b3e792c 100644 --- a/binutils-2.26-fix-compile-warnings.patch +++ b/binutils-2.26-fix-compile-warnings.patch @@ -36,54 +36,3 @@ // Reloc_stub methods. // Determine the type of stub needed, if any, for a relocation of R_TYPE at ---- binutils-2.26.orig/gas/config/tc-arm.c 2016-02-04 10:31:44.893794316 +0000 -+++ binutils-2.26/gas/config/tc-arm.c 2016-02-04 12:41:25.534564806 +0000 -@@ -155,10 +155,12 @@ static const arm_feature_set *object_arc - - /* Constants for known architecture features. */ - static const arm_feature_set fpu_default = FPU_DEFAULT; --static const arm_feature_set fpu_arch_vfp_v1 = FPU_ARCH_VFP_V1; - static const arm_feature_set fpu_arch_vfp_v2 = FPU_ARCH_VFP_V2; -+#if 0 -+static const arm_feature_set fpu_arch_vfp_v1 = FPU_ARCH_VFP_V1; - static const arm_feature_set fpu_arch_vfp_v3 = FPU_ARCH_VFP_V3; - static const arm_feature_set fpu_arch_neon_v1 = FPU_ARCH_NEON_V1; -+#endif - static const arm_feature_set fpu_arch_fpa = FPU_ARCH_FPA; - static const arm_feature_set fpu_any_hard = FPU_ANY_HARD; - static const arm_feature_set fpu_arch_maverick = FPU_ARCH_MAVERICK; -@@ -210,7 +212,9 @@ static const arm_feature_set arm_ext_vir - static const arm_feature_set arm_ext_pan = ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN); - - static const arm_feature_set arm_arch_any = ARM_ANY; -+#if 0 - static const arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1, -1); -+#endif - static const arm_feature_set arm_arch_t2 = ARM_ARCH_THUMB2; - static const arm_feature_set arm_arch_none = ARM_ARCH_NONE; - static const arm_feature_set arm_arch_v6m_only = ARM_ARCH_V6M_ONLY; -@@ -259,8 +263,10 @@ static const arm_feature_set fpu_crypto_ - ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8); - static const arm_feature_set crc_ext_armv8 = - ARM_FEATURE_COPROC (CRC_EXT_ARMV8); -+#if 0 - static const arm_feature_set fpu_neon_ext_v8_1 = - ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8 | FPU_NEON_EXT_RDMA); -+#endif - - static int mfloat_abi_opt = -1; - /* Record user cpu selection for object attributes. */ ---- binutils-2.26.orig/gas/config/tc-arm.c 2016-05-09 17:21:37.239766096 +0100 -+++ binutils-2.26/gas/config/tc-arm.c 2016-05-09 17:23:08.410319859 +0100 -@@ -1982,6 +1982,11 @@ parse_neon_el_struct_list (char **str, u - const char *const type_error = _("mismatched element/structure types in list"); - struct neon_typed_alias firsttype; - -+ firsttype.defined = 0; -+ firsttype.eltype.type = NT_invtype; -+ firsttype.eltype.size = -1; -+ firsttype.index = -1; -+ - if (skip_past_char (&ptr, '{') == SUCCESS) - leading_brace = 1; - diff --git a/binutils-2.26-formatting.patch b/binutils-2.26-formatting.patch deleted file mode 100644 index 83677d6..0000000 --- a/binutils-2.26-formatting.patch +++ /dev/null @@ -1,110 +0,0 @@ ---- ../binutils-2.26.orig/bfd/elf64-s390.c 2016-02-09 15:01:11.983640775 +0000 -+++ bfd/elf64-s390.c 2016-02-09 15:01:37.675779605 +0000 -@@ -337,10 +337,10 @@ elf_s390_reloc_name_lookup (bfd *abfd AT - && strcasecmp (elf_howto_table[i].name, r_name) == 0) - return &elf_howto_table[i]; - -- if (strcasecmp (elf64_s390_vtinherit_howto.name, r_name) == 0) -- return &elf64_s390_vtinherit_howto; -- if (strcasecmp (elf64_s390_vtentry_howto.name, r_name) == 0) -- return &elf64_s390_vtentry_howto; -+ if (strcasecmp (elf64_s390_vtinherit_howto.name, r_name) == 0) -+ return &elf64_s390_vtinherit_howto; -+ if (strcasecmp (elf64_s390_vtentry_howto.name, r_name) == 0) -+ return &elf64_s390_vtentry_howto; - - return NULL; - } ---- ../binutils-2.26.orig/bfd/pe-mips.c 2016-02-09 15:01:11.995640840 +0000 -+++ bfd/pe-mips.c 2016-02-09 15:31:21.348317265 +0000 -@@ -95,44 +95,44 @@ coff_mips_reloc (bfd *abfd, - #define DOIT(x) \ - x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + (diff >> howto->rightshift)) & howto->dst_mask)) - -- if (diff != 0) -- { -- reloc_howto_type *howto = reloc_entry->howto; -- unsigned char *addr = (unsigned char *) data + reloc_entry->address; -+ if (diff != 0) -+ { -+ reloc_howto_type *howto = reloc_entry->howto; -+ unsigned char *addr = (unsigned char *) data + reloc_entry->address; -+ -+ switch (howto->size) -+ { -+ case 0: -+ { -+ char x = bfd_get_8 (abfd, addr); -+ -+ DOIT (x); -+ bfd_put_8 (abfd, x, addr); -+ } -+ break; -+ -+ case 1: -+ { -+ short x = bfd_get_16 (abfd, addr); -+ -+ DOIT (x); -+ bfd_put_16 (abfd, (bfd_vma) x, addr); -+ } -+ break; - -- switch (howto->size) -+ case 2: - { -- case 0: -- { -- char x = bfd_get_8 (abfd, addr); -- -- DOIT (x); -- bfd_put_8 (abfd, x, addr); -- } -- break; -- -- case 1: -- { -- short x = bfd_get_16 (abfd, addr); -- -- DOIT (x); -- bfd_put_16 (abfd, (bfd_vma) x, addr); -- } -- break; -- -- case 2: -- { -- long x = bfd_get_32 (abfd, addr); -- -- DOIT (x); -- bfd_put_32 (abfd, (bfd_vma) x, addr); -- } -- break; -+ long x = bfd_get_32 (abfd, addr); - -- default: -- abort (); -+ DOIT (x); -+ bfd_put_32 (abfd, (bfd_vma) x, addr); - } -- } -+ break; -+ -+ default: -+ abort (); -+ } -+ } - - /* Now let bfd_perform_relocation finish everything up. */ - return bfd_reloc_continue; ---- ../binutils-2.26.orig/gas/config/tc-ia64.c 2016-02-09 15:01:12.086641332 +0000 -+++ gas/config/tc-ia64.c 2016-02-09 15:30:18.562003661 +0000 -@@ -4360,7 +4360,8 @@ dot_prologue (int dummy ATTRIBUTE_UNUSED - as_warn (_("Pointless use of zero first operand to .prologue")); - else - mask = e.X_add_number; -- n = popcount (mask); -+ -+ n = popcount (mask); - - if (sep == ',') - parse_operand_and_eval (&e, 0); diff --git a/binutils-2.26-lto.patch b/binutils-2.26-lto.patch index 3705459..567f909 100644 --- a/binutils-2.26-lto.patch +++ b/binutils-2.26-lto.patch @@ -556,58 +556,6 @@ diff -rup binutils-2.26.orig/bfd/section.c binutils-2.26/bfd/section.c .{* 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/objcopy.c binutils-2.26/binutils/objcopy.c ---- binutils-2.26.orig/binutils/objcopy.c 2016-02-19 09:35:36.287000943 +0000 -+++ binutils-2.26/binutils/objcopy.c 2016-02-19 09:35:54.908106537 +0000 -@@ -1108,30 +1108,6 @@ is_specified_symbol (const char *name, h - return htab_find (htab, name) != NULL; - } - --/* Return a pointer to the symbol used as a signature for GROUP. */ -- --static asymbol * --group_signature (asection *group) --{ -- 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; --} -- - /* Return TRUE if the section is a DWO section. */ - - static bfd_boolean -@@ -1237,7 +1213,7 @@ is_strip_section (bfd *abfd ATTRIBUTE_UN - /* PR binutils/3181 - If we are going to strip the group signature symbol, then - strip the group section too. */ -- gsym = group_signature (sec); -+ gsym = bfd_group_signature (sec, isympp); - if (gsym != NULL) - gname = gsym->name; - else -@@ -3091,7 +3067,7 @@ setup_section (bfd *ibfd, sec_ptr isecti - - if ((isection->flags & SEC_GROUP) != 0) - { -- asymbol *gsym = group_signature (isection); -+ asymbol *gsym = bfd_group_signature (isection, isympp); - - if (gsym != NULL) - { 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 @@ -724,8 +672,9 @@ diff -rup binutils-2.26.orig/ld/emultempl/armelf.em binutils-2.26/ld/emultempl/a if (thumb_entry_symbol) { -@@ -730,4 +730,4 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS= +@@ -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 @@ -998,17 +947,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) & (((TYPE*) 0)->MEMBER)) #endif -@@ -68,6 +72,9 @@ static lang_statement_list_type *stat_sa - static lang_statement_list_type **stat_save_ptr = &stat_save[0]; - static struct unique_sections *unique_section_list; - static struct asneeded_minfo *asneeded_list_head; -+static cmdline_list_type cmdline_object_only_file_list; -+static cmdline_list_type cmdline_object_only_archive_list; -+static cmdline_list_type cmdline_temp_object_only_list; - - /* Forward declarations. */ - static void exp_init_os (etree_type *); -@@ -86,6 +93,10 @@ static void lang_do_version_exports_sect +@@ -86,6 +93,13 @@ static void lang_do_version_exports_sect static void lang_finalize_version_expr_head (struct bfd_elf_version_expr_head *); static void lang_do_memory_regions (void); @@ -1016,6 +955,9 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c +static void cmdline_get_object_only_input_files (void); +static void print_cmdline_list (cmdline_union_type *); +static bfd_boolean cmdline_on_object_only_archive_list_p (bfd *); ++static cmdline_list_type cmdline_object_only_file_list; ++static cmdline_list_type cmdline_object_only_archive_list; ++static cmdline_list_type cmdline_temp_object_only_list; /* Exported variables. */ const char *output_target; @@ -1052,7 +994,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c subsbfd = member; if (!(*link_info.callbacks ->add_archive_element) (&link_info, member, -@@ -6780,7 +6800,38 @@ lang_process (void) +@@ -6780,10 +6800,41 @@ lang_process (void) open_input_bfds (statement_list.head, OPEN_BFD_RESCAN); } } @@ -1089,9 +1031,12 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + } + } + /* Make sure that nobody has tried to add a symbol to this list + before now. */ + ASSERT (link_info.gc_sym_list == NULL); + link_info.gc_sym_list = &entry_symbol; - if (entry_symbol.name == NULL) -@@ -8275,3 +8326,965 @@ lang_print_memory_usage (void) +@@ -8275,3 +8326,968 @@ lang_print_memory_usage (void) printf (" %6.2f%%\n", percent); } } @@ -1170,7 +1115,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + bfd *archive, *obfd, *oarchive; + ufile_ptr origin = abfd->origin; + -+ archive = bfd_my_archive (abfd); ++ archive = abfd->my_archive; + for (c = cmdline_object_only_archive_list.head; c != NULL; c = next) + { + if (c->header.type != cmdline_is_bfd_enum) @@ -1178,7 +1123,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + + next = c->header.next; + obfd = c->abfd.abfd; -+ oarchive = bfd_my_archive (obfd); ++ oarchive = obfd->my_archive; + + /* The list is grouped by archive file name and sorted by member + origin. */ @@ -1215,7 +1160,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + abort (); + case cmdline_is_bfd_enum: + abfd = (bfd *) data; -+ archive = bfd_my_archive (abfd); ++ archive = abfd->my_archive; + if (archive) + break; + case cmdline_is_file_enum: @@ -1248,7 +1193,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + next = c->header.next; + + obfd = c->abfd.abfd; -+ oarchive = bfd_my_archive (obfd); ++ oarchive = abfd->my_archive; + + if (strcmp (archive->filename, oarchive->filename) == 0) + { @@ -1281,7 +1226,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + break; + } + -+ narchive = bfd_my_archive (nbfd); ++ narchive = nbfd->my_archive; + if (strcmp (archive->filename, narchive->filename) != 0) + { + /* Insert it befor NEXT. */ @@ -1338,7 +1283,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + break; + case cmdline_is_bfd_enum: + abfd = c->abfd.abfd; -+ if (bfd_my_archive (abfd)) ++ if (abfd->my_archive) + abort (); + lang_add_input_file (abfd->filename, + lang_input_file_is_file_enum, NULL); @@ -1354,7 +1299,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + next = c->header.next; + + abfd = c->abfd.abfd; -+ archive = bfd_my_archive (abfd); ++ archive = abfd->my_archive; + + /* Add the first archive of the archive member group. */ + lang_add_input_file (archive->filename, @@ -1373,7 +1318,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + if (!next) + break; + nbfd = next->abfd.abfd; -+ narchive = bfd_my_archive (nbfd); ++ narchive = nbfd->my_archive; + } + while (strcmp (archive->filename, narchive->filename) == 0); + } @@ -1813,7 +1758,10 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c + if (obfd) + bfd_close (obfd); + if (ofilename) -+ unlink (ofilename); ++ { ++ unlink (ofilename); ++ free (ofilename); ++ } + einfo (_("%P%F: failed to add object-only section: %s\n"), err); +} + @@ -2069,10 +2017,13 @@ diff -rup binutils-2.26.orig/ld/ldlang.h binutils-2.26/ld/ldlang.h extern void lang_finish (void); extern lang_memory_region_type * lang_memory_region_lookup -@@ -693,4 +693,45 @@ lang_ld_feature (char *); +@@ -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, @@ -2196,7 +2147,7 @@ diff -rup binutils-2.26.orig/ld/ldmain.c binutils-2.26/ld/ldmain.c /* 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)) + if (!bfd_close (link_info.output_bfd)) einfo (_("%F%B: final close failed: %E\n"), link_info.output_bfd); + link_info.output_bfd = NULL; @@ -2318,7 +2269,7 @@ diff -rup binutils-2.26.orig/ld/plugin.c binutils-2.26/ld/plugin.c + /* Discard the real file's BFD and substitute the dummy one. */ - /* BFD archive handling caches elements so we can't call + /* 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) @@ -2553,3 +2504,53 @@ diff -rup binutils-2.26.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.26/ld/tes 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/binutils-2.27-arm-aarch64-default-relro.patch b/binutils-2.27-arm-aarch64-default-relro.patch new file mode 100644 index 0000000..296800e --- /dev/null +++ b/binutils-2.27-arm-aarch64-default-relro.patch @@ -0,0 +1,20 @@ +--- binutils-2.27.orig/ld/emultempl/aarch64elf.em 2016-08-19 11:53:37.647284625 +0100 ++++ binutils-2.27/ld/emultempl/aarch64elf.em 2016-08-19 11:54:41.916673347 +0100 +@@ -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 +--- binutils-2.27.orig/ld/emultempl/armelf.em 2016-08-19 11:53:37.647284625 +0100 ++++ binutils-2.27/ld/emultempl/armelf.em 2016-08-19 11:54:51.035728502 +0100 +@@ -52,6 +52,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/binutils-2.27-local-dynsym-count.patch b/binutils-2.27-local-dynsym-count.patch new file mode 100644 index 0000000..7b27255 --- /dev/null +++ b/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/binutils-2.27-monotonic-section-offsets.patch b/binutils-2.27-monotonic-section-offsets.patch new file mode 100644 index 0000000..09df9f7 --- /dev/null +++ b/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/binutils-rh1247126.patch b/binutils-rh1247126.patch deleted file mode 100644 index a7c13d3..0000000 --- a/binutils-rh1247126.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -Nrup a/bfd/elf.c b/bfd/elf.c ---- a/bfd/elf.c 2015-07-28 10:52:10.941754850 -0600 -+++ b/bfd/elf.c 2015-07-28 10:53:34.725982912 -0600 -@@ -4081,11 +4081,18 @@ _bfd_elf_map_sections_to_segments (bfd * - new_segment = TRUE; - } - else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0 -- && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0) -+ && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0 -+ && ((abfd->flags & D_PAGED) == 0 -+ || (((last_hdr->lma + last_size - 1) & -maxpagesize) -+ != (hdr->lma & -maxpagesize)))) - { -- /* We don't want to put a loadable section after a -- nonloadable section in the same segment. -- Consider .tbss sections as loadable for this purpose. */ -+ /* We don't want to put a loaded section after a -+ nonloaded (ie. bss style) section in the same segment -+ as that will force the non-loaded section to be loaded. -+ Consider .tbss sections as loaded for this purpose. -+ However, like the writable/non-writable case below, -+ if they are on the same page then they must be put -+ in the same segment. */ - new_segment = TRUE; - } - else if ((abfd->flags & D_PAGED) == 0) diff --git a/cross-binutils-2.26-c6x-relax-cfi.patch b/cross-binutils-2.26-c6x-relax-cfi.patch deleted file mode 100644 index a9ee7ce..0000000 --- a/cross-binutils-2.26-c6x-relax-cfi.patch +++ /dev/null @@ -1,123 +0,0 @@ -commit bd5608dcc6a76876db06b1af1852252a4282aa2f -Author: Nick Clifton -Date: Thu Feb 11 15:30:55 2016 +0000 - - Allow the .cfi_sections directive to be reissued provided that CFI generation has not yet started. - - PR gas/19614 - * dw2gencfi.c (cfi_sections_set): Delay setting this variable - until it is actually used. - (cfi_set_sections): Set cfi_sections_set to true. - (dot_cfi_startproc): Likewise. - (dot_cfi_endproc): Likewise. - (dot_cfi_fde_data): Likewise. - (cfi_finish): Likewise. - (dot_cfi_sections): Do not set cfi_sections_set. - * doc/as.texinfo (.cfi_sections): Note that targets can provide - their own cfi section name. Also note that the directive can be - reissued provided that CFI generation has not started. - * testsuite/gas/mips/compact-eh-err2.s: Add .cfi_startproc and - .cfi_endproc directives so that the redefinition of .cfi_sections - will trigger the generation of the error message. - * testsuite/gas/mips/compact-eh-err2.l: Update expected line - number of error message. - -diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo -index 90611a3..917781b 100644 ---- a/gas/doc/as.texinfo -+++ b/gas/doc/as.texinfo -@@ -4683,6 +4683,14 @@ directive is not used is @code{.cfi_sections .eh_frame}. - On targets that support compact unwinding tables these can be generated - by specifying @code{.eh_frame_entry} instead of @code{.eh_frame}. - -+Some targets may support an additional name, such as @code{.c6xabi.exidx} -+which is used by the @value{TIC6X} target. -+ -+The @code{.cfi_sections} directive can be repeated, with the same or different -+arguments, provided that CFI generation has not yet started. Once CFI -+generation has started however the section list is fixed and any attempts to -+redefine it will result in an error. -+ - @subsection @code{.cfi_startproc [simple]} - @cindex @code{cfi_startproc} directive - @code{.cfi_startproc} is used at the beginning of each function that -diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c -index 195013b..c66402d 100644 ---- a/gas/dw2gencfi.c -+++ b/gas/dw2gencfi.c -@@ -509,6 +509,7 @@ void - cfi_set_sections (void) - { - frchain_now->frch_cfi_data->cur_fde_data->sections = all_cfi_sections; -+ cfi_sections_set = TRUE; - } - - /* Universal functions to store new instructions. */ -@@ -1248,7 +1249,6 @@ dot_cfi_sections (int ignored ATTRIBUTE_UNUSED) - demand_empty_rest_of_line (); - if (cfi_sections_set && cfi_sections != sections) - as_bad (_("inconsistent uses of .cfi_sections")); -- cfi_sections_set = TRUE; - cfi_sections = sections; - } - -@@ -1284,6 +1284,7 @@ dot_cfi_startproc (int ignored ATTRIBUTE_UNUSED) - } - demand_empty_rest_of_line (); - -+ cfi_sections_set = TRUE; - all_cfi_sections |= cfi_sections; - cfi_set_sections (); - frchain_now->frch_cfi_data->cur_cfa_offset = 0; -@@ -1310,6 +1311,7 @@ dot_cfi_endproc (int ignored ATTRIBUTE_UNUSED) - - demand_empty_rest_of_line (); - -+ cfi_sections_set = TRUE; - if ((cfi_sections & CFI_EMIT_target) != 0) - tc_cfi_endproc (last_fde); - } -@@ -1372,6 +1374,7 @@ dot_cfi_fde_data (int ignored ATTRIBUTE_UNUSED) - - last_fde = frchain_now->frch_cfi_data->cur_fde_data; - -+ cfi_sections_set = TRUE; - if ((cfi_sections & CFI_EMIT_target) != 0 - || (cfi_sections & CFI_EMIT_eh_frame_compact) != 0) - { -@@ -2223,6 +2226,7 @@ cfi_finish (void) - if (all_fde_data == 0) - return; - -+ cfi_sections_set = TRUE; - if ((all_cfi_sections & CFI_EMIT_eh_frame) != 0 - || (all_cfi_sections & CFI_EMIT_eh_frame_compact) != 0) - { -@@ -2408,6 +2412,7 @@ cfi_finish (void) - flag_traditional_format = save_flag_traditional_format; - } - -+ cfi_sections_set = TRUE; - if ((all_cfi_sections & CFI_EMIT_debug_frame) != 0) - { - int alignment = ffs (DWARF2_ADDR_SIZE (stdoutput)) - 1; -diff --git a/gas/testsuite/gas/mips/compact-eh-err2.l b/gas/testsuite/gas/mips/compact-eh-err2.l -index c52976a..11e9b8e 100644 ---- a/gas/testsuite/gas/mips/compact-eh-err2.l -+++ b/gas/testsuite/gas/mips/compact-eh-err2.l -@@ -1,2 +1,2 @@ - .*: Assembler messages: --.*:7: Error: inconsistent uses of .cfi_sections -+.*:8: Error: inconsistent uses of .cfi_sections -diff --git a/gas/testsuite/gas/mips/compact-eh-err2.s b/gas/testsuite/gas/mips/compact-eh-err2.s -index acf83d1..2ce265a 100644 ---- a/gas/testsuite/gas/mips/compact-eh-err2.s -+++ b/gas/testsuite/gas/mips/compact-eh-err2.s -@@ -4,4 +4,7 @@ - .align 2 - .globl _Z3fooi - .cfi_sections .eh_frame_entry -+ .cfi_startproc - .cfi_sections .eh_frame -+ .cfi_endproc -+ diff --git a/cross-binutils-2.26-fixup-microblaze.patch b/cross-binutils-2.26-fixup-microblaze.patch deleted file mode 100644 index 027c4a4..0000000 --- a/cross-binutils-2.26-fixup-microblaze.patch +++ /dev/null @@ -1,26 +0,0 @@ -commit ac0d427f4b3a2b82dcf395da74fdbc71ee598095 -Author: Nick Clifton -Date: Mon Feb 1 11:36:59 2016 +0000 - - Fix error building Microblaze assembler on a 32-bit host. - - * config/tc-microblaze.c (parse_imm): Fix compile time warning - message extending a negative 32-bit value into a larger signed - value on a 32-bit host. - -diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c -index 01341d4..5484b30 100644 ---- a/gas/config/tc-microblaze.c -+++ b/gas/config/tc-microblaze.c -@@ -737,9 +737,9 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max) - as_fatal (_("operand must be a constant or a label")); - else if (e->X_op == O_constant) - { -- /* Special case: sign extend negative 32-bit values to 64-bits. */ -+ /* Special case: sign extend negative 32-bit values to offsetT size. */ - if ((e->X_add_number >> 31) == 1) -- e->X_add_number |= -((offsetT) 1 << 31); -+ e->X_add_number |= -((addressT) (1U << 31)); - - if (e->X_add_number < min || e->X_add_number > max) - { diff --git a/cross-binutils-2.26-i386-warn.patch b/cross-binutils-2.26-i386-warn.patch deleted file mode 100644 index 8bd69ab..0000000 --- a/cross-binutils-2.26-i386-warn.patch +++ /dev/null @@ -1,52 +0,0 @@ -commit a28def75916fb4fa8280404f8c023adc0773162d -Author: H.J. Lu -Date: Fri Dec 18 14:03:43 2015 -0800 - - Process 64-bit imm/disp only for 64-bit BFD - - We only need to store 32-bit immediate in 64-bit and optimize 64-bit - displacement to 32-bit only for 64-bit BFD. - - * config/tc-i386.c (optimize_imm): Store 32-bit immediate in - 64-bit only for 64-bit BFD - (optimize_disp): Optimize 64-bit displacement to 32-bit only - for 64-bit BFD. - -diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c -index 1573043..4940a80 100644 ---- a/gas/config/tc-i386.c -+++ b/gas/config/tc-i386.c -@@ -4218,6 +4218,8 @@ optimize_imm (void) - i.op[op].imms->X_add_number = - (((i.op[op].imms->X_add_number & 0xffff) ^ 0x8000) - 0x8000); - } -+#ifdef BFD64 -+ /* Store 32-bit immediate in 64-bit for 64-bit BFD. */ - if ((i.types[op].bitfield.imm32) - && ((i.op[op].imms->X_add_number & ~(((offsetT) 2 << 31) - 1)) - == 0)) -@@ -4226,6 +4228,7 @@ optimize_imm (void) - ^ ((offsetT) 1 << 31)) - - ((offsetT) 1 << 31)); - } -+#endif - i.types[op] - = operand_type_or (i.types[op], - smallest_imm_type (i.op[op].imms->X_add_number)); -@@ -4306,6 +4309,8 @@ optimize_disp (void) - op_disp = (((op_disp & 0xffff) ^ 0x8000) - 0x8000); - i.types[op].bitfield.disp64 = 0; - } -+#ifdef BFD64 -+ /* Optimize 64-bit displacement to 32-bit for 64-bit BFD. */ - if (i.types[op].bitfield.disp32 - && (op_disp & ~(((offsetT) 2 << 31) - 1)) == 0) - { -@@ -4316,6 +4321,7 @@ optimize_disp (void) - op_disp = (op_disp ^ ((offsetT) 1 << 31)) - ((addressT) 1 << 31); - i.types[op].bitfield.disp64 = 0; - } -+#endif - if (!op_disp && i.types[op].bitfield.baseindex) - { - i.types[op].bitfield.disp8 = 0; diff --git a/cross-binutils-2.26-ia64-warn.patch b/cross-binutils-2.26-ia64-warn.patch deleted file mode 100644 index f29c235..0000000 --- a/cross-binutils-2.26-ia64-warn.patch +++ /dev/null @@ -1,36 +0,0 @@ -commit 9264d325483984f5f2cee06456d5efd3385177b6 -Author: Nick Clifton -Date: Mon Feb 8 14:51:10 2016 +0000 - - FIx formatting that triggers a new compile time warning message. - - * config/tc-ia64.c (dot_prologue): Fix formatting. - -diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c -index 570f746..f0ba4ae 100644 ---- a/gas/config/tc-ia64.c -+++ b/gas/config/tc-ia64.c -@@ -4360,12 +4360,14 @@ dot_prologue (int dummy ATTRIBUTE_UNUSED) - as_warn (_("Pointless use of zero first operand to .prologue")); - else - mask = e.X_add_number; -- n = popcount (mask); -+ -+ n = popcount (mask); - - if (sep == ',') - parse_operand_and_eval (&e, 0); - else - e.X_op = O_absent; -+ - if (e.X_op == O_constant - && e.X_add_number >= 0 - && e.X_add_number < 128) -@@ -4385,7 +4387,6 @@ dot_prologue (int dummy ATTRIBUTE_UNUSED) - as_bad (_("Second operand to .prologue must be the first of %d general registers"), n); - grsave = 0; - } -- - } - - if (mask) diff --git a/cross-binutils-2.26-nios2-warn.patch b/cross-binutils-2.26-nios2-warn.patch deleted file mode 100644 index 97a690b..0000000 --- a/cross-binutils-2.26-nios2-warn.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c ---- a/gas/config/tc-nios2.c -+++ b/gas/config/tc-nios2.c -@@ -1128,7 +1128,7 @@ nios2_check_overflow (valueT fixup, reloc_howto_type *howto) - if ((fixup & 0x80000000) > 0) - { - /* Check for negative overflow. */ -- if ((signed) fixup < ((signed) ~0 << (howto->bitsize-1))) -+ if ((signed) fixup < (signed)(~0U << (howto->bitsize-1))) - return TRUE; - } - else diff --git a/cross-binutils-2.26-s390-warn.patch b/cross-binutils-2.26-s390-warn.patch deleted file mode 100644 index b6d15f9..0000000 --- a/cross-binutils-2.26-s390-warn.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -337,10 +337,10 @@ elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, - && strcasecmp (elf_howto_table[i].name, r_name) == 0) - return &elf_howto_table[i]; - -- if (strcasecmp (elf64_s390_vtinherit_howto.name, r_name) == 0) -- return &elf64_s390_vtinherit_howto; -- if (strcasecmp (elf64_s390_vtentry_howto.name, r_name) == 0) -- return &elf64_s390_vtentry_howto; -+ if (strcasecmp (elf64_s390_vtinherit_howto.name, r_name) == 0) -+ return &elf64_s390_vtinherit_howto; -+ if (strcasecmp (elf64_s390_vtentry_howto.name, r_name) == 0) -+ return &elf64_s390_vtentry_howto; - - return NULL; - } diff --git a/cross-binutils.spec b/cross-binutils.spec index 96f68cc..86e9c78 100644 --- a/cross-binutils.spec +++ b/cross-binutils.spec @@ -28,7 +28,6 @@ %global build_s390x %{build_all} %global build_score %{build_all} %global build_sh %{build_all} -%global build_sh64 %{build_all} %global build_sparc64 %{build_all} %global build_tile %{build_all} %global build_x86_64 %{build_all} @@ -42,17 +41,22 @@ %global build_sparc 0 %global build_sh4 0 -# not available in binutils-2.24 +# Obsolete in binutils +%global build_sh64 0 + +# not available in binutils-2.27 %global build_hexagon 0 %global build_unicore32 0 # BZ 1124342: Enable deterministic archives by default. # BZ 1195883: But do not do this by default. %global enable_deterministic_archives 0 +# Disable the default generation of compressed debug sections. +%define default_compress_debug 0 Summary: A GNU collection of cross-compilation binary utilities Name: %{cross}-binutils -Version: 2.26.1 +Version: 2.27 Release: 1%{?dist} License: GPLv3+ Group: Development/Tools @@ -70,50 +74,35 @@ 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 +# patch 03 has bitrotted 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-copy-osabi.patch -Patch07: binutils-2.20.51.0.10-sec-merge-emit.patch +Patch06: binutils-2.20.51.0.10-sec-merge-emit.patch # Enable -zrelro by default: BZ #621983 -Patch08: binutils-2.22.52.0.1-relro-on-by-default.patch +Patch07: binutils-2.22.52.0.1-relro-on-by-default.patch # Local patch - export demangle.h with the binutils-devel rpm. -Patch09: binutils-2.22.52.0.1-export-demangle.h.patch +Patch08: binutils-2.22.52.0.1-export-demangle.h.patch # Disable checks that config.h has been included before system headers. BZ #845084 -Patch10: binutils-2.22.52.0.4-no-config-h-check.patch +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. -Patch11: binutils-2.23.52.0.1-addr2line-dynsymtab.patch -# H.J's convoluted kernel building patch. -# Patch12: binutils-2.25-kernel-ld-r.patch -# Correct bug introduced by patch 12 -# Patch13: binutils-2.23.2-aarch64-em.patch +Patch10: binutils-2.23.52.0.1-addr2line-dynsymtab.patch # Fix detections little endian PPC shared libraries -Patch14: binutils-2.24-ldforcele.patch -# Patch15: binutils-2.25.1-plugin-format-checking.patch -Patch16: binutils-2.25.1-cleansweep.patch -Patch17: binutils-2.26-formatting.patch -Patch18: binutils-2.26-fix-compile-warnings.patch -# Enable -Bsymbolic and -Bsymbolic-functions to PIE -# Patch19: binutils-2.26-Bsymbolic_PIE.patch +Patch11: binutils-2.24-ldforcele.patch +Patch12: binutils-2.25.1-cleansweep.patch +Patch13: binutils-2.26-fix-compile-warnings.patch # Import H.J.Lu's Kernel LTO patch. -Patch20: binutils-2.26-lto.patch -# Import fix for PR 19698 -# Patch21: binutils-rh1312151.patch -# Import fix for PR 19601 -# Patch22: binutils-2.26-fix-GOT-offset-calculation.patch -# Import fix for PR 19579 -# Patch23: binutils-2.26-common-definitions.patch -# Fix compilation under broken F24 GCC, which geneerates bogus strict aliasing violations. -# FIXME: Remove once GCC is fixed. -Patch24: binutils-2.26-bad-aliasing.patch -# Import fix for PR 19827 -# Patch25: binutils-2.26-x86-PIE-relocations.patch - +Patch14: binutils-2.26-lto.patch +# Fix computation of sh_info field for .dynsym sections +Patch15: binutils-2.27-local-dynsym-count.patch +# Put sections in a monotonically increasing order of file offset. +Patch16: binutils-2.27-monotonic-section-offsets.patch +# Make ARM and AArch64 ports properly support relro on by default. +Patch17: binutils-2.27-arm-aarch64-default-relro.patch + +%if %{build_sh64} Patch100: cross-binutils-2.25-fixup-for-sh64.patch -Patch101: cross-binutils-2.26-fixup-microblaze.patch -Patch102: cross-binutils-2.26-nios2-warn.patch -Patch103: cross-binutils-2.26-i386-warn.patch -Patch104: cross-binutils-2.26-c6x-relax-cfi.patch +%endif Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel @@ -144,6 +133,9 @@ converting addresses to file and line). Summary: Cross-build binary utility documentation and translation files Group: Development/Tools BuildArch: noarch +%if !%{build_sh64} +Obsoletes: binutils-sh64-linux-gnu +%endif %description -n %{cross}-binutils-common Documentation, manual pages and translation files for cross-build binary image generation, manipulation and query tools. @@ -226,43 +218,33 @@ cd %{srcdir} #%patch00 -p1 -b .latest-git~ %patch01 -p1 -b .libtool-lib64~ %patch02 -p1 -b .ppc64-pie~ -%ifarch ia64 -%if "%{_lib}" == "lib64" -%patch03 -p1 -b .ia64-lib64~ -%endif -%endif +# % 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 .copy-osabi~ -%patch07 -p1 -b .sec-merge-emit~ +%patch06 -p1 -b .sec-merge-emit~ %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 -%patch08 -p1 -b .relro~ +%patch07 -p1 -b .relro~ %endif -%patch09 -p1 -b .export-demangle-h~ -%patch10 -p1 -b .no-config-h-check~ -%patch11 -p1 -b .addr2line~ -# %patch12 -p1 -b .kernel-ld-r~ -# %patch13 -p1 -b .aarch64~ +%patch08 -p1 -b .export-demangle-h~ +%patch09 -p1 -b .no-config-h-check~ +%patch10 -p1 -b .addr2line~ %ifarch ppc64le -%patch14 -p1 -b .ldforcele~ +%patch11 -p1 -b .ldforcele~ %endif -# %patch15 -p1 -%patch16 -p0 -%patch17 -p0 -%patch18 -p1 -# %patch19 -p1 -%patch20 -p1 -# %patch21 -p1 -# %patch22 -p1 -# %patch23 -p1 -%patch24 -p1 -# %patch25 -p1 - +%patch12 -p0 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 + +%if %{build_sh64} %patch100 -p1 -b .sh64-fixup~ -%patch101 -p1 -b .microblaze-fixup~ -%patch102 -p1 -b .nios2-warn~ -%patch103 -p1 -b .i386-warn~ -%patch104 -p1 -b .c6x-relax~ +%endif # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -411,6 +393,11 @@ function config_target () { ;; esac + case $target in sh64-*) + CARGS="$CARGS --enable-obsolete" + ;; + esac + mkdir $build_dir cd $build_dir @@ -446,6 +433,11 @@ function config_target () { %else --enable-deterministic-archives=no \ %endif +%if %{default_compress_debug} + --enable-compressed-debug-sections=all \ +%else + --enable-compressed-debug-sections=none \ +%endif --enable-lto \ $CARGS \ --with-bugurl=http://bugzilla.redhat.com/bugzilla/ @@ -718,6 +710,10 @@ rm -rf %{buildroot} %do_files xtensa-linux-gnu %{build_xtensa} %changelog +* Wed Sep 14 2016 David Howells - 2.27-1 +- Sync with binutils-2.27-4. +- Obsolete sh64. + * Mon Jul 4 2016 David Howells - 2.26.1-1 - Sync with binutils-2.26.1-1. diff --git a/sources b/sources index 56f8e9f..6976a1c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d2b24e5b5301b7ff0207414c34c3e0fb binutils-2.26.1.tar.bz2 +2869c9bf3e60ee97c74ac2a6bf4e9d68 binutils-2.27.tar.bz2