From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E920515808A for ; Wed, 06 Aug 2025 01:08:11 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id C22D2340D32 for ; Wed, 06 Aug 2025 01:08:11 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id BB0D911036D; Wed, 06 Aug 2025 01:08:10 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id B43EF11036D for ; Wed, 06 Aug 2025 01:08:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5920E340D32 for ; Wed, 06 Aug 2025 01:08:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B0ACE3234 for ; Wed, 06 Aug 2025 01:08:08 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1754442477.21500ae31ee33f2c9f701a977249d09e8f7eb526.sam@gentoo> Subject: [gentoo-commits] proj/toolchain/binutils-patches:master commit in: 9999/ X-VCS-Repository: proj/toolchain/binutils-patches X-VCS-Files: 9999/0006-strip-Don-t-treat-fat-IR-objects-as-plugin-object.patch X-VCS-Directories: 9999/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 21500ae31ee33f2c9f701a977249d09e8f7eb526 X-VCS-Branch: master Date: Wed, 06 Aug 2025 01:08:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0133ef45-7481-44e7-86c5-afd89fc15495 X-Archives-Hash: a267aa1613284d40311dd92f57d9a268 commit: 21500ae31ee33f2c9f701a977249d09e8f7eb526 Author: Sam James gentoo org> AuthorDate: Wed Aug 6 01:07:57 2025 +0000 Commit: Sam James gentoo org> CommitDate: Wed Aug 6 01:07:57 2025 +0000 URL: https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=21500ae3 9999: refresh strip LTO patch Signed-off-by: Sam James gentoo.org> ...n-t-treat-fat-IR-objects-as-plugin-object.patch | 397 +++------------------ 1 file changed, 44 insertions(+), 353 deletions(-) diff --git a/9999/0006-strip-Don-t-treat-fat-IR-objects-as-plugin-object.patch b/9999/0006-strip-Don-t-treat-fat-IR-objects-as-plugin-object.patch index b34bbbb..7957964 100644 --- a/9999/0006-strip-Don-t-treat-fat-IR-objects-as-plugin-object.patch +++ b/9999/0006-strip-Don-t-treat-fat-IR-objects-as-plugin-object.patch @@ -1,8 +1,9 @@ -https://inbox.sourceware.org/binutils/CAMe9rOprvH1SusdkbmAnE7L0Sr4kYeMZTYAQBw4t9oTySVsgjw@mail.gmail.com/ +https://inbox.sourceware.org/binutils/20250806010532.3404344-1-hjl.tools@gmail.com/ -From a0fafaa5186a248ac75e178d39fa257ddbce5f2d Mon Sep 17 00:00:00 2001 +From e48e12720aa4a7c3f97d70dc0d64e5ac665ccdd5 Mon Sep 17 00:00:00 2001 +Message-ID: From: "H.J. Lu" -Date: Sun, 3 Aug 2025 10:28:40 -0700 +Date: Tue, 5 Aug 2025 18:05:32 -0700 Subject: [PATCH] strip: Don't treat fat IR objects as plugin object Fat IR objects contains both regular sections and IR sections. After @@ -15,10 +16,12 @@ Date: Sun May 4 05:12:46 2025 +0800 "strip --strip-debug" no longer strips debug sections in fat IR objects since fat IR objects are recognized as plugin object and copied as unknown -objects. Update strip not to treat archive member nor standalone fat IR -object as IR object so that strip can remove debug and IR sections in -fat IR object. For archive member, it is copied as an unknown object if -it isn't a fat IR object nor a slim IR object. +objects. Add a is_strip_input field to bfd to indicate called from strip. +Update bfd_check_format_matches not to treat archive member nor standalone +fat IR object as IR object so that strip can remove debug and IR sections +in fat IR object. For archive member, it is copied as an unknown object +if the plugin target is in use or it is a slim IR object. For standalone +fat IR object, it is copied as non-IR object. bfd/ @@ -28,14 +31,12 @@ bfd/ (_bfd_compute_and_write_armap): Don't complain plugin is needed when the plugin target is in use. * bfd-in2.h: Regenerated. - * format.c (bfd_check_format_lto): Removed. - (bfd_check_format): Updated. - (bfd_set_lto_type): If there is .llvm.lto section, set LTO type - to lto_fat_ir_object. - (bfd_check_format_matches_lto): Removed. + * bfd.c (bfd): Add is_strip_input. + * format.c (bfd_set_lto_type): If there is .llvm.lto section, + set LTO type to lto_fat_ir_object. (bfd_check_format_matches): Don't set LTO type when setting - format. When called from strip, don't treat archive - member nor standalone fat IR object as an IR object. + format. When called from strip, don't treat archive member nor + standalone fat IR object as an IR object. * plugin.c (bfd_plugin_get_symbols_in_object_only): Copy LTO type derived from input sections. @@ -45,12 +46,11 @@ nm/ * nm.c (filter_symbols): Don't complain plugin is needed when the plugin target is in use. (display_rel_file): Likewise. - * objcopy.c (copy_archive): Pass true to bfd_check_format_lto - to indicat called from strip. Also copy slim IR archive member - as unknown object. - (copy_file): Call bfd_check_format_lto, instead of - bfd_check_format. Pass true to bfd_check_format_lto and - bfd_check_format_matches_lto. + * objcopy.c (copy_archive): Set the BFD is_strip_input field of + archive member to 1 to indicate called from strip. Also copy + slim IR archive member as unknown object. + (copy_file): Set the BFD is_strip_input field of input bfd to + 1 to indicate called from strip. (strip_main): Keep .gnu.debuglto_* sections unless all GCC LTO sections will be removed. @@ -61,19 +61,18 @@ ld/ Run binutils/33246 tests with GCC and Clang. * testsuite/ld-plugin/pr33246.c: New file. -Co-Authored-By: Alan Modra Signed-off-by: H.J. Lu --- bfd/archive.c | 12 +- - bfd/bfd-in2.h | 10 +- + bfd/bfd-in2.h | 3 + bfd/bfd.c | 3 + - bfd/format.c | 140 +++++++------------ - bfd/plugin.c | 7 +- + bfd/format.c | 22 ++- + bfd/plugin.c | 3 + binutils/nm.c | 6 +- - binutils/objcopy.c | 57 +++++--- + binutils/objcopy.c | 13 +- ld/testsuite/ld-plugin/lto-binutils.exp | 175 ++++++++++++++++++++++++ ld/testsuite/ld-plugin/pr33246.c | 4 + - 9 files changed, 290 insertions(+), 124 deletions(-) + 9 files changed, 230 insertions(+), 11 deletions(-) create mode 100644 ld/testsuite/ld-plugin/pr33246.c diff --git a/bfd/archive.c b/bfd/archive.c @@ -114,7 +113,7 @@ index c61d4b12658..491c44f5191 100644 { report_plugin_err = false; diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h -index 2ff3e930bfa..12512a3962c 100644 +index b013ef954da..12512a3962c 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -2131,6 +2131,9 @@ struct bfd @@ -127,22 +126,6 @@ index 2ff3e930bfa..12512a3962c 100644 /* If this is an input for a compiler plug-in library. */ ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; -@@ -2903,15 +2906,8 @@ bool generic_core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); - - /* Extracted from format.c. */ --bool bfd_check_format_lto (bfd *abfd, bfd_format format, -- bool lto_sections_removed); -- - bool bfd_check_format (bfd *abfd, bfd_format format); - --bool bfd_check_format_matches_lto -- (bfd *abfd, bfd_format format, char ***matching, -- bool lto_sections_removed); -- - bool bfd_check_format_matches - (bfd *abfd, bfd_format format, char ***matching); - diff --git a/bfd/bfd.c b/bfd/bfd.c index 858ab5ce017..4aded6809bb 100644 --- a/bfd/bfd.c @@ -158,65 +141,10 @@ index 858ab5ce017..4aded6809bb 100644 . ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; . diff --git a/bfd/format.c b/bfd/format.c -index f3a0774af08..f8e73b7eaea 100644 +index d2bc318977c..d883aa5e5a8 100644 --- a/bfd/format.c +++ b/bfd/format.c -@@ -56,19 +56,16 @@ extern const size_t _bfd_target_vector_entries; - - /* - FUNCTION -- bfd_check_format_lto -+ bfd_check_format - - SYNOPSIS -- bool bfd_check_format_lto (bfd *abfd, bfd_format format, -- bool lto_sections_removed); -+ bool bfd_check_format (bfd *abfd, bfd_format format); - - DESCRIPTION - Verify if the file attached to the BFD @var{abfd} is compatible - with the format @var{format} (i.e., one of <>, - <> or <>). - -- If LTO_SECTION_REMOVED is true, ignore plugin target. -- - If the BFD has been set to a specific target before the - call, only the named target and format combination is - checked. If the target has not been set, or has been set to -@@ -102,31 +99,10 @@ DESCRIPTION - itself. - */ - --bool --bfd_check_format_lto (bfd *abfd, bfd_format format, -- bool lto_sections_removed) --{ -- return bfd_check_format_matches_lto (abfd, format, NULL, -- lto_sections_removed); --} -- -- --/* --FUNCTION -- bfd_check_format -- --SYNOPSIS -- bool bfd_check_format (bfd *abfd, bfd_format format); -- --DESCRIPTION -- Similar to bfd_check_format_plugin, except plugin target isn't -- ignored. --*/ -- - bool - bfd_check_format (bfd *abfd, bfd_format format) - { -- return bfd_check_format_matches_lto (abfd, format, NULL, false); -+ return bfd_check_format_matches (abfd, format, NULL); - } - - struct bfd_preserve -@@ -413,6 +389,11 @@ bfd_set_lto_type (bfd *abfd ATTRIBUTE_UNUSED) +@@ -389,6 +389,11 @@ bfd_set_lto_type (bfd *abfd ATTRIBUTE_UNUSED) abfd->object_only_section = sec; break; } @@ -228,53 +156,7 @@ index f3a0774af08..f8e73b7eaea 100644 else if (lsection.major_version == 0 && startswith (sec->name, ".gnu.lto_.lto.") && bfd_get_section_contents (abfd, sec, &lsection, 0, -@@ -431,36 +412,32 @@ bfd_set_lto_type (bfd *abfd ATTRIBUTE_UNUSED) - - /* - FUNCTION -- bfd_check_format_matches_lto -+ bfd_check_format_matches - - SYNOPSIS -- bool bfd_check_format_matches_lto -- (bfd *abfd, bfd_format format, char ***matching, -- bool lto_sections_removed); -+ bool bfd_check_format_matches -+ (bfd *abfd, bfd_format format, char ***matching); - - DESCRIPTION - Like <>, except when it returns FALSE with -- <> set to <>. In that -- case, if @var{matching} is not NULL, it will be filled in with -- a NULL-terminated list of the names of the formats that matched, -- allocated with <>. -+ <> set to <>. -+ In that case, if @var{matching} is not NULL, it will be filled -+ in with a NULL-terminated list of the names of the formats -+ that matched, allocated with <>. - Then the user may choose a format and try again. - - When done with the list that @var{matching} points to, the caller - should free it. -- -- If LTO_SECTION_REMOVED is true, ignore plugin target. - */ - - bool --bfd_check_format_matches_lto (bfd *abfd, bfd_format format, -- char ***matching, -- bool lto_sections_removed ATTRIBUTE_UNUSED) -+bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) - { - extern const bfd_target binary_vec; - const bfd_target * const *target; - const bfd_target **matching_vector = NULL; - const bfd_target *save_targ, *right_targ, *ar_right_targ, *match_targ; -+ const bfd_target *fail_targ; - int match_count, best_count, best_match; - int ar_match_index; - unsigned int initial_section_id = _bfd_section_id; -@@ -481,10 +458,7 @@ bfd_check_format_matches_lto (bfd *abfd, bfd_format format, +@@ -453,10 +458,7 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) } if (abfd->format != bfd_unknown) @@ -286,34 +168,17 @@ index f3a0774af08..f8e73b7eaea 100644 if (matching != NULL || *bfd_associated_vector != NULL) { -@@ -524,20 +498,30 @@ bfd_check_format_matches_lto (bfd *abfd, bfd_format format, - if (!bfd_preserve_save (abfd, &preserve, NULL)) - goto err_ret; - -- /* If the target type was explicitly specified, just check that target. -- If LTO_SECTION_REMOVED is true, don't match the plugin target. */ -+ /* If the target type was explicitly specified, just check that target. */ -+ fail_targ = NULL; - if (!abfd->target_defaulted - #if BFD_SUPPORTS_PLUGINS -- && (!lto_sections_removed || !bfd_plugin_target_p (abfd->xvec)) -+ && !(abfd->plugin_format == bfd_plugin_no -+ && bfd_plugin_target_p (save_targ)) - #endif -- ) -+ ) - { - if (bfd_seek (abfd, 0, SEEK_SET) != 0) /* rewind! */ - goto err_ret; +@@ -510,7 +512,17 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) cleanup = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); - if (cleanup) + /* When called from strip, don't treat archive member nor + standalone fat IR object as an IR object. For archive -+ member, it will be copied as an unknown object if it -+ isn't a fat IR object. For standalone fat IR object, -+ it will be copied as non-IR object. */ ++ member, it will be copied as an unknown object if the ++ plugin target is in use or it is a slim IR object. For ++ standalone fat IR object, it will be copied as non-IR ++ object. */ + if (cleanup + && (!abfd->is_strip_input + || !bfd_plugin_target_p (abfd->xvec) @@ -322,107 +187,11 @@ index f3a0774af08..f8e73b7eaea 100644 goto ok_ret; /* For a long time the code has dropped through to check all -@@ -554,10 +538,10 @@ bfd_check_format_matches_lto (bfd *abfd, bfd_format format, - target. */ - if (format == bfd_archive && save_targ == &binary_vec) - goto err_unrecog; -+ fail_targ = save_targ; - } - -- /* Since the target type was defaulted, check them all in the hope -- that one will be uniquely recognized. */ -+ /* Check all targets in the hope that one will be recognized. */ - right_targ = NULL; - ar_right_targ = NULL; - match_targ = NULL; -@@ -571,26 +555,26 @@ bfd_check_format_matches_lto (bfd *abfd, bfd_format format, - void **high_water; - - /* The binary target matches anything, so don't return it when -- searching. Don't match the plugin target if we have another -- alternative since we want to properly set the input format -- before allowing a plugin to claim the file. Also, don't -- check the default target twice. If LTO_SECTION_REMOVED is -- true, don't match the plugin target. */ -+ searching. Also, don't check the current target twice when -+ it has failed already. -+ Don't match the plugin target during linking if we have -+ another alternative since we want to properly set the input -+ format before allowing a plugin to claim the file. -+ Also as an optimisation don't match the plugin target when -+ abfd->plugin_format is set to bfd_plugin_no. (This occurs -+ when LTO sections have been stripped or when we have a -+ recursive call here from the plugin object_p via -+ bfd_plugin_get_symbols_in_object_only.) */ - if (*target == &binary_vec -+ || *target == fail_targ - #if BFD_SUPPORTS_PLUGINS -- || ((lto_sections_removed || match_count != 0) -+ || (((abfd->is_linker_input && match_count != 0) -+ || abfd->plugin_format == bfd_plugin_no) - && bfd_plugin_target_p (*target)) - #endif -- || (!abfd->target_defaulted && *target == save_targ)) -+ ) - continue; - --#if BFD_SUPPORTS_PLUGINS -- /* If the plugin target is explicitly specified when a BFD file -- is opened, don't check it twice. */ -- if (bfd_plugin_specified_p () && bfd_plugin_target_p (*target)) -- continue; --#endif -- - /* If we already tried a match, the bfd is modified and may - have sections attached, which will confuse the next - _bfd_check_format call. */ -@@ -831,32 +815,6 @@ bfd_check_format_matches_lto (bfd *abfd, bfd_format format, - return false; - } - --/* --FUNCTION -- bfd_check_format_matches -- --SYNOPSIS -- bool bfd_check_format_matches -- (bfd *abfd, bfd_format format, char ***matching); -- --DESCRIPTION -- Like <>, except when it returns FALSE with -- <> set to <>. In that -- case, if @var{matching} is not NULL, it will be filled in with -- a NULL-terminated list of the names of the formats that matched, -- allocated with <>. -- Then the user may choose a format and try again. -- -- When done with the list that @var{matching} points to, the caller -- should free it. --*/ -- --bool --bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) --{ -- return bfd_check_format_matches_lto (abfd, format, matching, false); --} -- - /* - FUNCTION - bfd_set_format diff --git a/bfd/plugin.c b/bfd/plugin.c -index 1c72b748a8f..be9d1e58bf3 100644 +index ebdf2505cbc..43ca444e7a1 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c -@@ -196,13 +196,17 @@ bfd_plugin_get_symbols_in_object_only (bfd *abfd) - abfd->filename, bfd_errmsg (bfd_get_error ())); - return; - } -- else if (!bfd_check_format (nbfd, bfd_object)) -+ nbfd->plugin_format = bfd_plugin_no; -+ if (!bfd_check_format (nbfd, bfd_object)) - { - /* There is no object only section if it isn't a bfd_object - file. */ +@@ -206,6 +206,9 @@ bfd_plugin_get_symbols_in_object_only (bfd *abfd) bfd_close (nbfd); return; } @@ -432,14 +201,6 @@ index 1c72b748a8f..be9d1e58bf3 100644 } else { -@@ -239,6 +243,7 @@ bfd_plugin_get_symbols_in_object_only (bfd *abfd) - - /* Open the file containing object only section. */ - nbfd = bfd_openr (object_only_file, NULL); -+ nbfd->plugin_format = bfd_plugin_no; - if (!bfd_check_format (nbfd, bfd_object)) - { - (*_bfd_error_handler) diff --git a/binutils/nm.c b/binutils/nm.c index a5d56311dde..94333042ee2 100644 --- a/binutils/nm.c @@ -465,19 +226,10 @@ index a5d56311dde..94333042ee2 100644 report_plugin_err = false; non_fatal (_("%s: plugin needed to handle lto object"), diff --git a/binutils/objcopy.c b/binutils/objcopy.c -index 5774711abe6..3404bec1d08 100644 +index 8bd523aba13..3404bec1d08 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c -@@ -170,6 +170,8 @@ static bool sections_removed; - #if BFD_SUPPORTS_PLUGINS - /* TRUE if all GCC LTO sections are to be removed. */ - static bool lto_sections_removed; -+#else -+#define lto_sections_removed false - #endif - - /* TRUE if only some sections are to be copied. */ -@@ -3687,6 +3689,8 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, +@@ -3689,6 +3689,8 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, bool ok_object; const char *element_name; @@ -486,22 +238,7 @@ index 5774711abe6..3404bec1d08 100644 element_name = bfd_get_filename (this_element); /* PR binutils/17533: Do not allow directory traversal outside of the current directory tree by archive members. */ -@@ -3745,11 +3749,10 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, - - #if BFD_SUPPORTS_PLUGINS - /* Ignore plugin target if all LTO sections should be removed. */ -- ok_object = bfd_check_format_lto (this_element, bfd_object, -- lto_sections_removed); --#else -- ok_object = bfd_check_format (this_element, bfd_object); -+ if (lto_sections_removed) -+ this_element->plugin_format = bfd_plugin_no; - #endif -+ ok_object = bfd_check_format (this_element, bfd_object); - - /* PR binutils/3110: Cope with archives - containing multiple target types. */ -@@ -3768,7 +3771,9 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, +@@ -3769,7 +3771,9 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, #if BFD_SUPPORTS_PLUGINS /* Copy LTO IR file as unknown object. */ @@ -512,33 +249,7 @@ index 5774711abe6..3404bec1d08 100644 ok_object = false; else #endif -@@ -3863,6 +3868,25 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, - return ok; - } - -+static bool -+check_format_object (bfd *ibfd, char ***obj_matching, -+ bool no_plugins ATTRIBUTE_UNUSED) -+{ -+#if BFD_SUPPORTS_PLUGINS -+ /* Ignore plugin target first if all LTO sections should be -+ removed. Try with plugin target next if ignoring plugin -+ target fails to match the format. */ -+ if (no_plugins && ibfd->plugin_format == bfd_plugin_unknown) -+ { -+ ibfd->plugin_format = bfd_plugin_no; -+ if (bfd_check_format_matches (ibfd, bfd_object, obj_matching)) -+ return true; -+ ibfd->plugin_format = bfd_plugin_unknown; -+ } -+#endif -+ return bfd_check_format_matches (ibfd, bfd_object, obj_matching); -+} -+ - /* The top-level control. */ - - static void -@@ -3946,6 +3970,8 @@ copy_file (const char *input_filename, const char *output_filename, int ofd, +@@ -3966,6 +3970,8 @@ copy_file (const char *input_filename, const char *output_filename, int ofd, break; } @@ -547,30 +258,7 @@ index 5774711abe6..3404bec1d08 100644 if (bfd_check_format (ibfd, bfd_archive)) { bool force_output_target; -@@ -3988,21 +4014,7 @@ copy_file (const char *input_filename, const char *output_filename, int ofd, - input_arch, target_defaulted)) - status = 1; - } -- else if ( --#if BFD_SUPPORTS_PLUGINS -- /* Ignore plugin target first if all LTO sections should be -- removed. Try with plugin target next if ignoring plugin -- target fails to match the format. */ -- bfd_check_format_matches_lto (ibfd, bfd_object, &obj_matching, -- lto_sections_removed) -- || (lto_sections_removed -- && bfd_check_format_matches_lto (ibfd, bfd_object, -- &obj_matching, false)) --#else -- bfd_check_format_matches_lto (ibfd, bfd_object, &obj_matching, -- false) --#endif -- ) -+ else if (check_format_object (ibfd, &obj_matching, lto_sections_removed)) - { - bfd *obfd; - do_copy: -@@ -5066,6 +5078,11 @@ strip_main (int argc, char *argv[]) +@@ -5072,6 +5078,11 @@ strip_main (int argc, char *argv[]) SECTION_CONTEXT_REMOVE) || !!find_section_list (".llvm.lto", false, SECTION_CONTEXT_REMOVE)); @@ -775,5 +463,8 @@ index 00000000000..cd0130cacdf +foo (void) +{ +} + +base-commit: d6e93eedfb9e75846c3083f49f9015eda1a2be33 -- 2.50.1 +