commit:     cbaea18da896544fe554bfb5bf0fc5f77e6f3053
Author:     Brett A C Sheffield <bacs <AT> librecast <DOT> net>
AuthorDate: Thu Mar  5 09:02:11 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar  8 04:16:29 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cbaea18d

sys-devel/mold: update upstream patch for AS_NEEDED

Signed-off-by: Brett A C Sheffield <bacs <AT> librecast.net>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/219
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/files/mold-2.40.4-as-needed-group.patch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys-devel/mold/files/mold-2.40.4-as-needed-group.patch 
b/sys-devel/mold/files/mold-2.40.4-as-needed-group.patch
index 922c9f71d283..4284e72515d4 100644
--- a/sys-devel/mold/files/mold-2.40.4-as-needed-group.patch
+++ b/sys-devel/mold/files/mold-2.40.4-as-needed-group.patch
@@ -2,9 +2,9 @@ https://bugs.gentoo.org/968893
 https://github.com/rui314/mold/issues/1545
 https://github.com/rui314/mold/pull/1546
 
-From df7b1433b9dab52f207975a90bcef068e3999047 Mon Sep 17 00:00:00 2001
+From e0a6f8e1d3881b0c9493cd33930959c60301fa81 Mon Sep 17 00:00:00 2001
 From: Jonathan Wakely <[email protected]>
-Date: Wed, 21 Jan 2026 11:39:57 +0000
+Date: Sat, 28 Feb 2026 09:08:49 +0000
 Subject: [PATCH] Fix getting output type from linker scripts that use
  AS_NEEDED
 
@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Wakely <[email protected]>
  create mode 100755 test/linker-script-group-as-needed.sh
 
 diff --git a/src/linker-script.cc b/src/linker-script.cc
-index 51144b3029..b40191887b 100644
+index 51144b3029..6848b0e8b3 100644
 --- a/src/linker-script.cc
 +++ b/src/linker-script.cc
 @@ -249,9 +249,12 @@ std::string_view Script<E>::get_script_output_type() {
@@ -31,7 +31,7 @@ index 51144b3029..b40191887b 100644
    if (tok.size() >= 3 && (tok[0] == "INPUT" || tok[0] == "GROUP") &&
 -      tok[1] == "(")
 +      tok[1] == "(") {
-+    if (tok[2] == "AS_NEEDED" && tok[3] == "(")
++    if (tok.size() >= 5 && tok[2] == "AS_NEEDED" && tok[3] == "(")
 +      tok = tok.subspan(2);
      if (MappedFile *mf = resolve_path(tok[2], false))
        return get_machine_type(ctx, rctx, mf);

Reply via email to