Skip to content

Commit

Permalink
Attempt to fix a test failure
Browse files Browse the repository at this point in the history
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 #1244
  • Loading branch information
rui314 committed Apr 25, 2024
1 parent 55bb6bc commit 002d619
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/elf/exception-multiple-ehframe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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$'

0 comments on commit 002d619

Please sign in to comment.