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 3E72C15808A for ; Wed, 06 Aug 2025 04:07:54 +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 2AE6533BEE9 for ; Wed, 06 Aug 2025 04:07:54 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 2C92F11036D; Wed, 06 Aug 2025 04:07:53 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 263AB11036D for ; Wed, 06 Aug 2025 04:07:53 +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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CC6DC33BEE9 for ; Wed, 06 Aug 2025 04:07:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 406213234 for ; Wed, 06 Aug 2025 04:07:51 +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: <1754453256.96a63f007bbaf13ef507bdeb61327a0dce815d79.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: 96a63f007bbaf13ef507bdeb61327a0dce815d79 X-VCS-Branch: master Date: Wed, 06 Aug 2025 04:07:51 +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: 5bab3b98-d608-4cc1-ab98-d0deda3c152d X-Archives-Hash: 1231053477a691221203f78e838a5f31 commit: 96a63f007bbaf13ef507bdeb61327a0dce815d79 Author: Sam James gentoo org> AuthorDate: Wed Aug 6 04:07:36 2025 +0000 Commit: Sam James gentoo org> CommitDate: Wed Aug 6 04:07:36 2025 +0000 URL: https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=96a63f00 9999: refresh strip LTO patch Signed-off-by: Sam James gentoo.org> ...n-t-treat-fat-IR-objects-as-plugin-object.patch | 72 ++++++++++++---------- 1 file changed, 38 insertions(+), 34 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 7957964..ca9a282 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,9 +1,9 @@ -https://inbox.sourceware.org/binutils/20250806010532.3404344-1-hjl.tools@gmail.com/ +https://inbox.sourceware.org/binutils/20250806040426.3697458-1-hjl.tools@gmail.com/T/#u -From e48e12720aa4a7c3f97d70dc0d64e5ac665ccdd5 Mon Sep 17 00:00:00 2001 -Message-ID: +From 2d6b40ce9b89f5e6b2497071910baab839d8e60b Mon Sep 17 00:00:00 2001 +Message-ID: <2d6b40ce9b89f5e6b2497071910baab839d8e60b.1754453238.git.sam@gentoo.org> From: "H.J. Lu" -Date: Tue, 5 Aug 2025 18:05:32 -0700 +Date: Tue, 5 Aug 2025 21:04:26 -0700 Subject: [PATCH] strip: Don't treat fat IR objects as plugin object Fat IR objects contains both regular sections and IR sections. After @@ -63,20 +63,20 @@ ld/ Signed-off-by: H.J. Lu --- - bfd/archive.c | 12 +- + bfd/archive.c | 10 ++ bfd/bfd-in2.h | 3 + bfd/bfd.c | 3 + - bfd/format.c | 22 ++- + bfd/format.c | 25 +++- bfd/plugin.c | 3 + - binutils/nm.c | 6 +- + binutils/nm.c | 9 +- binutils/objcopy.c | 13 +- ld/testsuite/ld-plugin/lto-binutils.exp | 175 ++++++++++++++++++++++++ ld/testsuite/ld-plugin/pr33246.c | 4 + - 9 files changed, 230 insertions(+), 11 deletions(-) + 9 files changed, 238 insertions(+), 7 deletions(-) create mode 100644 ld/testsuite/ld-plugin/pr33246.c diff --git a/bfd/archive.c b/bfd/archive.c -index c61d4b12658..491c44f5191 100644 +index c61d4b12658..697b2ed23f2 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -141,6 +141,10 @@ SUBSECTION @@ -90,25 +90,23 @@ index c61d4b12658..491c44f5191 100644 #ifndef errno extern int errno; -@@ -2342,7 +2346,8 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) - long symcount; +@@ -2343,6 +2347,9 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) long src_count; -- if (bfd_get_lto_type (current) == lto_slim_ir_object -+ if (!bfd_plugin_target_p (current->xvec) -+ && bfd_get_lto_type (current) == lto_slim_ir_object + if (bfd_get_lto_type (current) == lto_slim_ir_object ++#if BFD_SUPPORTS_PLUGINS ++ && !bfd_plugin_target_p (current->xvec) ++#endif && report_plugin_err) { report_plugin_err = false; -@@ -2398,8 +2403,9 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) - map = new_map; - } +@@ -2400,6 +2407,9 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) -- if (bfd_lto_slim_symbol_p (current, -- syms[src_count]->name) -+ if (!bfd_plugin_target_p (current->xvec) -+ && bfd_lto_slim_symbol_p (current, -+ syms[src_count]->name) + if (bfd_lto_slim_symbol_p (current, + syms[src_count]->name) ++#if BFD_SUPPORTS_PLUGINS ++ && !bfd_plugin_target_p (current->xvec) ++#endif && report_plugin_err) { report_plugin_err = false; @@ -141,7 +139,7 @@ index 858ab5ce017..4aded6809bb 100644 . ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; . diff --git a/bfd/format.c b/bfd/format.c -index d2bc318977c..d883aa5e5a8 100644 +index d2bc318977c..bd9fa8d6c33 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -389,6 +389,11 @@ bfd_set_lto_type (bfd *abfd ATTRIBUTE_UNUSED) @@ -168,7 +166,7 @@ index d2bc318977c..d883aa5e5a8 100644 if (matching != NULL || *bfd_associated_vector != NULL) { -@@ -510,7 +512,17 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) +@@ -510,7 +512,20 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) cleanup = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); @@ -180,10 +178,13 @@ index d2bc318977c..d883aa5e5a8 100644 + standalone fat IR object, it will be copied as non-IR + object. */ + if (cleanup ++#if BFD_SUPPORTS_PLUGINS + && (!abfd->is_strip_input + || !bfd_plugin_target_p (abfd->xvec) + || (abfd->lto_type != lto_fat_ir_object -+ && abfd->my_archive == NULL))) ++ && abfd->my_archive == NULL)) ++#endif ++ ) goto ok_ret; /* For a long time the code has dropped through to check all @@ -202,26 +203,29 @@ index ebdf2505cbc..43ca444e7a1 100644 else { diff --git a/binutils/nm.c b/binutils/nm.c -index a5d56311dde..94333042ee2 100644 +index a5d56311dde..d44083dcc94 100644 --- a/binutils/nm.c +++ b/binutils/nm.c -@@ -801,7 +801,8 @@ filter_symbols (bfd *abfd, bool is_dynamic, void *minisyms, - if (sym == NULL) +@@ -802,6 +802,9 @@ filter_symbols (bfd *abfd, bool is_dynamic, void *minisyms, continue; -- if (bfd_lto_slim_symbol_p (abfd, sym->name) -+ if (!bfd_plugin_target_p (abfd->xvec) -+ && bfd_lto_slim_symbol_p (abfd, sym->name) + if (bfd_lto_slim_symbol_p (abfd, sym->name) ++#if BFD_SUPPORTS_PLUGINS ++ && !bfd_plugin_target_p (abfd->xvec) ++#endif && report_plugin_err) { report_plugin_err = false; -@@ -1484,7 +1485,8 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) +@@ -1484,7 +1487,11 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) /* lto_type is set to lto_non_ir_object when a bfd is loaded with a compiler LTO plugin. */ - if (bfd_get_lto_type (abfd) == lto_slim_ir_object) -+ if (!bfd_plugin_target_p (abfd->xvec) -+ && bfd_get_lto_type (abfd) == lto_slim_ir_object) ++ if (bfd_get_lto_type (abfd) == lto_slim_ir_object ++#if BFD_SUPPORTS_PLUGINS ++ && !bfd_plugin_target_p (abfd->xvec) ++#endif ++ ) { report_plugin_err = false; non_fatal (_("%s: plugin needed to handle lto object"),