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 6BD0E15827B for ; Mon, 18 Aug 2025 15:39:38 +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 4F8DE341E9E for ; Mon, 18 Aug 2025 15:39:38 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 43091110280; Mon, 18 Aug 2025 15:39:37 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 34CE7110280 for ; Mon, 18 Aug 2025 15:39:37 +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 DBB0C341E90 for ; Mon, 18 Aug 2025 15:39:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7AD8B336B for ; Mon, 18 Aug 2025 15:39:35 +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: <1755531560.61e1223b7d1b5bdc95fc287a9e9f7c48e9cb5127.sam@gentoo> Subject: [gentoo-commits] proj/toolchain/binutils-patches:master commit in: 9999/ X-VCS-Repository: proj/toolchain/binutils-patches X-VCS-Files: 9999/0009-ld-section-size.patch X-VCS-Directories: 9999/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 61e1223b7d1b5bdc95fc287a9e9f7c48e9cb5127 X-VCS-Branch: master Date: Mon, 18 Aug 2025 15:39:35 +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: 00536b02-2178-4299-8b37-64031dafb7a5 X-Archives-Hash: caac4e9768c4c64312a1845955f40fe6 commit: 61e1223b7d1b5bdc95fc287a9e9f7c48e9cb5127 Author: Sam James gentoo org> AuthorDate: Mon Aug 18 15:39:20 2025 +0000 Commit: Sam James gentoo org> CommitDate: Mon Aug 18 15:39:20 2025 +0000 URL: https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=61e1223b 9999: add section size fix Bug: https://sourceware.org/PR33291 Signed-off-by: Sam James gentoo.org> 9999/0009-ld-section-size.patch | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/9999/0009-ld-section-size.patch b/9999/0009-ld-section-size.patch new file mode 100644 index 0000000..70f6f28 --- /dev/null +++ b/9999/0009-ld-section-size.patch @@ -0,0 +1,46 @@ +https://sourceware.org/bugzilla/show_bug.cgi?id=33291#c10 +--- a/ld/ldlang.c ++++ b/ld/ldlang.c +@@ -2857,14 +2857,24 @@ lang_add_section (lang_statement_list_ty + /* Only set SEC_READONLY flag on the first input section. */ + flags &= ~ SEC_READONLY; + +- /* Keep SEC_MERGE and SEC_STRINGS only if they are the same. */ +- if ((output->bfd_section->flags & (SEC_MERGE | SEC_STRINGS)) +- != (flags & (SEC_MERGE | SEC_STRINGS)) +- || ((flags & SEC_MERGE) != 0 +- && output->bfd_section->entsize != section->entsize)) ++ /* Keep entry size, SEC_MERGE, and SEC_STRINGS only if entry sizes are ++ the same. */ ++ if (output->bfd_section->entsize != section->entsize) + { +- output->bfd_section->flags &= ~ (SEC_MERGE | SEC_STRINGS); +- flags &= ~ (SEC_MERGE | SEC_STRINGS); ++ output->bfd_section->entsize = 0; ++ flags &= ~(SEC_MERGE | SEC_STRINGS); ++ } ++ ++ /* Keep SEC_MERGE and SEC_STRINGS (each) only if they are the same. */ ++ if ((output->bfd_section->flags ^ flags) & SEC_MERGE) ++ { ++ output->bfd_section->flags &= ~SEC_MERGE; ++ flags &= ~SEC_MERGE; ++ } ++ if ((output->bfd_section->flags ^ flags) & SEC_STRINGS) ++ { ++ output->bfd_section->flags &= ~SEC_STRINGS; ++ flags &= ~SEC_STRINGS; + } + } + output->bfd_section->flags |= flags; +@@ -2879,8 +2889,9 @@ lang_add_section (lang_statement_list_ty + link_info.output_bfd, + output->bfd_section, + &link_info); +- if ((flags & SEC_MERGE) != 0) ++ //todo if (no earlier data statements) + output->bfd_section->entsize = section->entsize; ++ //todo also need to deal with later data statements + } + + if ((flags & SEC_TIC54X_BLOCK) != 0