Skip to content

Commit 206bf65

Browse files
committed
Fix test
Fixes #1130
1 parent 2b3e8ee commit 206bf65

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/elf/icf-safe.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
#!/bin/bash
22
. $(dirname $0)/common.inc
33

4-
cat <<EOF | $GCC -c -o $t/a.o -ffunction-sections -fdata-sections -xc -
4+
# GCC 11 or older uses R_390_PLT32DBL to take an address of a function
5+
# instead of R_390_PC32DBL
6+
if [ $MACHINE = s390x ]; then
7+
echo 'void *foo() { return foo; }' | $CC -c -o $t/a.o -xc -
8+
readelf -r $t/a.o | grep -q R_390_PLT32DBL && skip
9+
fi
10+
11+
cat <<EOF | $CC -c -o $t/a.o -ffunction-sections -fdata-sections -xc -
512
int bar() {
613
return 5;
714
}
@@ -34,7 +41,7 @@ EOF
3441
$CC -B. -o $t/exe1 -Wl,-icf=safe $t/a.o $t/b.o
3542
$QEMU $t/exe1 | grep -q '^0 0$'
3643

37-
cat <<EOF | $GCC -c -o $t/c.o -ffunction-sections -fdata-sections -xc -
44+
cat <<EOF | $CC -c -o $t/c.o -ffunction-sections -fdata-sections -xc -
3845
int foo1();
3946
int foo2();
4047
int foo3();

0 commit comments

Comments
 (0)