sys-devel/mold: drop unused patches

Signed-off-by: idealseal <realidealseal@protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42879
Closes: https://github.com/gentoo/gentoo/pull/42879
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
idealseal
2025-07-08 09:26:33 +00:00
committed by Sam James
parent 85082d61fc
commit 025aec0a9e
2 changed files with 0 additions and 98 deletions

View File

@@ -1,70 +0,0 @@
https://github.com/rui314/mold/commit/8bae43b842f1ded33830a95b8fc7ba8b0a53086f
From 8bae43b842f1ded33830a95b8fc7ba8b0a53086f Mon Sep 17 00:00:00 2001
From: Rui Ueyama <ruiu@cs.stanford.edu>
Date: Wed, 30 Apr 2025 20:37:14 +0900
Subject: [PATCH] Make --default-symver work with version scripts
Previously, symbols specified with the `global:` label were unversioned
even if --default-symver was given. Now, such symbols are versioned with
the output file's soname.
Fixes https://github.com/rui314/mold/issues/1448
---
src/cmdline.cc | 2 --
src/output-chunks.cc | 8 ++++++++
test/default-symver-version-script.sh | 11 +++++++++++
3 files changed, 19 insertions(+), 2 deletions(-)
create mode 100755 test/default-symver-version-script.sh
diff --git a/src/cmdline.cc b/src/cmdline.cc
index d27f6bdc3d..a6471d5bba 100644
--- a/src/cmdline.cc
+++ b/src/cmdline.cc
@@ -1510,9 +1510,7 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
std::string ver = ctx.arg.soname;
if (ver.empty())
ver = path_filename(ctx.arg.output);
-
ctx.arg.version_definitions.push_back(ver);
- ctx.default_version = VER_NDX_LAST_RESERVED + 1;
}
for (std::string_view path : version_scripts) {
diff --git a/src/output-chunks.cc b/src/output-chunks.cc
index 605f3c2f50..838ee838f3 100644
--- a/src/output-chunks.cc
+++ b/src/output-chunks.cc
@@ -2632,6 +2632,14 @@ void VerdefSection<E>::construct(Context<E> &ctx) {
if (ctx.arg.version_definitions.empty())
return;
+ // Handle --default-symver
+ if (ctx.arg.default_symver)
+ for (Symbol<E> *sym : ctx.dynsym->symbols)
+ if (sym && !sym->file->is_dso)
+ if (u16 ver = sym->ver_idx;
+ ver == VER_NDX_GLOBAL || ver == VER_NDX_UNSPECIFIED)
+ sym->ver_idx = VER_NDX_LAST_RESERVED + 1;
+
// Resize .gnu.version and write to it
ctx.versym->contents.resize(ctx.dynsym->symbols.size(), VER_NDX_GLOBAL);
ctx.versym->contents[0] = VER_NDX_LOCAL;
diff --git a/test/default-symver-version-script.sh b/test/default-symver-version-script.sh
new file mode 100755
index 0000000000..5b3d22b24f
--- /dev/null
+++ b/test/default-symver-version-script.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+. $(dirname $0)/common.inc
+
+cat <<EOF | $CC -o $t/a.o -c -xc -
+void foo() {}
+EOF
+
+echo '{ global: foo; local: *; };' > $t/b.ver
+
+$CC -B. -o $t/c.so -shared $t/a.o -Wl,--default-symver -Wl,--version-script=$t/b.ver
+readelf --dyn-syms $t/c.so | grep -F ' foo@@c.so'

View File

@@ -1,28 +0,0 @@
https://github.com/rui314/mold/issues/1447
https://github.com/rui314/mold/commit/83dd35397955bd179723ce31d52fc30836a65eed
From 83dd35397955bd179723ce31d52fc30836a65eed Mon Sep 17 00:00:00 2001
From: Rui Ueyama <ruiu@cs.stanford.edu>
Date: Thu, 1 May 2025 09:33:52 +0900
Subject: [PATCH] Prevent oscillation when computing the size of the phdr
Fixes https://github.com/rui314/mold/issues/1447
---
src/passes.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/passes.cc b/src/passes.cc
index a2f1ed3347..5845dd6a19 100644
--- a/src/passes.cc
+++ b/src/passes.cc
@@ -2780,7 +2780,7 @@ i64 set_osec_offsets(Context<E> &ctx) {
if (ctx.phdr) {
i64 sz = ctx.phdr->shdr.sh_size;
ctx.phdr->update_shdr(ctx);
- if (sz != ctx.phdr->shdr.sh_size)
+ if (sz < ctx.phdr->shdr.sh_size)
continue;
}