summaryrefslogtreecommitdiffstats
path: root/trunk/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/testsuite')
-rw-r--r--trunk/testsuite/ifunc.h34
-rwxr-xr-xtrunk/testsuite/reloc2.sh7
-rwxr-xr-xtrunk/testsuite/reloc8.sh9
-rwxr-xr-xtrunk/testsuite/reloc9.sh9
-rwxr-xr-xtrunk/testsuite/tls3.sh7
5 files changed, 55 insertions, 11 deletions
diff --git a/trunk/testsuite/ifunc.h b/trunk/testsuite/ifunc.h
index 3593396..036444b 100644
--- a/trunk/testsuite/ifunc.h
+++ b/trunk/testsuite/ifunc.h
@@ -16,18 +16,42 @@
# else
# define IFUNC_ASM(fn) "\tmovl $" fn ", %eax\n\tret\n"
# endif
+#elif defined __powerpc__
+# define IFUNC_ASM(fn) "\tmflr 12\n\tbcl 20,31,1f\n" \
+ "\t1:mflr 3\n\tmtlr 12\n\taddis 3,3, " fn \
+ "-1b@ha\n\taddi 3,3," fn "-1b@l\n\tblr\n"
+# if defined __powerpc64__
+# define IFUNC_DECL(name, hidden, fn1, fn2) \
+asm (".text\n" \
+ "\t.globl " #name "\n" \
+ "\t" hidden " " #name "\n" \
+ "\t.type " #name ", @gnu_indirect_function\n" \
+ "\t.section .opd,\"aw\"\n" \
+ "\t.align 3\n" \
+ #name ":\n" \
+ "\t.quad .L." #name ",.TOC.@tocbase,0\n" \
+ "\t.previous\n" \
+ ".L." #name ":\n" \
+ IFUNC_ASM (PICK (fn1, fn2)) \
+ "\t.size " #name ", .-" #name "\n")
+# endif
#else
# error Architecture not supported
#endif
-#define IFUNC(name, hidden, fn1, fn2) \
-extern __typeof (fn1) fn1 __attribute__((used)); \
-extern __typeof (fn2) fn2 __attribute__((used)); \
-extern __typeof (fn1) name; \
-asm (".globl " #name "\n" \
+#ifndef IFUNC_DECL
+#define IFUNC_DECL(name, hidden, fn1, fn2) \
+asm (".text\n" \
+ "\t.globl " #name "\n" \
"\t" hidden " " #name "\n" \
"\t.type " #name ", @gnu_indirect_function\n" \
#name ":\n" \
IFUNC_ASM (PICK (fn1, fn2)) \
"\t.size " #name ", .-" #name "\n")
+#endif
+#define IFUNC(name, hidden, fn1, fn2) \
+extern __typeof (fn1) fn1 __attribute__((used)); \
+extern __typeof (fn2) fn2 __attribute__((used)); \
+extern __typeof (fn1) name; \
+IFUNC_DECL (name, hidden, fn1, fn2)
#define IFUNC_LOCAL(name, fn1, fn2) IFUNC(name, ".hidden", fn1, fn2)
#define IFUNC_GLOBAL(name, fn1, fn2) IFUNC(name, ".globl", fn1, fn2)
diff --git a/trunk/testsuite/reloc2.sh b/trunk/testsuite/reloc2.sh
index 0ab76cd..2a75717 100755
--- a/trunk/testsuite/reloc2.sh
+++ b/trunk/testsuite/reloc2.sh
@@ -6,7 +6,12 @@ case "`uname -m`" in
s390*) if file reloc1lib1.so | grep -q 64-bit; then SHFLAGS=-fpic; fi;;
esac
# Disable this test under SELinux if textrel
-test -z "$SHFLAGS" -a -x /usr/sbin/getenforce -a "`/usr/sbin/getenforce`" = Enforcing && exit 77
+if test -z "$SHFLAGS" -a -x /usr/sbin/getenforce; then
+ case "`/usr/sbin/getenforce 2>/dev/null`" in
+ Permissive|Disabled) ;;
+ *) exit 77 ;;
+ esac
+fi
rm -f reloc2 reloc2lib*.so reloc2.log
$CC -shared $SHFLAGS -O2 -o reloc2lib1.so $srcdir/reloc2lib1.c
$CC -shared $SHFLAGS -O2 -o reloc2lib2.so $srcdir/reloc2lib2.c \
diff --git a/trunk/testsuite/reloc8.sh b/trunk/testsuite/reloc8.sh
index 9f5e1fb..af3aa26 100755
--- a/trunk/testsuite/reloc8.sh
+++ b/trunk/testsuite/reloc8.sh
@@ -2,13 +2,18 @@
. `dirname $0`/functions.sh
# Disable this test under SELinux
if [ "x$CROSS" = "x" ]; then
- test -x /usr/sbin/getenforce -a "`/usr/sbin/getenforce`" = Enforcing && exit 77
+ if test -x /usr/sbin/getenforce; then
+ case "`/usr/sbin/getenforce 2>/dev/null`" in
+ Permissive|Disabled) ;;
+ *) exit 77 ;;
+ esac
+ fi
fi
rm -f reloc8 reloc8lib*.so reloc8.log
rm -f prelink.cache
NOCOPYRELOC=-Wl,-z,nocopyreloc
case "`uname -m`" in
- x86_64|s390*) if file reloc1lib1.so | grep -q 64-bit; then NOCOPYRELOC=; fi;;
+ x86_64|s390*|sparc*) if file reloc1lib1.so | grep -q 64-bit; then NOCOPYRELOC=; fi;;
esac
$CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc8lib1.so $srcdir/reloc3lib1.c
$CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc8lib2.so $srcdir/reloc1lib2.c reloc8lib1.so
diff --git a/trunk/testsuite/reloc9.sh b/trunk/testsuite/reloc9.sh
index d3a449c..8c48fa7 100755
--- a/trunk/testsuite/reloc9.sh
+++ b/trunk/testsuite/reloc9.sh
@@ -2,13 +2,18 @@
. `dirname $0`/functions.sh
# Disable this test under SELinux
if [ "x$CROSS" = "x" ]; then
- test -x /usr/sbin/getenforce -a "`/usr/sbin/getenforce`" = Enforcing && exit 77
+ if test -x /usr/sbin/getenforce; then
+ case "`/usr/sbin/getenforce 2>/dev/null`" in
+ Permissive|Disabled) ;;
+ *) exit 77 ;;
+ esac
+ fi
fi
rm -f reloc9 reloc9lib*.so reloc9.log
rm -f prelink.cache
NOCOPYRELOC=-Wl,-z,nocopyreloc
case "`uname -m`" in
- x86_64|s390*) if file reloc1lib1.so | grep -q 64-bit; then NOCOPYRELOC=; fi;;
+ x86_64|s390*|sparc*) if file reloc1lib1.so | grep -q 64-bit; then NOCOPYRELOC=; fi;;
esac
$CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc9lib1.so $srcdir/reloc3lib1.c
$CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc9lib2.so $srcdir/reloc1lib2.c reloc9lib1.so
diff --git a/trunk/testsuite/tls3.sh b/trunk/testsuite/tls3.sh
index 8d015d9..6bb1f95 100755
--- a/trunk/testsuite/tls3.sh
+++ b/trunk/testsuite/tls3.sh
@@ -10,7 +10,12 @@ case "`uname -m`" in
ia64|ppc*|x86_64|alpha*|s390*|mips*|arm*) SHFLAGS=-fpic;; # Does not support non-pic shared libs
esac
# Disable this test under SELinux if textrel
-test -z "$SHFLAGS" -a -x /usr/sbin/getenforce -a "`/usr/sbin/getenforce`" = Enforcing && exit 77
+if test -z "$SHFLAGS" -a -x /usr/sbin/getenforce; then
+ case "`/usr/sbin/getenforce 2>/dev/null`" in
+ Permissive|Disabled) ;;
+ *) exit 77 ;;
+ esac
+fi
rm -f tls3 tls3lib*.so tls3.log
rm -f prelink.cache
$CC -shared -O2 -fpic -o tls3lib1.so $srcdir/tls1lib1.c