From 0c6daad215d0b0d4f835e33366d41a9218212367 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 7 Nov 2023 15:11:22 +0900 Subject: [PATCH] Add more tests --- test/elf/ifunc-address-equality-exported.sh | 4 ++-- test/elf/ifunc-funcptr.sh | 7 +++++-- test/elf/ifunc-noplt.sh | 7 +++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test/elf/ifunc-address-equality-exported.sh b/test/elf/ifunc-address-equality-exported.sh index 74bb76b8b2..2fec8e4ba3 100755 --- a/test/elf/ifunc-address-equality-exported.sh +++ b/test/elf/ifunc-address-equality-exported.sh @@ -29,5 +29,5 @@ int main() { } EOF -$CC -B. -o $t/exe1 $t/c.o $t/b.so -no-pie -$QEMU $t/exe1 | grep -Eq '^(\S+) \1' +$CC -B. -o $t/exe $t/c.o $t/b.so -no-pie +$QEMU $t/exe | grep -Eq '^(\S+) \1' diff --git a/test/elf/ifunc-funcptr.sh b/test/elf/ifunc-funcptr.sh index 3649d82144..641eed241e 100755 --- a/test/elf/ifunc-funcptr.sh +++ b/test/elf/ifunc-funcptr.sh @@ -33,5 +33,8 @@ int main() { } EOF -$CC -B. -o $t/exe $t/a.o $t/b.o $t/c.o -$QEMU $t/exe | grep -q '^3$' +$CC -B. -o $t/exe1 $t/a.o $t/b.o $t/c.o -pie +$QEMU $t/exe1 | grep -q '^3$' + +$CC -B. -o $t/exe2 $t/a.o $t/b.o $t/c.o -no-pie +$QEMU $t/exe2 | grep -q '^3$' diff --git a/test/elf/ifunc-noplt.sh b/test/elf/ifunc-noplt.sh index ef92bac147..8a55dbe792 100755 --- a/test/elf/ifunc-noplt.sh +++ b/test/elf/ifunc-noplt.sh @@ -24,5 +24,8 @@ int main() { } EOF -$CC -B. -o $t/exe $t/a.o -$QEMU $t/exe | grep -q 'Hello world' +$CC -B. -o $t/exe1 $t/a.o -pie +$QEMU $t/exe1 | grep -q 'Hello world' + +$CC -B. -o $t/exe2 $t/a.o -no-pie +$QEMU $t/exe2 | grep -q 'Hello world'