summaryrefslogtreecommitdiffstats
path: root/trunk/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/testsuite')
-rw-r--r--trunk/testsuite/Makefile.am5
-rw-r--r--trunk/testsuite/Makefile.in5
-rwxr-xr-xtrunk/testsuite/cxx1.sh7
-rw-r--r--trunk/testsuite/cxx2.C51
-rwxr-xr-xtrunk/testsuite/cxx2.sh19
-rw-r--r--trunk/testsuite/ifunc.h33
-rw-r--r--trunk/testsuite/ifunc1.c29
-rwxr-xr-xtrunk/testsuite/ifunc1.sh21
-rw-r--r--trunk/testsuite/ifunc1lib1.c32
-rw-r--r--trunk/testsuite/ifunc1lib2.c39
-rwxr-xr-xtrunk/testsuite/ifunc2.sh21
-rw-r--r--trunk/testsuite/ifunc3.c32
-rwxr-xr-xtrunk/testsuite/ifunc3.sh21
-rw-r--r--trunk/testsuite/ifunc3lib1.c37
-rw-r--r--trunk/testsuite/ifunctest.c16
-rwxr-xr-xtrunk/testsuite/quick2.sh8
-rwxr-xr-xtrunk/testsuite/reloc2.sh4
-rw-r--r--trunk/testsuite/reloc5.c3
-rw-r--r--trunk/testsuite/shuffle2.c6
-rw-r--r--trunk/testsuite/shuffle9.c58
-rwxr-xr-xtrunk/testsuite/shuffle9.sh18
-rwxr-xr-xtrunk/testsuite/tls3.sh4
22 files changed, 455 insertions, 14 deletions
diff --git a/trunk/testsuite/Makefile.am b/trunk/testsuite/Makefile.am
index 3af929b..0de603c 100644
--- a/trunk/testsuite/Makefile.am
+++ b/trunk/testsuite/Makefile.am
@@ -9,11 +9,12 @@ TESTS = movelibs.sh \
reloc1.sh reloc2.sh reloc3.sh reloc4.sh reloc5.sh reloc6.sh \
reloc7.sh reloc8.sh reloc9.sh reloc10.sh reloc11.sh \
shuffle1.sh shuffle2.sh shuffle3.sh shuffle4.sh shuffle5.sh \
- shuffle6.sh shuffle7.sh shuffle8.sh undo1.sh \
+ shuffle6.sh shuffle7.sh shuffle8.sh shuffle9.sh undo1.sh \
layout1.sh layout2.sh \
tls1.sh tls2.sh tls3.sh tls4.sh tls5.sh tls6.sh tls7.sh \
- cxx1.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \
+ cxx1.sh cxx2.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \
deps1.sh deps2.sh \
+ ifunc1.sh ifunc2.sh ifunc3.sh \
undosyslibs.sh
TESTS_ENVIRONMENT = \
PRELINK="../src/prelink -c ./prelink.conf -C ./prelink.cache --ld-library-path=. --dynamic-linker=`echo ./ld*.so.*[0-9]`" \
diff --git a/trunk/testsuite/Makefile.in b/trunk/testsuite/Makefile.in
index 205f6e3..395899f 100644
--- a/trunk/testsuite/Makefile.in
+++ b/trunk/testsuite/Makefile.in
@@ -104,11 +104,12 @@ TESTS = movelibs.sh \
reloc1.sh reloc2.sh reloc3.sh reloc4.sh reloc5.sh reloc6.sh \
reloc7.sh reloc8.sh reloc9.sh reloc10.sh reloc11.sh \
shuffle1.sh shuffle2.sh shuffle3.sh shuffle4.sh shuffle5.sh \
- shuffle6.sh shuffle7.sh shuffle8.sh undo1.sh \
+ shuffle6.sh shuffle7.sh shuffle8.sh shuffle9.sh undo1.sh \
layout1.sh layout2.sh \
tls1.sh tls2.sh tls3.sh tls4.sh tls5.sh tls6.sh tls7.sh \
- cxx1.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \
+ cxx1.sh cxx2.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \
deps1.sh deps2.sh \
+ ifunc1.sh ifunc2.sh ifunc3.sh \
undosyslibs.sh
TESTS_ENVIRONMENT = \
diff --git a/trunk/testsuite/cxx1.sh b/trunk/testsuite/cxx1.sh
index 81428c2..33f876d 100755
--- a/trunk/testsuite/cxx1.sh
+++ b/trunk/testsuite/cxx1.sh
@@ -11,10 +11,11 @@ savelibs
echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx1 > cxx1.log
$PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx1 >> cxx1.log 2>&1 || exit 1
grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx1.log | grep -q -v 'C++ conflict' && exit 2
+[ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx1.log | grep 'Removing C++ conflict' | wc -l ) -ge 5 ] || exit 3
if [ "x$CROSS" = "x" ]; then
- LD_LIBRARY_PATH=. ./cxx1 || exit 3
+ LD_LIBRARY_PATH=. ./cxx1 || exit 4
fi
-readelf -a ./cxx1 >> cxx1.log 2>&1 || exit 4
+readelf -a ./cxx1 >> cxx1.log 2>&1 || exit 5
# So that it is not prelinked again
chmod -x ./cxx1
-comparelibs >> cxx1.log 2>&1 || exit 5
+comparelibs >> cxx1.log 2>&1 || exit 6
diff --git a/trunk/testsuite/cxx2.C b/trunk/testsuite/cxx2.C
new file mode 100644
index 0000000..8b6e0bf
--- /dev/null
+++ b/trunk/testsuite/cxx2.C
@@ -0,0 +1,51 @@
+#include "cxx1.h"
+extern "C" void abort (void);
+
+int A::a ()
+{
+ return 30;
+}
+
+int A::b ()
+{
+ return 31;
+}
+
+int B::a ()
+{
+ return 32;
+}
+
+int C::a ()
+{
+ return 33;
+}
+
+int C::b ()
+{
+ return 34;
+}
+
+void
+check (A *x, B *y)
+{
+ C d;
+ if (x->b () != 31)
+ abort ();
+ if (y->B::a () != 32)
+ abort ();
+ if (d.a () != 33)
+ abort ();
+ if (d.C::b () != 34)
+ abort ();
+}
+
+int
+main ()
+{
+ A x;
+ if (x.a () != 30)
+ abort ();
+ do_check (check, &x);
+ return 0;
+}
diff --git a/trunk/testsuite/cxx2.sh b/trunk/testsuite/cxx2.sh
new file mode 100755
index 0000000..edad081
--- /dev/null
+++ b/trunk/testsuite/cxx2.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+. `dirname $0`/functions.sh
+rm -f cxx2 cxx2lib*.so cxx2.log
+rm -f prelink.cache
+$CXX -shared -O2 -fpic -o cxx2lib1.so $srcdir/cxx1lib1.C
+$CXX -shared -O2 -fpic -o cxx2lib2.so $srcdir/cxx1lib2.C cxx2lib1.so
+BINS="cxx2"
+LIBS="cxx2lib1.so cxx2lib2.so"
+$CXXLINK -o cxx2 $srcdir/cxx2.C -Wl,--rpath-link,. cxx2lib2.so
+savelibs
+echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx2 > cxx2.log
+$PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx2 >> cxx2.log 2>&1 || exit 1
+grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx2.log | grep -q -v 'C++ conflict' && exit 2
+[ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx2.log | grep 'Removing C++ conflict' | wc -l ) -ge 9 ] || exit 3
+LD_LIBRARY_PATH=. ./cxx2 || exit 4
+readelf -a ./cxx2 >> cxx2.log 2>&1 || exit 5
+# So that it is not prelinked again
+chmod -x ./cxx2
+comparelibs >> cxx2.log 2>&1 || exit 6
diff --git a/trunk/testsuite/ifunc.h b/trunk/testsuite/ifunc.h
new file mode 100644
index 0000000..3593396
--- /dev/null
+++ b/trunk/testsuite/ifunc.h
@@ -0,0 +1,33 @@
+#ifndef PICKNO
+# define PICKNO 1
+#endif
+#if PICKNO == 2
+# define PICK(fn1, fn2) #fn2
+#else
+# define PICK(fn1, fn2) #fn1
+#endif
+#ifdef __x86_64__
+# define IFUNC_ASM(fn) "\tleaq " fn "(%rip), %rax\n\tretq\n"
+#elif defined __i386__
+# ifdef __PIC__
+# define IFUNC_ASM(fn) "\tcall 1f\n1:\tpopl %ecx\n" \
+ "\taddl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx\n" \
+ "\tleal " fn "@GOTOFF(%ecx), %eax\n\tret\n"
+# else
+# define IFUNC_ASM(fn) "\tmovl $" fn ", %eax\n\tret\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" \
+ "\t" hidden " " #name "\n" \
+ "\t.type " #name ", @gnu_indirect_function\n" \
+ #name ":\n" \
+ IFUNC_ASM (PICK (fn1, fn2)) \
+ "\t.size " #name ", .-" #name "\n")
+#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/ifunc1.c b/trunk/testsuite/ifunc1.c
new file mode 100644
index 0000000..f5500df
--- /dev/null
+++ b/trunk/testsuite/ifunc1.c
@@ -0,0 +1,29 @@
+#include "ifunc.h"
+
+static int bint11 (void) { return 1; }
+static int bint12 (void) { return 2; }
+
+IFUNC_LOCAL (bint1, bint11, bint12);
+
+static int lib2t21 (void) { return 1; }
+static int lib2t22 (void) { return 2; }
+
+IFUNC_GLOBAL (lib2t2, lib2t21, lib2t22);
+
+extern int lib1t2 (void);
+extern int lib1test (void);
+extern int lib2test (void);
+
+extern void abort (void);
+
+int
+main (void)
+{
+ lib1test ();
+ lib2test ();
+ if (bint1 () != PICKNO)
+ abort ();
+ if (lib1t2 () != PICKNO)
+ abort ();
+ return 0;
+}
diff --git a/trunk/testsuite/ifunc1.sh b/trunk/testsuite/ifunc1.sh
new file mode 100755
index 0000000..7746234
--- /dev/null
+++ b/trunk/testsuite/ifunc1.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+. `dirname $0`/functions.sh
+# First check if __thread is supported by ld.so/gcc/ld/as:
+$CCLINK -o ifunctest $srcdir/ifunctest.c -Wl,--rpath-link,. > /dev/null 2>&1 || exit 77
+( ./ifunctest || { rm -f ifunctest; exit 77; } ) 2>/dev/null || exit 77
+rm -f ifunctest ifunc1 ifunc1lib*.so ifunc1.log
+rm -f prelink.cache
+$CC -shared -O2 -fpic -o ifunc1lib1.so $srcdir/ifunc1lib1.c
+$CC -shared -O2 -fpic -o ifunc1lib2.so $srcdir/ifunc1lib2.c ifunc1lib1.so
+BINS="ifunc1"
+LIBS="ifunc1lib1.so ifunc1lib2.so"
+$CCLINK -o ifunc1 $srcdir/ifunc1.c -Wl,--rpath-link,. ifunc1lib2.so
+savelibs
+echo $PRELINK ${PRELINK_OPTS--vm} ./ifunc1 >> ifunc1.log
+$PRELINK ${PRELINK_OPTS--vm} ./ifunc1 >> ifunc1.log 2>&1 || exit 1
+grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` ifunc1.log && exit 2
+LD_LIBRARY_PATH=. ./ifunc1 || exit 3
+readelf -a ./ifunc1 >> ifunc1.log 2>&1 || exit 4
+# So that it is not prelinked again
+chmod -x ./ifunc1
+comparelibs >> ifunc1.log 2>&1 || exit 5
diff --git a/trunk/testsuite/ifunc1lib1.c b/trunk/testsuite/ifunc1lib1.c
new file mode 100644
index 0000000..27a3f03
--- /dev/null
+++ b/trunk/testsuite/ifunc1lib1.c
@@ -0,0 +1,32 @@
+#include "ifunc.h"
+
+static int lib1t11 (void) { return 11; }
+static int lib1t12 (void) { return 12; }
+
+IFUNC_LOCAL (lib1t1, lib1t11, lib1t12);
+
+static int lib1t21 (void) { return 1; }
+static int lib1t22 (void) { return 2; }
+
+IFUNC_GLOBAL (lib1t2, lib1t21, lib1t22);
+
+static int lib1t31 (void) { return 3; }
+static int lib1t32 (void) { return 4; }
+
+IFUNC_GLOBAL (lib1t3, lib1t31, lib1t32);
+
+extern void abort (void);
+
+int (*lib1p1) (void) = lib1t1;
+
+int
+lib1test (void)
+{
+ if (lib1t1 () != PICKNO + 10)
+ abort ();
+ if (lib1t3 () != PICKNO)
+ abort ();
+ if (lib1p1 () != PICKNO + 10)
+ abort ();
+ return 0;
+}
diff --git a/trunk/testsuite/ifunc1lib2.c b/trunk/testsuite/ifunc1lib2.c
new file mode 100644
index 0000000..ca12e3d
--- /dev/null
+++ b/trunk/testsuite/ifunc1lib2.c
@@ -0,0 +1,39 @@
+#include "ifunc.h"
+
+static int lib2t11 (void) { return 1; }
+static int lib2t12 (void) { return 2; }
+
+IFUNC_LOCAL (lib2t1, lib2t11, lib2t12);
+
+static int lib2t21 (void) { return 3; }
+static int lib2t22 (void) { return 4; }
+
+IFUNC_GLOBAL (lib2t2, lib2t21, lib2t22);
+
+static int lib2t31 (void) { return 1; }
+static int lib2t32 (void) { return 2; }
+
+IFUNC_GLOBAL (lib2t3, lib2t31, lib2t32);
+
+static int lib1t31 (void) { return 1; }
+static int lib1t32 (void) { return 2; }
+
+IFUNC_GLOBAL (lib1t3, lib1t31, lib1t32);
+
+int (*lib2p1) (void) = lib2t2;
+
+extern void abort (void);
+
+int
+lib2test (void)
+{
+ if (lib2t1 () != PICKNO)
+ abort ();
+ if (lib2t2 () != PICKNO)
+ abort ();
+ if (lib2t3 () != PICKNO)
+ abort ();
+ if (lib2p1 () != PICKNO)
+ abort ();
+ return 0;
+}
diff --git a/trunk/testsuite/ifunc2.sh b/trunk/testsuite/ifunc2.sh
new file mode 100755
index 0000000..dea5bf4
--- /dev/null
+++ b/trunk/testsuite/ifunc2.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+. `dirname $0`/functions.sh
+# First check if __thread is supported by ld.so/gcc/ld/as:
+$CCLINK -o ifunctest $srcdir/ifunctest.c -Wl,--rpath-link,. > /dev/null 2>&1 || exit 77
+( ./ifunctest || { rm -f ifunctest; exit 77; } ) 2>/dev/null || exit 77
+rm -f ifunctest ifunc2 ifunc2lib*.so ifunc2.log
+rm -f prelink.cache
+$CC -shared -O2 -fpic -o ifunc2lib1.so $srcdir/ifunc1lib1.c -DPICKNO=2
+$CC -shared -O2 -fpic -o ifunc2lib2.so $srcdir/ifunc1lib2.c ifunc2lib1.so -DPICKNO=2
+BINS="ifunc2"
+LIBS="ifunc2lib1.so ifunc2lib2.so"
+$CCLINK -o ifunc2 $srcdir/ifunc1.c -Wl,--rpath-link,. ifunc2lib2.so -DPICKNO=2
+savelibs
+echo $PRELINK ${PRELINK_OPTS--vm} ./ifunc2 >> ifunc2.log
+$PRELINK ${PRELINK_OPTS--vm} ./ifunc2 >> ifunc2.log 2>&1 || exit 1
+grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` ifunc2.log && exit 2
+LD_LIBRARY_PATH=. ./ifunc2 || exit 3
+readelf -a ./ifunc2 >> ifunc2.log 2>&1 || exit 4
+# So that it is not prelinked again
+chmod -x ./ifunc2
+comparelibs >> ifunc2.log 2>&1 || exit 5
diff --git a/trunk/testsuite/ifunc3.c b/trunk/testsuite/ifunc3.c
new file mode 100644
index 0000000..1f243d8
--- /dev/null
+++ b/trunk/testsuite/ifunc3.c
@@ -0,0 +1,32 @@
+#include "ifunc.h"
+
+static int bint11 (void) { return 1; }
+static int bint12 (void) { return 2; }
+
+IFUNC_LOCAL (bint1, bint11, bint12);
+
+static int lib2t21 (void) { return 1; }
+static int lib2t22 (void) { return 2; }
+
+IFUNC_GLOBAL (lib2t2, lib2t21, lib2t22);
+
+extern int lib1t2 (void);
+extern int lib1test (void);
+extern int lib2test (void);
+extern int (*lib1p1) (void);
+
+extern void abort (void);
+
+int
+main (void)
+{
+ lib1test ();
+ lib2test ();
+ if (bint1 () != PICKNO)
+ abort ();
+ if (lib1t2 () != PICKNO)
+ abort ();
+ if (lib1p1 () != PICKNO + 10)
+ abort ();
+ return 0;
+}
diff --git a/trunk/testsuite/ifunc3.sh b/trunk/testsuite/ifunc3.sh
new file mode 100755
index 0000000..a54d4ec
--- /dev/null
+++ b/trunk/testsuite/ifunc3.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+. `dirname $0`/functions.sh
+# First check if __thread is supported by ld.so/gcc/ld/as:
+$CCLINK -o ifunctest $srcdir/ifunctest.c -Wl,--rpath-link,. > /dev/null 2>&1 || exit 77
+( ./ifunctest || { rm -f ifunctest; exit 77; } ) 2>/dev/null || exit 77
+rm -f ifunctest ifunc3 ifunc3lib*.so ifunc3.log
+rm -f prelink.cache
+$CC -shared -O2 -fpic -o ifunc3lib1.so $srcdir/ifunc3lib1.c
+$CC -shared -O2 -fpic -o ifunc3lib2.so $srcdir/ifunc1lib2.c ifunc3lib1.so
+BINS="ifunc3"
+LIBS="ifunc3lib1.so ifunc3lib2.so"
+$CCLINK -o ifunc3 $srcdir/ifunc3.c -Wl,--rpath-link,. ifunc3lib2.so
+savelibs
+echo $PRELINK ${PRELINK_OPTS--vm} ./ifunc3 >> ifunc3.log
+$PRELINK ${PRELINK_OPTS--vm} ./ifunc3 >> ifunc3.log 2>&1 || exit 1
+grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` ifunc3.log && exit 2
+LD_LIBRARY_PATH=. ./ifunc3 || exit 3
+readelf -a ./ifunc3 >> ifunc3.log 2>&1 || exit 4
+# So that it is not prelinked again
+chmod -x ./ifunc3
+comparelibs >> ifunc3.log 2>&1 || exit 5
diff --git a/trunk/testsuite/ifunc3lib1.c b/trunk/testsuite/ifunc3lib1.c
new file mode 100644
index 0000000..133b389
--- /dev/null
+++ b/trunk/testsuite/ifunc3lib1.c
@@ -0,0 +1,37 @@
+#include "ifunc.h"
+
+static int lib1t11 (void) { return 11; }
+static int lib1t12 (void) { return 12; }
+
+IFUNC_LOCAL (lib1t1, lib1t11, lib1t12);
+
+static int lib1t21 (void) { return 1; }
+static int lib1t22 (void) { return 2; }
+
+IFUNC_GLOBAL (lib1t2, lib1t21, lib1t22);
+
+static int lib1t31 (void) { return 3; }
+static int lib1t32 (void) { return 4; }
+
+IFUNC_GLOBAL (lib1t3, lib1t31, lib1t32);
+
+char lib1b1[4];
+char *lib1b2 = &lib1b1[2];
+
+extern void abort (void);
+
+int (*lib1p1) (void) = lib1t1;
+
+int
+lib1test (void)
+{
+ if (lib1t1 () != PICKNO + 10)
+ abort ();
+ if (lib1t3 () != PICKNO)
+ abort ();
+ if (lib1p1 () != PICKNO + 10)
+ abort ();
+ if (lib1b2 != lib1b1 + 2)
+ abort ();
+ return 0;
+}
diff --git a/trunk/testsuite/ifunctest.c b/trunk/testsuite/ifunctest.c
new file mode 100644
index 0000000..9ce7b1a
--- /dev/null
+++ b/trunk/testsuite/ifunctest.c
@@ -0,0 +1,16 @@
+#include "ifunc.h"
+
+static int foo1 (void) { return 1; }
+static int foo2 (void) { return 2; }
+
+IFUNC_LOCAL (foo, foo1, foo2);
+
+extern void abort (void);
+
+int
+main (void)
+{
+ if (foo () != PICKNO)
+ abort ();
+ return 0;
+}
diff --git a/trunk/testsuite/quick2.sh b/trunk/testsuite/quick2.sh
index 87138ae..1d64941 100755
--- a/trunk/testsuite/quick2.sh
+++ b/trunk/testsuite/quick2.sh
@@ -126,8 +126,12 @@ else
fi
cat > quick2.tree/etc/prelink.conf <<EOF
-b *.sh
--b *.py
--b b*11*r[hijk]*t
+-c quick2.tree/etc/prelink.conf.d/*.conf
+EOF
+mkdir quick2.tree/etc/prelink.conf.d
+echo '-b *.py' > quick2.tree/etc/prelink.conf.d/py.conf
+echo '-b b*11*r[hijk]*t' > quick2.tree/etc/prelink.conf.d/script.conf
+cat > quick2.tree/etc/prelink.conf.d/rest.conf <<EOF
quick2.tree/usr/bin
quick2.tree/lib
quick2.tree/usr/lib
diff --git a/trunk/testsuite/reloc2.sh b/trunk/testsuite/reloc2.sh
index 4d180c6..0ab76cd 100755
--- a/trunk/testsuite/reloc2.sh
+++ b/trunk/testsuite/reloc2.sh
@@ -2,9 +2,11 @@
. `dirname $0`/functions.sh
SHFLAGS=
case "`uname -m`" in
- ia64|ppc*|x86_64|mips*) SHFLAGS=-fpic;; # Does not support non-pic shared libs
+ ia64|ppc*|x86_64|mips*|arm*) SHFLAGS=-fpic;; # Does not support non-pic shared libs
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
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/reloc5.c b/trunk/testsuite/reloc5.c
index b174bcf..2caaf64 100644
--- a/trunk/testsuite/reloc5.c
+++ b/trunk/testsuite/reloc5.c
@@ -20,5 +20,6 @@ int main (void)
printf ("asm (\".section nonalloced,\\\"aw\\\",@nobits\\n\\t\"\n");
printf ("#endif\n");
printf (" \".globl testzero\\n\\t\"\n");
- printf (" \"testzero: .skip 16384\");\n");
+ printf (" \"testzero: .skip 16384\\n\\t\"\n");
+ printf (" \".previous\");\n");
}
diff --git a/trunk/testsuite/shuffle2.c b/trunk/testsuite/shuffle2.c
index c9f03ce..ed1af21 100644
--- a/trunk/testsuite/shuffle2.c
+++ b/trunk/testsuite/shuffle2.c
@@ -19,9 +19,11 @@ int main()
#ifdef __arm__
asm (".section nonalloced,\"aw\",%nobits\n\t"
".globl testzero\n\t"
- "testzero: .skip 16384");
+ "testzero: .skip 16384\n\t"
+ ".previous");
#else
asm (".section nonalloced,\"aw\",@nobits\n\t"
".globl testzero\n\t"
- "testzero: .skip 16384");
+ "testzero: .skip 16384\n\t"
+ ".previous");
#endif
diff --git a/trunk/testsuite/shuffle9.c b/trunk/testsuite/shuffle9.c
new file mode 100644
index 0000000..21ac534
--- /dev/null
+++ b/trunk/testsuite/shuffle9.c
@@ -0,0 +1,58 @@
+#include "reloc1.h"
+#include <stdlib.h>
+
+extern char testzero[16384];
+
+int main()
+{
+ int i;
+ if (foo.a != 1 || foo.b != &foo || foo.c != &bar || bar != 26)
+ abort ();
+ if (f1 () != 11 || f2 () != 12)
+ abort ();
+ for (i = 0; i < 16384; ++i)
+ if (testzero[i])
+ abort ();
+ exit (0);
+}
+
+asm (".section nonalloced,\"aw\",@nobits\n\t"
+ ".globl testzero\n\t"
+ "testzero: .skip 16384\n\t"
+ ".previous\n");
+
+asm (".section \".note.PRELINK.1\", \"a\"\n\t"
+ ".balign 4\n\t"
+ ".long 1f - 0f\n\t"
+ ".long 3f - 2f\n\t"
+ ".long 1\n"
+ "0:\t.asciz \"PRELINK\"\n"
+ "1:\t.balign 4\n"
+ "2:\t.long 12\n\t"
+ ".long 17\n"
+ "3:\t.balign 4\n\t"
+ ".previous\n");
+
+asm (".section \".note.PRELINK.2\", \"a\"\n\t"
+ ".balign 4\n\t"
+ ".long 1f - 0f\n\t"
+ ".long 3f - 2f\n\t"
+ ".long 2\n"
+ "0:\t.asciz \"PRELINK\"\n"
+ "1:\t.balign 4\n"
+ "2:\t.long 12\n\t"
+ ".long 17\n"
+ "3:\t.balign 4\n\t"
+ ".previous\n");
+
+asm (".section \".note.PRELINK.3\", \"a\"\n\t"
+ ".balign 4\n\t"
+ ".long 1f - 0f\n\t"
+ ".long 3f - 2f\n\t"
+ ".long 3\n"
+ "0:\t.asciz \"PRELINK\"\n"
+ "1:\t.balign 4\n"
+ "2:\t.long 12\n\t"
+ ".long 17\n"
+ "3:\t.balign 4\n\t"
+ ".previous\n");
diff --git a/trunk/testsuite/shuffle9.sh b/trunk/testsuite/shuffle9.sh
new file mode 100755
index 0000000..5768890
--- /dev/null
+++ b/trunk/testsuite/shuffle9.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+. `dirname $0`/functions.sh
+# Kernels before 2.4.10 are known not to work
+case "`uname -r`" in
+ [01].*|2.[0-3].*|2.4.[0-9]|2.4.[0-9][^0-9]*) exit 77;;
+esac
+rm -f shuffle9 shuffle9.log
+BINS="shuffle9"
+$CCLINK -o shuffle9 $srcdir/shuffle9.c -Wl,--rpath-link,. shuffle3lib2.so
+savelibs
+echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle9 > shuffle9.log
+$PRELINK ${PRELINK_OPTS--vm} ./shuffle9 >> shuffle9.log 2>&1 || exit 1
+grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle9.log && exit 2
+LD_LIBRARY_PATH=. ./shuffle9 || exit 3
+readelf -a ./shuffle9 >> shuffle9.log 2>&1 || exit 4
+# So that it is not prelinked again
+chmod -x ./shuffle9
+comparelibs >> shuffle9.log 2>&1 || exit 5
diff --git a/trunk/testsuite/tls3.sh b/trunk/testsuite/tls3.sh
index e7270e9..8d015d9 100755
--- a/trunk/testsuite/tls3.sh
+++ b/trunk/testsuite/tls3.sh
@@ -7,8 +7,10 @@ rm -f tlstest
#( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
SHFLAGS=
case "`uname -m`" in
- ia64|ppc*|x86_64|alpha*|s390*|mips*) SHFLAGS=-fpic;; # Does not support non-pic shared libs
+ 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
rm -f tls3 tls3lib*.so tls3.log
rm -f prelink.cache
$CC -shared -O2 -fpic -o tls3lib1.so $srcdir/tls1lib1.c