diff --git a/binutils-2.20.51.0.10-copy-osabi.patch b/binutils-2.20.51.0.10-copy-osabi.patch index 55831ca..6bd9f3d 100644 --- a/binutils-2.20.51.0.10-copy-osabi.patch +++ b/binutils-2.20.51.0.10-copy-osabi.patch @@ -1,10 +1,9 @@ ---- a/bfd/elf.c 2010-08-10 15:04:55.000000000 +0100 -+++ b/bfd/elf.c 2010-08-10 15:05:42.000000000 +0100 -@@ -1074,6 +1074,14 @@ +--- 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 + } + } - /* Copy object attributes. */ - _bfd_elf_copy_obj_attributes (ibfd, obfd); -+ + /* 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 diff --git a/binutils-2.20.51.0.10-sec-merge-emit.patch b/binutils-2.20.51.0.10-sec-merge-emit.patch index d099143..238beb3 100644 --- a/binutils-2.20.51.0.10-sec-merge-emit.patch +++ b/binutils-2.20.51.0.10-sec-merge-emit.patch @@ -1,20 +1,11 @@ ---- a/bfd/merge.c 2010-08-20 12:19:33.000000000 +0100 -+++ b/bfd/merge.c 2010-08-20 12:18:01.000000000 +0100 -@@ -307,6 +307,9 @@ - len = -off & (entry->alignment - 1); - if (len != 0) - { -+ /* We should never have an entry with an alignment -+ greater than the section's alignment. */ -+ BFD_ASSERT (len <= (bfd_size_type) (1 << alignment_power)); - if (bfd_bwrite (pad, len, abfd) != len) - goto err; - off += len; -@@ -324,6 +327,7 @@ +--- binutils-2.26.orig/bfd/merge.c 2016-01-25 10:11:33.505289018 +0000 ++++ binutils-2.26/bfd/merge.c 2016-01-25 10:19:56.961381656 +0000 +@@ -334,7 +334,7 @@ sec_merge_emit (bfd *abfd, struct sec_me + /* Trailing alignment needed? */ off = sec->size - off; - if (off != 0 -+ && alignment_power - && bfd_bwrite (pad, off, abfd) != off) - goto err; - +- if (off != 0) ++ if (off != 0 && alignment_power) + { + if (contents) + memcpy (contents + offset, pad, off); diff --git a/binutils-2.22.52.0.1-export-demangle.h.patch b/binutils-2.22.52.0.1-export-demangle.h.patch index cbd7eed..84f82cd 100644 --- a/binutils-2.22.52.0.1-export-demangle.h.patch +++ b/binutils-2.22.52.0.1-export-demangle.h.patch @@ -9,25 +9,13 @@ else !INSTALL_LIBBFD # Empty these so that the respective installation directories will not be created. bfdlibdir = ---- a/bfd/Makefile.in 2012-03-06 14:00:32.952957600 +0000 -+++ b/bfd/Makefile.in 2012-04-27 16:46:19.718975214 +0100 -@@ -138,7 +138,8 @@ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive - am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \ -- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h -+ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h \ -+ $(INCDIR)/demangle.h - HEADERS = $(bfdinclude_HEADERS) - RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -@@ -331,7 +332,8 @@ +--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:23:35.054721634 +0000 ++++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:25:59.292607840 +0000 +@@ -350,6 +350,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel @INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2) @INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \ @INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ --@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2) -+@INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h \ -+@INSTALL_LIBBFD_TRUE@ $(am__append_2) ++@INSTALL_LIBBFD_TRUE@ $(INCDIR)/demangle.h \ + @INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2) @INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@ @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la - AM_CFLAGS = $(WARN_CFLAGS) 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 177b48a..ba8318d 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 @@ -46,12 +46,12 @@ diff -cpr ../binutils-2.22.52.0.1.orig/ld/testsuite/ld-bootstrap/bootstrap.exp l untested $testname continue } ---- a/ld/emultempl/elf32.em 2013-04-24 11:06:47.777176887 +0100 -+++ b/ld/emultempl/elf32.em 2013-04-24 11:07:22.405177847 +0100 -@@ -105,6 +105,7 @@ - input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; +--- 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; } diff --git a/binutils-2.23.2-aarch64-em.patch b/binutils-2.23.2-aarch64-em.patch index 73043da..1ee8a9e 100644 --- a/binutils-2.23.2-aarch64-em.patch +++ b/binutils-2.23.2-aarch64-em.patch @@ -1,13 +1,13 @@ --- 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 -@@ -264,7 +264,7 @@ +@@ -271,7 +271,7 @@ gld${EMULATION_NAME}_after_allocation (v } static void -gld${EMULATION_NAME}_finish (void) +gld${EMULATION_NAME}_local_finish (void) { - if (! link_info.relocatable) + if (!bfd_link_relocatable (&link_info)) { @@ -276,7 +276,7 @@ } diff --git a/binutils-2.25-kernel-ld-r.patch b/binutils-2.25-kernel-ld-r.patch index 929ed19..03791b4 100644 --- a/binutils-2.25-kernel-ld-r.patch +++ b/binutils-2.25-kernel-ld-r.patch @@ -1,21 +1,6 @@ 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 -@@ -44,6 +44,14 @@ CODE_FRAGMENT - . both_direction = 3 - . }; - . -+.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. *} @@ -221,6 +229,9 @@ CODE_FRAGMENT . {* The last section on the section list. *} . struct bfd_section *section_last; @@ -26,53 +11,6 @@ diff -rup binutils-2.25/bfd/bfd.c binutils-2.25.patched/bfd/bfd.c . {* The number of sections. *} . unsigned int section_count; . -@@ -310,6 +321,9 @@ CODE_FRAGMENT - . struct objalloc *, but we use void * to avoid requiring the inclusion - . of objalloc.h. *} - . void *memory; -+. -+. {* LTO object type. *} -+. unsigned int lto_type : 2; - .}; - . - .{* See note beside bfd_set_section_userdata. *} -@@ -1923,3 +1937,36 @@ bfd_demangle (bfd *abfd, const char *nam - - return res; - } -+ -+/* -+FUNCTION -+ bfd_group_signature -+ -+SYNOPSIS -+ asymbol *bfd_group_signature (asection *group, asymbol **isympp); -+ -+DESCRIPTION -+ Return a pointer to the symbol used as a signature for GROUP. -+*/ -+ -+asymbol * -+bfd_group_signature (asection *group, asymbol **isympp) -+{ -+ bfd *abfd = group->owner; -+ Elf_Internal_Shdr *ghdr; -+ -+ if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) -+ return NULL; -+ -+ ghdr = &elf_section_data (group)->this_hdr; -+ if (ghdr->sh_link < elf_numsections (abfd)) -+ { -+ const struct elf_backend_data *bed = get_elf_backend_data (abfd); -+ Elf_Internal_Shdr *symhdr = elf_elfsections (abfd) [ghdr->sh_link]; -+ -+ if (symhdr->sh_type == SHT_SYMTAB -+ && ghdr->sh_info < symhdr->sh_size / bed->s->sizeof_sym) -+ return isympp[ghdr->sh_info - 1]; -+ } -+ return NULL; -+} diff -rup binutils-2.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 @@ -96,21 +34,6 @@ diff -rup binutils-2.25/bfd/bfd-in2.h binutils-2.25.patched/bfd/bfd-in2.h /* 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. */ -@@ -6269,6 +6275,14 @@ enum bfd_direction - both_direction = 3 - }; - -+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. */ @@ -6446,6 +6460,9 @@ struct bfd /* The last section on the section list. */ struct bfd_section *section_last; @@ -121,25 +44,6 @@ diff -rup binutils-2.25/bfd/bfd-in2.h binutils-2.25.patched/bfd/bfd-in2.h /* The number of sections. */ unsigned int section_count; -@@ -6535,6 +6552,9 @@ struct bfd - struct objalloc *, but we use void * to avoid requiring the inclusion - of objalloc.h. */ - void *memory; -+ -+ /* LTO object type. */ -+ unsigned int lto_type : 2; - }; - - /* See note beside bfd_set_section_userdata. */ -@@ -6747,6 +6767,8 @@ void bfd_emul_set_commonpagesize (const - - char *bfd_demangle (bfd *, const char *, int); - -+asymbol *bfd_group_signature (asection *group, asymbol **isympp); -+ - /* Extracted from archive.c. */ - symindex bfd_get_next_mapent - (bfd *abfd, symindex previous, carsym **sym); diff -rup binutils-2.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 @@ -782,14 +686,6 @@ diff -rup binutils-2.25/ld/emultempl/ppc64elf.em binutils-2.25.patched/ld/emulte } -@@ -876,6 +876,6 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LI - # - LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation - LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation --LDEMUL_FINISH=gld${EMULATION_NAME}_finish -+LDEMUL_FINISH=ppc_finish - LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=ppc_create_output_section_statements - LDEMUL_NEW_VERS_PATTERN=gld${EMULATION_NAME}_new_vers_pattern diff -rup binutils-2.25/ld/emultempl/spuelf.em binutils-2.25.patched/ld/emultempl/spuelf.em --- binutils-2.25/ld/emultempl/spuelf.em 2014-10-14 08:32:04.000000000 +0100 +++ binutils-2.25.patched/ld/emultempl/spuelf.em 2015-02-02 16:10:13.667437768 +0000 @@ -818,19 +714,6 @@ diff -rup binutils-2.25/ld/emultempl/spuelf.em binutils-2.25.patched/ld/emultemp -LDEMUL_FINISH=gld${EMULATION_NAME}_finish +LDEMUL_FINISH=spu_finish LDEMUL_CHOOSE_TARGET=gld${EMULATION_NAME}_choose_target -diff -rup binutils-2.25/ld/ldfile.c binutils-2.25.patched/ld/ldfile.c ---- binutils-2.25/ld/ldfile.c 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/ldfile.c 2015-02-02 16:10:13.659437732 +0000 -@@ -317,7 +317,9 @@ success: - plugin_maybe_claim (&file, entry); - } - } -+ else - #endif /* ENABLE_PLUGINS */ -+ cmdline_check_object_only_section (entry->the_bfd, FALSE); - - /* It opened OK, the format checked out, and the plugins have had - their chance to claim it, so this is success. */ diff -rup binutils-2.25/ld/ldlang.c binutils-2.25.patched/ld/ldlang.c --- binutils-2.25/ld/ldlang.c 2014-10-15 08:43:36.000000000 +0100 +++ binutils-2.25.patched/ld/ldlang.c 2015-02-02 16:10:13.663437750 +0000 @@ -862,17 +745,6 @@ diff -rup binutils-2.25/ld/ldlang.c binutils-2.25.patched/ld/ldlang.c /* Forward declarations. */ static void exp_init_os (etree_type *); -@@ -88,6 +95,10 @@ static void lang_record_phdrs (void); - static void lang_do_version_exports_section (void); - static void lang_finalize_version_expr_head - (struct bfd_elf_version_expr_head *); -+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; @@ -1221,14 +1232,17 @@ output_section_statement_table_free (voi /* Build enough state so that the parser can build its tree. */ @@ -912,7 +784,7 @@ diff -rup binutils-2.25/ld/ldlang.c binutils-2.25.patched/ld/ldlang.c } + else #endif /* ENABLE_PLUGINS */ -+ if (link_info.relocatable) ++ if (bfd_link_relocatable (&link_info)) + { + /* Check if .gnu_object_only section should be created. */ + bfd *p; @@ -944,50 +816,483 @@ diff -rup binutils-2.25/ld/ldlang.c binutils-2.25.patched/ld/ldlang.c link_info.gc_sym_list = &entry_symbol; if (entry_symbol.name == NULL) -@@ -8142,3 +8193,961 @@ lang_ld_feature (char *str) - p = q; +diff -rup binutils-2.25/ld/ldlang.h binutils-2.25.patched/ld/ldlang.h +--- binutils-2.25/ld/ldlang.h 2014-10-14 08:32:04.000000000 +0100 ++++ binutils-2.25.patched/ld/ldlang.h 2015-02-02 16:10:13.668437773 +0000 +@@ -523,7 +523,7 @@ extern struct asneeded_minfo **asneeded_ + extern void (*output_bfd_hash_table_free_fn) (struct bfd_link_hash_table *); + + extern void lang_init +- (void); ++ (bfd_boolean); + extern void lang_finish + (void); + extern lang_memory_region_type * lang_memory_region_lookup +diff -rup binutils-2.25/ld/ldlex.h binutils-2.25.patched/ld/ldlex.h +--- binutils-2.25/ld/ldlex.h 2014-11-04 09:54:41.000000000 +0000 ++++ binutils-2.25.patched/ld/ldlex.h 2015-02-02 16:10:13.670437782 +0000 +@@ -133,6 +133,7 @@ enum option_values + #ifdef ENABLE_PLUGINS + OPTION_PLUGIN, + OPTION_PLUGIN_OPT, ++ OPTION_PLUGIN_SAVE_TEMPS, + #endif /* ENABLE_PLUGINS */ + OPTION_DEFAULT_SCRIPT, + OPTION_PRINT_OUTPUT_FORMAT, +diff -rup binutils-2.25/ld/ldmain.c binutils-2.25.patched/ld/ldmain.c +--- binutils-2.25/ld/ldmain.c 2014-10-14 08:32:04.000000000 +0100 ++++ binutils-2.25.patched/ld/ldmain.c 2015-02-02 16:10:13.665437759 +0000 +@@ -220,6 +220,9 @@ main (int argc, char **argv) + + xatexit (ld_cleanup); + ++ /* Remove temporary object-only files. */ ++ xatexit (cmdline_remove_object_only_files); ++ + /* Set up the sysroot directory. */ + ld_sysroot = get_sysroot (argc, argv); + if (*ld_sysroot) +@@ -296,7 +299,7 @@ main (int argc, char **argv) + default_target = ldemul_choose_target (argc, argv); + config.maxpagesize = bfd_emul_get_maxpagesize (default_target); + config.commonpagesize = bfd_emul_get_commonpagesize (default_target); +- lang_init (); ++ lang_init (FALSE); + ldexp_init (); + ldemul_before_parse (); + lang_has_input_file = FALSE; +@@ -311,34 +314,7 @@ main (int argc, char **argv) + + ldemul_set_symbols (); + +- /* If we have not already opened and parsed a linker script, +- try the default script from command line first. */ +- if (saved_script_handle == NULL +- && command_line.default_script != NULL) +- { +- ldfile_open_command_file (command_line.default_script); +- parser_input = input_script; +- yyparse (); +- } +- +- /* If we have not already opened and parsed a linker script +- read the emulation's appropriate default script. */ +- if (saved_script_handle == NULL) +- { +- int isfile; +- char *s = ldemul_get_script (&isfile); +- +- if (isfile) +- ldfile_open_default_command_file (s); +- else +- { +- lex_string = s; +- lex_redirect (s, _("built in linker script"), 1); +- } +- parser_input = input_script; +- yyparse (); +- lex_string = NULL; +- } ++ ld_parse_linker_script (); + + if (verbose) + { +@@ -459,6 +435,8 @@ main (int argc, char **argv) + if (! bfd_close (link_info.output_bfd)) + einfo (_("%F%B: final close failed: %E\n"), link_info.output_bfd); + ++ link_info.output_bfd = NULL; ++ + /* If the --force-exe-suffix is enabled, and we're making an + executable file and it doesn't end in .exe, copy it to one + which does. */ +@@ -505,6 +483,9 @@ main (int argc, char **argv) + } } - } + ++ if (link_info.emit_gnu_object_only) ++ cmdline_emit_object_only_section (); + -+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; -+} + END_PROGRESS (program_name); + + if (config.stats) +@@ -1207,7 +1190,8 @@ warning_callback (struct bfd_link_info * + einfo ("%P: %s%s\n", _("warning: "), warning); + else if (symbol == NULL) + einfo ("%B: %s%s\n", abfd, _("warning: "), warning); +- else if (! symbol_warning (warning, symbol, abfd)) ++ else if (((abfd->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; + } + -+/* Allocate an item with TYPE and DATA. */ ++/* Parse the linker script. */ + -+static cmdline_union_type * -+cmdline_list_new (cmdline_enum_type type, void *data) ++void ++ld_parse_linker_script (void) +{ -+ cmdline_union_type *new_opt; -+ -+ new_opt = (cmdline_union_type *) stat_alloc (sizeof (*new_opt)); -+ new_opt->header.type = type; -+ switch (type) ++ /* 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) + { -+ 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; ++ ldfile_open_command_file (command_line.default_script); ++ parser_input = input_script; ++ yyparse (); + } -+ return new_opt; -+} + -+/* Append an item with TYPE and DATA to LIST. */ ++ /* 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); + -+static void -+cmdline_list_append (cmdline_list_type *list, cmdline_enum_type type, -+ void *data) ++ 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; @@ -1857,7 +2162,7 @@ diff -rup binutils-2.25/ld/ldlang.c binutils-2.25.patched/ld/ldlang.c + break; + } + } -+ else if (link_info.relocatable) ++ 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 @@ -1904,417 +2209,117 @@ diff -rup binutils-2.25/ld/ldlang.c binutils-2.25.patched/ld/ldlang.c + } +} + -+ -+ -diff -rup binutils-2.25/ld/ldlang.h binutils-2.25.patched/ld/ldlang.h ---- binutils-2.25/ld/ldlang.h 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/ldlang.h 2015-02-02 16:10:13.668437773 +0000 -@@ -523,7 +523,7 @@ extern struct asneeded_minfo **asneeded_ - extern void (*output_bfd_hash_table_free_fn) (struct bfd_link_hash_table *); + /* Pretty print memory amount. */ - extern void lang_init -- (void); -+ (bfd_boolean); - extern void lang_finish - (void); - extern lang_memory_region_type * lang_memory_region_lookup -@@ -698,4 +698,45 @@ ldlang_override_segment_assignment - extern void - lang_ld_feature (char *); + 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]; + }; -+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); ++enum bfd_lto_object_type ++ { ++ lto_non_object, ++ lto_non_ir_object, ++ lto_ir_object, ++ lto_mixed_object ++ }; + - #endif -diff -rup binutils-2.25/ld/ldlex.h binutils-2.25.patched/ld/ldlex.h ---- binutils-2.25/ld/ldlex.h 2014-11-04 09:54:41.000000000 +0000 -+++ binutils-2.25.patched/ld/ldlex.h 2015-02-02 16:10:13.670437782 +0000 -@@ -133,6 +133,7 @@ enum option_values - #ifdef ENABLE_PLUGINS - OPTION_PLUGIN, - OPTION_PLUGIN_OPT, -+ OPTION_PLUGIN_SAVE_TEMPS, - #endif /* ENABLE_PLUGINS */ - OPTION_DEFAULT_SCRIPT, - OPTION_PRINT_OUTPUT_FORMAT, -diff -rup binutils-2.25/ld/ldmain.c binutils-2.25.patched/ld/ldmain.c ---- binutils-2.25/ld/ldmain.c 2014-10-14 08:32:04.000000000 +0100 -+++ binutils-2.25.patched/ld/ldmain.c 2015-02-02 16:10:13.665437759 +0000 -@@ -220,6 +220,9 @@ main (int argc, char **argv) - - xatexit (ld_cleanup); + struct bfd + { + /* The filename the application opened the BFD with. */ +@@ -6807,6 +6815,9 @@ struct bfd -+ /* Remove temporary object-only files. */ -+ xatexit (cmdline_remove_object_only_files); + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; + - /* Set up the sysroot directory. */ - ld_sysroot = get_sysroot (argc, argv); - if (*ld_sysroot) -@@ -296,7 +299,7 @@ main (int argc, char **argv) - default_target = ldemul_choose_target (argc, argv); - config.maxpagesize = bfd_emul_get_maxpagesize (default_target); - config.commonpagesize = bfd_emul_get_commonpagesize (default_target); -- lang_init (); -+ lang_init (FALSE); - ldexp_init (); - ldemul_before_parse (); - lang_has_input_file = FALSE; -@@ -311,34 +314,7 @@ main (int argc, char **argv) - - ldemul_set_symbols (); - -- /* If we have not already opened and parsed a linker script, -- try the default script from command line first. */ -- if (saved_script_handle == NULL -- && command_line.default_script != NULL) -- { -- ldfile_open_command_file (command_line.default_script); -- parser_input = input_script; -- yyparse (); -- } -- -- /* If we have not already opened and parsed a linker script -- read the emulation's appropriate default script. */ -- if (saved_script_handle == NULL) -- { -- int isfile; -- char *s = ldemul_get_script (&isfile); -- -- if (isfile) -- ldfile_open_default_command_file (s); -- else -- { -- lex_string = s; -- lex_redirect (s, _("built in linker script"), 1); -- } -- parser_input = input_script; -- yyparse (); -- lex_string = NULL; -- } -+ ld_parse_linker_script (); ++ /* LTO object type. */ ++ unsigned int lto_type : 2; + }; - if (verbose) - { -@@ -459,6 +435,8 @@ main (int argc, char **argv) - if (! bfd_close (link_info.output_bfd)) - einfo (_("%F%B: final close failed: %E\n"), link_info.output_bfd); + /* See note beside bfd_set_section_userdata. */ +@@ -7019,6 +7030,8 @@ void bfd_emul_set_commonpagesize (const -+ link_info.output_bfd = NULL; -+ - /* If the --force-exe-suffix is enabled, and we're making an - executable file and it doesn't end in .exe, copy it to one - which does. */ -@@ -505,6 +483,9 @@ main (int argc, char **argv) - } - } + char *bfd_demangle (bfd *, const char *, int); -+ if (link_info.emit_gnu_object_only) -+ cmdline_emit_object_only_section (); ++asymbol *bfd_group_signature (asection *group, asymbol **isympp); + - END_PROGRESS (program_name); - - if (config.stats) -@@ -814,7 +795,9 @@ add_archive_element (struct bfd_link_inf - } - } - } -+ else - #endif /* ENABLE_PLUGINS */ -+ cmdline_check_object_only_section (input->the_bfd, FALSE); - - ldlang_add_file (input); - -@@ -1207,7 +1190,8 @@ warning_callback (struct bfd_link_info * - einfo ("%P: %s%s\n", _("warning: "), warning); - else if (symbol == NULL) - einfo ("%B: %s%s\n", abfd, _("warning: "), warning); -- else if (! symbol_warning (warning, symbol, abfd)) -+ else if (((abfd->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, + void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); - return TRUE; +--- 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 + -+/* Parse the linker script. */ ++SYNOPSIS ++ asymbol *bfd_group_signature (asection *group, asymbol **isympp); + -+void -+ld_parse_linker_script () ++DESCRIPTION ++ Return a pointer to the symbol used as a signature for GROUP. ++*/ ++ ++asymbol * ++bfd_group_signature (asection *group, asymbol **isympp) +{ -+ /* 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 (); -+ } ++ bfd *abfd = group->owner; ++ Elf_Internal_Shdr *ghdr; + -+ /* If we have not already opened and parsed a linker script -+ read the emulation's appropriate default script. */ -+ if (saved_script_handle == NULL) ++ 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)) + { -+ int isfile; -+ char *s = ldemul_get_script (&isfile); ++ const struct elf_backend_data *bed = get_elf_backend_data (abfd); ++ Elf_Internal_Shdr *symhdr = elf_elfsections (abfd) [ghdr->sh_link]; + -+ 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; ++ if (symhdr->sh_type == SHT_SYMTAB ++ && ghdr->sh_info < symhdr->sh_size / bed->s->sizeof_sym) ++ return isympp[ghdr->sh_info - 1]; + } ++ return NULL; +} -diff -rup binutils-2.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 }, -@@ -978,6 +981,9 @@ parse_args (unsigned argc, char **argv) - if (plugin_opt_plugin_arg (optarg)) - einfo(_("%P%F: bad -plugin-opt option\n")); - break; -+ case OPTION_PLUGIN_SAVE_TEMPS: -+ plugin_save_temps = TRUE; -+ break; - #endif /* ENABLE_PLUGINS */ - case 'q': - link_info.emitrelocations = TRUE; -diff -rup binutils-2.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; -@@ -882,6 +896,9 @@ plugin_maybe_claim (struct ld_plugin_inp - close (file->fd); - if (claimed) - { -+ /* 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 -@@ -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)} - } ++/* + FUNCTION + bfd_update_compression_header - .idata ${RELOCATING+BLOCK(__section_alignment__)} : diff --git a/binutils-2.25-version.patch b/binutils-2.25-version.patch index 7d088ed..d97e81b 100644 --- a/binutils-2.25-version.patch +++ b/binutils-2.25-version.patch @@ -1,10 +1,9 @@ -diff -up binutils-2.25.orig/bfd/Makefile.am binutils-2.25/bfd/Makefile.am ---- binutils-2.25.orig/bfd/Makefile.am 2014-12-24 10:28:10.546273213 +0000 -+++ binutils-2.25/bfd/Makefile.am 2014-12-24 10:30:27.569042391 +0000 -@@ -1025,8 +1025,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD +--- binutils-2.26.orig/bfd/Makefile.am 2016-01-25 10:11:33.505289018 +0000 ++++ binutils-2.26/bfd/Makefile.am 2016-01-25 10:13:23.489964145 +0000 +@@ -1043,8 +1043,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in @echo "creating $@" - @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ + @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ - bfd_version_string="\"$(VERSION)\"" ;\ - bfd_soversion="$(VERSION)" ;\ + bfd_version_string="\"$(VERSION)-%{release}\"" ;\ @@ -12,22 +11,21 @@ diff -up binutils-2.25.orig/bfd/Makefile.am binutils-2.25/bfd/Makefile.am bfd_version_package="\"$(PKGVERSION)\"" ;\ report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ . $(srcdir)/development.sh ;\ -@@ -1037,7 +1037,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ +@@ -1055,7 +1055,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ fi ;\ - sed -e "s,@bfd_version@,$$bfd_version," \ + $(SED) -e "s,@bfd_version@,$$bfd_version," \ -e "s,@bfd_version_string@,$$bfd_version_string," \ - -e "s,@bfd_version_package@,$$bfd_version_package," \ + -e "s,@bfd_version_package@,\"version \"," \ -e "s,@report_bugs_to@,$$report_bugs_to," \ < $(srcdir)/version.h > $@; \ echo "$${bfd_soversion}" > libtool-soversion -diff -up binutils-2.25.orig/bfd/Makefile.in binutils-2.25/bfd/Makefile.in ---- binutils-2.25.orig/bfd/Makefile.in 2014-12-24 10:28:10.558273280 +0000 -+++ binutils-2.25/bfd/Makefile.in 2014-12-24 10:31:37.444434637 +0000 -@@ -2085,8 +2085,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) +--- binutils-2.26.orig/bfd/Makefile.in 2016-01-25 10:11:33.505289018 +0000 ++++ binutils-2.26/bfd/Makefile.in 2016-01-25 10:14:17.818297941 +0000 +@@ -2111,8 +2111,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in @echo "creating $@" - @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ + @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ - bfd_version_string="\"$(VERSION)\"" ;\ - bfd_soversion="$(VERSION)" ;\ + bfd_version_string="\"$(VERSION)-%{release}\"" ;\ @@ -35,13 +33,12 @@ diff -up binutils-2.25.orig/bfd/Makefile.in binutils-2.25/bfd/Makefile.in bfd_version_package="\"$(PKGVERSION)\"" ;\ report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ . $(srcdir)/development.sh ;\ -@@ -2097,7 +2097,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ +@@ -2123,7 +2123,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ fi ;\ - sed -e "s,@bfd_version@,$$bfd_version," \ + $(SED) -e "s,@bfd_version@,$$bfd_version," \ -e "s,@bfd_version_string@,$$bfd_version_string," \ - -e "s,@bfd_version_package@,$$bfd_version_package," \ + -e "s,@bfd_version_package@,\"version \"," \ -e "s,@report_bugs_to@,$$report_bugs_to," \ < $(srcdir)/version.h > $@; \ echo "$${bfd_soversion}" > libtool-soversion - diff --git a/binutils-2.25.1-cleansweep.patch b/binutils-2.25.1-cleansweep.patch new file mode 100644 index 0000000..81b1b9e --- /dev/null +++ b/binutils-2.25.1-cleansweep.patch @@ -0,0 +1,39 @@ +--- ../binutils-2.25.1.orig/ld/testsuite/ld-plugin/lto.exp 2016-01-08 15:24:58.241083264 +0000 ++++ ld/testsuite/ld-plugin/lto.exp 2016-01-08 16:30:51.845827089 +0000 +@@ -144,7 +144,7 @@ set lto_link_tests [list \ + {pr12760b.c} {} "libpr12760.a"] \ + [list "PR ld/12760" \ + "-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12760a.o -Wl,--start-group tmpdir/libpr12760.a -Wl,--end-group" "" \ +- {dummy.c} {} "pr12760.exe" "c" "pr12760a.c:6: warning: Bad bar"] \ ++ {dummy.c} {} "pr12760.exe" "c" ""] \ + [list "Build libpr13183.a" \ + "-T" "-flto -O2 $lto_fat" \ + {pr13183a.c} {} "libpr13183.a"] \ +@@ -386,6 +386,11 @@ if { [at_least_gcc_version 4 7] } { + } + } + ++# Fedora specific binutils patches break some of the tests that follow... ++restore_notify ++return ++ ++ + # Run "ld -r" to generate inputs for complex LTO tests. + run_dump_test "lto-3r" + remote_exec host "mv" "tmpdir/dump tmpdir/lto-3.o" +--- ../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) diff --git a/binutils-2.25.1-plugin-format-checking.patch b/binutils-2.25.1-plugin-format-checking.patch index bd92f51..127c0b2 100644 --- a/binutils-2.25.1-plugin-format-checking.patch +++ b/binutils-2.25.1-plugin-format-checking.patch @@ -45,7 +45,7 @@ diff -rup binutils-2.25.1.orig/bfd/plugin.c binutils-2.25.1/bfd/plugin.c } else { -@@ -450,6 +468,12 @@ load_plugin (bfd *abfd) +@@ -515,6 +515,12 @@ load_plugin (bfd *abfd) static const bfd_target * bfd_plugin_object_p (bfd *abfd) { @@ -55,6 +55,6 @@ diff -rup binutils-2.25.1.orig/bfd/plugin.c binutils-2.25.1/bfd/plugin.c + if (in_get_symbols) + return NULL; + - if (!load_plugin (abfd)) - return NULL; + if (ld_plugin_object_p) + return ld_plugin_object_p (abfd); diff --git a/binutils.spec b/binutils.spec index 339f7e9..7a0d1ce 100644 --- a/binutils.spec +++ b/binutils.spec @@ -19,8 +19,8 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} -Version: 2.25.1 -Release: 9%{?dist} +Version: 2.26 +Release: 1%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -32,6 +32,7 @@ URL: http://sources.redhat.com/binutils Source: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2 Source2: binutils-2.19.50.0.1-output-format.sed + Patch01: binutils-2.20.51.0.2-libtool-lib64.patch Patch02: binutils-2.20.51.0.10-ppc64-pie.patch Patch03: binutils-2.20.51.0.2-ia64-lib64.patch @@ -53,16 +54,8 @@ Patch12: binutils-2.25-kernel-ld-r.patch Patch13: binutils-2.23.2-aarch64-em.patch # Fix detections little endian PPC shared libraries Patch14: binutils-2.24-ldforcele.patch -# Fix parsing of corupt iHex binaries -Patch15: binutils-2.25.1-ihex-parsing.patch -# backport https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e9c1bdad269c0c3352eebcc9481ed65144001b0b -# Qt linked with gold crash on startup, BZ #1193044 -Patch16: binutils-2.25.1-dynamic_list.patch -Patch17: binutils-2.25.1-aarch64-pr18668.patch -# Fix incorrectly generated ELF binaries and DSOs -Patch18: binutils-rh1247126.patch -# Fix infinite recursion when a plugin tries to claim an unrecognized binary -Patch19: binutils-2.25.1-plugin-format-checking.patch +Patch15: binutils-2.25.1-plugin-format-checking.patch +Patch16: binutils-2.25.1-cleansweep.patch Provides: bundled(libiberty) @@ -185,11 +178,8 @@ using libelf instead of BFD. %ifarch ppc64le %patch14 -p1 -b .ldforcele~ %endif -%patch15 -p1 -b .ihex~ -%patch16 -p1 -b .dynamic_list~ -%patch17 -p1 -%patch18 -p1 -%patch19 -p1 +%patch15 -p1 +%patch16 -p0 # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -509,6 +499,14 @@ exit 0 %endif # %{isnative} %changelog +* Mon Jan 25 2016 Nick Clifton 2.26-1 +- Rebase on FSF binutils 2.26 release. +- Retire: binutils-2.25.1-ihex-parsing.patch +- Retire: binutils-2.25.1-dynamic_list.patch +- Retire: binutils-2.25.1-aarch64-pr18668.patch +- Retire: binutils-rh1247126.patch + (#1271387) + * Thu Nov 05 2015 Nick Clifton 2.25.1-9 - Prevent an infinite recursion when a plugin tries to claim a file in an unrecognised format. (#1174065) diff --git a/sources b/sources index 9fc5580..c5055f0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ac493a78de4fee895961d025b7905be4 binutils-2.25.1.tar.bz2 +64146a0faa3b411ba774f47d41de239f binutils-2.26.tar.bz2