You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-devel/mold/files/mold-2.30.0-gcc14.patch

77 lines
2.4 KiB

https://github.com/rui314/mold/issues/1244
https://github.com/rui314/mold/commit/002d619b11f38438514f4714f9eb89e8015ba1b6
https://github.com/rui314/mold/commit/14952546a489c23236f50adc5ef9c8ada4f4e31a
From 002d619b11f38438514f4714f9eb89e8015ba1b6 Mon Sep 17 00:00:00 2001
From: Rui Ueyama <ruiu@cs.stanford.edu>
Date: Thu, 25 Apr 2024 16:58:09 +0900
Subject: [PATCH] Attempt to fix a test failure
I believe some version of objcopy corrupts an object file when
renaming a section. In this change, I use sed instead of objcopy
as a workaround.
Fixes https://github.com/rui314/mold/issues/1244
---
test/elf/exception-multiple-ehframe.sh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/test/elf/exception-multiple-ehframe.sh b/test/elf/exception-multiple-ehframe.sh
index ca1d1a1c0..a9b360b09 100755
--- a/test/elf/exception-multiple-ehframe.sh
+++ b/test/elf/exception-multiple-ehframe.sh
@@ -28,9 +28,9 @@ int bar() {
}
EOF
-$OBJCOPY --rename-section .eh_frame=.eh_frame2 $t/a.o
+sed -i 's/\.eh_frame/.EH_FRAME/g' $t/a.o
./mold -r -o $t/c.o $t/a.o $t/b.o
-$OBJCOPY --rename-section .eh_frame2=.eh_frame $t/c.o
+sed -i 's/\.EH_FRAME/.eh_frame/g' $t/c.o
cat <<EOF | $CXX -o $t/d.o -c -xc++ -
#include <stdio.h>
@@ -44,5 +44,4 @@ int main() {
EOF
$CXX -B. -o $t/exe1 $t/d.o $t/c.o
-$QEMU $t/exe1
$QEMU $t/exe1 | grep -q '^1 3$'
From 14952546a489c23236f50adc5ef9c8ada4f4e31a Mon Sep 17 00:00:00 2001
From: Rui Ueyama <ruiu@cs.stanford.edu>
Date: Sun, 28 Apr 2024 13:04:43 +0900
Subject: [PATCH] Do not edit binary files with sed
Fixes https://github.com/rui314/mold/issues/1244
---
test/elf/exception-multiple-ehframe.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/elf/exception-multiple-ehframe.sh b/test/elf/exception-multiple-ehframe.sh
index a9b360b09..8cc31624a 100755
--- a/test/elf/exception-multiple-ehframe.sh
+++ b/test/elf/exception-multiple-ehframe.sh
@@ -3,6 +3,8 @@
nm mold | grep -q '__tsan_init' && skip
+which perl > /dev/null || skip
+
[ $MACHINE = m68k ] && skip
[ $MACHINE = sh4 ] && skip
@@ -28,9 +30,9 @@ int bar() {
}
EOF
-sed -i 's/\.eh_frame/.EH_FRAME/g' $t/a.o
+perl -i -0777 -pe 's/\.eh_frame/.EH_FRAME/g' $t/a.o
./mold -r -o $t/c.o $t/a.o $t/b.o
-sed -i 's/\.EH_FRAME/.eh_frame/g' $t/c.o
+perl -i -0777 -pe 's/\.EH_FRAME/.eh_frame/g' $t/c.o
cat <<EOF | $CXX -o $t/d.o -c -xc++ -
#include <stdio.h>