aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2006-08-10 23:10:43 -0500
committerMark Hatle <mark.hatle@windriver.com>2010-07-22 16:08:56 -0500
commit69e37874d30990880a2c196765920c8796be5fc4 (patch)
treebdc80332f23c3c4f18a606ec72dbfa878800e507
parentbc6abd3e0d3572ebcffe47a1183ea2ee76c2b903 (diff)
downloadprelink-cross-69e37874d30990880a2c196765920c8796be5fc4.tar.gz
prelink-cross-69e37874d30990880a2c196765920c8796be5fc4.tar.bz2
prelink-cross-69e37874d30990880a2c196765920c8796be5fc4.zip
Import from: prelink-cross-test.patch
Source: Wind River Systems The purpose of this patch is to allow for the testsuite to be run using the cross prelink. This disables the run-time test, but will keep all of the prelink testing. To have full test coverage you will want to execute these tests on the target as well.
-rw-r--r--ChangeLog.cross20
-rw-r--r--testsuite/Makefile.in10
-rwxr-xr-xtestsuite/cxx1.sh4
-rwxr-xr-xtestsuite/cycle1.sh4
-rwxr-xr-xtestsuite/cycle2.sh4
-rwxr-xr-xtestsuite/deps1.sh4
-rwxr-xr-xtestsuite/deps2.sh4
-rwxr-xr-xtestsuite/functions.sh3
-rwxr-xr-xtestsuite/layout1.sh4
-rwxr-xr-xtestsuite/layout2.sh4
-rwxr-xr-xtestsuite/movelibs.sh2
-rwxr-xr-xtestsuite/quick1.sh48
-rwxr-xr-xtestsuite/quick2.sh60
-rwxr-xr-xtestsuite/quick3.sh4
-rwxr-xr-xtestsuite/reloc1.sh4
-rwxr-xr-xtestsuite/reloc10.sh4
-rwxr-xr-xtestsuite/reloc11.sh4
-rwxr-xr-xtestsuite/reloc2.sh6
-rwxr-xr-xtestsuite/reloc3.sh6
-rwxr-xr-xtestsuite/reloc4.sh12
-rw-r--r--testsuite/reloc5.c4
-rwxr-xr-xtestsuite/reloc5.sh6
-rwxr-xr-xtestsuite/reloc6.sh24
-rwxr-xr-xtestsuite/reloc7.sh4
-rwxr-xr-xtestsuite/reloc8.sh8
-rwxr-xr-xtestsuite/reloc9.sh8
-rwxr-xr-xtestsuite/shuffle1.sh4
-rw-r--r--testsuite/shuffle2.c4
-rwxr-xr-xtestsuite/shuffle2.sh10
-rwxr-xr-xtestsuite/shuffle3.sh10
-rwxr-xr-xtestsuite/shuffle4.sh10
-rwxr-xr-xtestsuite/shuffle5.sh4
-rwxr-xr-xtestsuite/shuffle6.sh8
-rwxr-xr-xtestsuite/shuffle7.sh12
-rwxr-xr-xtestsuite/shuffle8.sh6
-rwxr-xr-xtestsuite/tls1.sh10
-rwxr-xr-xtestsuite/tls2.sh10
-rwxr-xr-xtestsuite/tls3.sh10
-rwxr-xr-xtestsuite/tls4.sh10
-rwxr-xr-xtestsuite/tls5.sh14
-rwxr-xr-xtestsuite/tls6.sh14
-rwxr-xr-xtestsuite/tls7.sh10
-rwxr-xr-xtestsuite/undo1.sh4
43 files changed, 303 insertions, 112 deletions
diff --git a/ChangeLog.cross b/ChangeLog.cross
index fae04ff..566751f 100644
--- a/ChangeLog.cross
+++ b/ChangeLog.cross
@@ -1,3 +1,23 @@
+2006-08-10 Mark Hatle <mark.hatle@windriver.com>
+
+ * testsuite/Makefile.in: Allow testsuite to run using cross prelink.
+ Disable the run-time tests, but keep all basic
+ prelink testing.
+ * testsuite/ccx1.sh, testsuite/cycle1.sh, testsuite/cycle2.sh
+ testsuite/deps1.sh, testsuite/deps2.sh, testuite/functions.sh
+ testuite/layout1.sh, testuite/layout2.sh, testsuite/movelibs.sh
+ testsuite/quick1.sh, testsuite/quick2.sh, testsuite/quick3.sh
+ testsuite/reloc1.sh, testsuite/reloc2.sh, testsuite/reloc3.sh
+ testsuite/reloc4.sh, testsuite/reloc5.sh, testsuite/reloc6.sh
+ testsuite/reloc7.sh, testsuite/reloc8.sh, testsuite/reloc9.sh
+ testsuite/reloc10.sh, testsuite/reloc11.sh, testsuite/shuffle1.sh
+ testsuite/shuffle2.c, testsuite/shuffle2.sh, testsuite/shuffle3.sh
+ testsuite/shuffle4.sh, testsuite/shuffle5.sh, testsuite/shuffle6.sh
+ testsuite/shuffle7.sh, testsuite/shuffle8.sh, testsuite/tls1.sh
+ testsuite/tls2.sh, testsuite/tls3.sh, testsuite/tls4.sh
+ testsuite/tls5.sh, testsuite/tls6.sh, testsuite/tls7.sh
+ testsuite/undo1.sh: ditto
+
2006-08-09 Mark Hatle <mark.hatle@windriver.com>
* execstack.c: add WR versioning
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index 53feb82..205f6e3 100644
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -161,7 +161,9 @@ check-TESTS: $(TESTS)
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ $(TESTS_ENVIRONMENT) $${dir}$$tst; \
+ ret=$$?; \
+ if test $$ret -eq 0; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
@@ -173,16 +175,16 @@ check-TESTS: $(TESTS)
echo "PASS: $$tst"; \
;; \
esac; \
- elif test $$? -ne 77; then \
+ elif test $$ret -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
- echo "XFAIL: $$tst"; \
+ echo "XFAIL: $$tst ($$ret)"; \
;; \
*) \
failed=`expr $$failed + 1`; \
- echo "FAIL: $$tst"; \
+ echo "FAIL: $$tst ($$ret)"; \
;; \
esac; \
fi; \
diff --git a/testsuite/cxx1.sh b/testsuite/cxx1.sh
index a48cc65..81428c2 100755
--- a/testsuite/cxx1.sh
+++ b/testsuite/cxx1.sh
@@ -11,7 +11,9 @@ 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
-LD_LIBRARY_PATH=. ./cxx1 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./cxx1 || exit 3
+fi
readelf -a ./cxx1 >> cxx1.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./cxx1
diff --git a/testsuite/cycle1.sh b/testsuite/cycle1.sh
index 3dc7f93..caf7864 100755
--- a/testsuite/cycle1.sh
+++ b/testsuite/cycle1.sh
@@ -18,6 +18,8 @@ grep -v 'has a dependency cycle' cycle1.log \
| grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` && exit 2
grep -q "^`echo $PRELINK | sed 's/ .*$/: .*has a dependency cycle/'`" \
cycle1.log || exit 3
-LD_LIBRARY_PATH=. ./cycle1 || exit 4
+if [ "x$CROSS" = "x" ] ; then
+ LD_LIBRARY_PATH=. ./cycle1 || exit 4
+fi
# So that it is not prelinked again
chmod -x ./cycle1
diff --git a/testsuite/cycle2.sh b/testsuite/cycle2.sh
index 0b99a5d..a160a3a 100755
--- a/testsuite/cycle2.sh
+++ b/testsuite/cycle2.sh
@@ -21,6 +21,8 @@ grep -v 'has a dependency cycle' cycle2.log \
| grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` && exit 2
grep -q "^`echo $PRELINK | sed 's/ .*$/: .*has a dependency cycle/'`" \
cycle2.log || exit 3
-LD_LIBRARY_PATH=. ./cycle2 || exit 4
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./cycle2 || exit 4
+fi
# So that it is not prelinked again
chmod -x ./cycle2
diff --git a/testsuite/deps1.sh b/testsuite/deps1.sh
index c345c07..96395fa 100755
--- a/testsuite/deps1.sh
+++ b/testsuite/deps1.sh
@@ -41,7 +41,9 @@ chmod 644 `ls $BINS | sed 's|$|.orig|'`
echo $PRELINK ${PRELINK_OPTS--v} -avvvvv > deps1.log
$PRELINK ${PRELINK_OPTS--v} -avvvvv > deps1.tree/etc/log1 2>&1 || exit 1
cat deps1.tree/etc/log1 >> deps1.log
-LD_LIBRARY_PATH=deps1.tree/lib deps1.tree/usr/bin/bin1 || exit 2
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=deps1.tree/lib deps1.tree/usr/bin/bin1 || exit 2
+fi
readelf -d deps1.tree/{usr,opt}/lib/lib1.so 2>&1 | grep CHECKSUM >> deps1.log || exit 3
readelf -A deps1.tree/usr/lib/lib1.so >> deps1.log 2>&1 || exit 4
readelf -A deps1.tree/opt/lib/lib1.so >> deps1.log 2>&1 || exit 5
diff --git a/testsuite/deps2.sh b/testsuite/deps2.sh
index 636023c..4838f9b 100755
--- a/testsuite/deps2.sh
+++ b/testsuite/deps2.sh
@@ -41,7 +41,9 @@ chmod 644 `ls $BINS | sed 's|$|.orig|'`
echo $PRELINK ${PRELINK_OPTS--v} -avvvvv > deps2.log
$PRELINK ${PRELINK_OPTS--v} -avvvvv > deps2.tree/etc/log1 2>&1 || exit 1
cat deps2.tree/etc/log1 >> deps2.log
-LD_LIBRARY_PATH=deps2.tree/lib deps2.tree/usr/bin/bin1 || exit 2
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=deps2.tree/lib deps2.tree/usr/bin/bin1 || exit 2
+fi
readelf -d deps2.tree/{usr,opt}/lib/lib1.so 2>&1 | grep CHECKSUM >> deps2.log || exit 3
readelf -A deps2.tree/usr/lib/lib1.so >> deps2.log 2>&1 || exit 4
readelf -A deps2.tree/opt/lib/lib1.so >> deps2.log 2>&1 || exit 5
diff --git a/testsuite/functions.sh b/testsuite/functions.sh
index 85bf875..c351fd1 100755
--- a/testsuite/functions.sh
+++ b/testsuite/functions.sh
@@ -4,6 +4,9 @@ CCLINK=${CCLINK:-${CC} -Wl,--dynamic-linker=`echo ./ld*.so.*[0-9]`}
CXX="${CXX:-g++} ${LINKOPTS}"
CXXLINK=${CXXLINK:-${CXX} -Wl,--dynamic-linker=`echo ./ld*.so.*[0-9]`}
PRELINK=${PRELINK:-../src/prelink -c ./prelink.conf -C ./prelink.cache --ld-library-path=. --dynamic-linker=`echo ./ld*.so.*[0-9]`}
+LDD=${LDD:-../src/prelink-rtld}
+STRIP=${STRIP:-strip}
+HOST_CC=${HOST_CC:-$CC}
srcdir=${srcdir:-`dirname $0`}
savelibs() {
for i in $LIBS $BINS; do cp -p $i $i.orig; done
diff --git a/testsuite/layout1.sh b/testsuite/layout1.sh
index ee751ab..e217dea 100755
--- a/testsuite/layout1.sh
+++ b/testsuite/layout1.sh
@@ -15,7 +15,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vR} ./layout1 > layout1.log
$PRELINK ${PRELINK_OPTS--vR} ./layout1 >> layout1.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` layout1.log && exit 2
-LD_LIBRARY_PATH=. ./layout1 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./layout1 || exit 3
+fi
readelf -a ./layout1 >> layout1.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./layout1
diff --git a/testsuite/layout2.sh b/testsuite/layout2.sh
index 7d8504b..2307a42 100755
--- a/testsuite/layout2.sh
+++ b/testsuite/layout2.sh
@@ -14,7 +14,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vR} ./layout2 > layout2.log
$PRELINK ${PRELINK_OPTS--vR} ./layout2 >> layout2.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` layout2.log && exit 2
-LD_LIBRARY_PATH=. ./layout2 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./layout2 || exit 3
+fi
readelf -a ./layout2 >> layout2.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./layout2
diff --git a/testsuite/movelibs.sh b/testsuite/movelibs.sh
index 4357ee8..010e0e7 100755
--- a/testsuite/movelibs.sh
+++ b/testsuite/movelibs.sh
@@ -5,7 +5,7 @@ echo 'int main() { }' > movelibs.C
$CXX -o movelibs movelibs.C
> syslib.list
> syslnk.list
-for i in `LD_TRACE_PRELINKING=1 LD_WARN= LD_TRACE_LOADED_OBJECTS=1 ./movelibs \
+for i in `RTLD_TRACE_PRELINKING=1 LD_WARN= $LDD ./movelibs \
| awk '$1 !~ /^\.\/movelibs/ { print $3 } '`; do
k=`basename $i`
if [ -L $i ]; then
diff --git a/testsuite/quick1.sh b/testsuite/quick1.sh
index 8974146..f3f80a8 100755
--- a/testsuite/quick1.sh
+++ b/testsuite/quick1.sh
@@ -111,12 +111,24 @@ cat quick1.tree/etc/log3 >> quick1.log
echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick1.log
$PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick1.tree/etc/log4 2>&1 || exit 4
cat quick1.tree/etc/log4 >> quick1.log
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin1 || exit 5
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin2 || exit 6
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin3 || exit 7
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin4 || exit 8
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin5 || exit 9
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin6 || exit 10
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin1 || exit 5
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin2 || exit 6
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin3 || exit 7
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin4 || exit 8
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin5 || exit 9
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin6 || exit 10
+fi
readelf -a quick1.tree/usr/bin/bin1 >> quick1.log 2>&1 || exit 11
readelf -a quick1.tree/usr/bin/bin3 >> quick1.log 2>&1 || exit 12
readelf -a quick1.tree/usr/bin/bin4 >> quick1.log 2>&1 || exit 13
@@ -140,12 +152,24 @@ done
echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick1.log
$PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick1.tree/etc/log5 2>&1 || exit 17
cat quick1.tree/etc/log5 >> quick1.log
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin1 || exit 18
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin2 || exit 19
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin3 || exit 20
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin4 || exit 21
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin5 || exit 22
-LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin6 || exit 23
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin1 || exit 18
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin2 || exit 19
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin3 || exit 20
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin4 || exit 21
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin5 || exit 22
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin6 || exit 23
+fi
readelf -a quick1.tree/usr/bin/bin1 >> quick1.log 2>&1 || exit 24
readelf -a quick1.tree/usr/bin/bin3 >> quick1.log 2>&1 || exit 25
readelf -a quick1.tree/usr/bin/bin4 >> quick1.log 2>&1 || exit 26
diff --git a/testsuite/quick2.sh b/testsuite/quick2.sh
index 131795e..87138ae 100755
--- a/testsuite/quick2.sh
+++ b/testsuite/quick2.sh
@@ -112,8 +112,18 @@ echo is present in prelink.conf.
exit 0
EOF
chmod 755 quick2.tree/usr/bin/bin11.script
-echo 'int main () { return 0; }' \
+if [ `$CC -dumpmachine | sed "s/-.*-.*-.*//"` = "arm" ]; then
+ cat > quick2.tree/usr/bin/bin12 << EOF
+#!/bin/sh
+echo -pie -fPIE is not supported on our ARM architectures
+echo this script will serve to disable that part of the test.
+exit 0
+EOF
+chmod 0755 quick2.tree/usr/bin/bin12
+else
+ echo 'int main () { return 0; }' \
| $CCLINK -o quick2.tree/usr/bin/bin12 -pie -fPIE -xc - -xnone
+fi
cat > quick2.tree/etc/prelink.conf <<EOF
-b *.sh
-b *.py
@@ -173,12 +183,24 @@ grep -q 'Could not prelink .*bin5 because its dependency .*lib7.so could not be
echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick2.log
$PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick2.tree/etc/log4 2>&1 || exit 4
cat quick2.tree/etc/log4 >> quick2.log
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin1 || exit 5
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin2 || exit 6
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin3 || exit 7
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin4 || exit 8
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin5 || exit 9
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin6 || exit 10
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin1 || exit 5
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin2 || exit 6
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin3 || exit 7
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin4 || exit 8
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin5 || exit 9
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin6 || exit 10
+fi
readelf -a quick2.tree/usr/bin/bin1 >> quick2.log 2>&1 || exit 11
readelf -a quick2.tree/usr/bin/bin3 >> quick2.log 2>&1 || exit 12
readelf -a quick2.tree/usr/bin/bin4 >> quick2.log 2>&1 || exit 13
@@ -201,12 +223,24 @@ done
echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick2.log
$PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick2.tree/etc/log5 2>&1 || exit 17
cat quick2.tree/etc/log5 >> quick2.log
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin1 || exit 18
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin2 || exit 19
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin3 || exit 20
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin4 || exit 21
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin5 || exit 22
-LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin6 || exit 23
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin1 || exit 18
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin2 || exit 19
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin3 || exit 20
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin4 || exit 21
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin5 || exit 22
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin6 || exit 23
+fi
readelf -a quick2.tree/usr/bin/bin1 >> quick2.log 2>&1 || exit 24
readelf -a quick2.tree/usr/bin/bin3 >> quick2.log 2>&1 || exit 25
readelf -a quick2.tree/usr/bin/bin4 >> quick2.log 2>&1 || exit 26
diff --git a/testsuite/quick3.sh b/testsuite/quick3.sh
index 00d2aad..0562e52 100755
--- a/testsuite/quick3.sh
+++ b/testsuite/quick3.sh
@@ -72,7 +72,9 @@ sleep 3s
echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick3.log
$PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick3.tree/etc/log3 2>&1 || exit 3
cat quick3.tree/etc/log3 >> quick3.log
-LD_LIBRARY_PATH=quick3.tree/lib:quick3.tree/usr/lib quick3.tree/usr/bin/bin1 || exit 4
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=quick3.tree/lib:quick3.tree/usr/lib quick3.tree/usr/bin/bin1 || exit 4
+fi
LIBS="quick3.tree/usr/lib/lib1.so quick3.tree/usr/lib/lib2.so.0"
echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick3.log
$PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick3.tree/etc/log4 2>&1 || exit 5
diff --git a/testsuite/reloc1.sh b/testsuite/reloc1.sh
index 124ab96..ade05c9 100755
--- a/testsuite/reloc1.sh
+++ b/testsuite/reloc1.sh
@@ -11,7 +11,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc1 > reloc1.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc1 >> reloc1.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc1.log && exit 2
-LD_LIBRARY_PATH=. ./reloc1 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc1 || exit 3
+fi
readelf -a ./reloc1 >> reloc1.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc1
diff --git a/testsuite/reloc10.sh b/testsuite/reloc10.sh
index 94a4e69..66dd438 100755
--- a/testsuite/reloc10.sh
+++ b/testsuite/reloc10.sh
@@ -14,7 +14,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc10 > reloc10.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc10 >> reloc10.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc10.log && exit 2
-LD_LIBRARY_PATH=. ./reloc10 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc10 || exit 3
+fi
readelf -a ./reloc10 >> reloc10.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc10
diff --git a/testsuite/reloc11.sh b/testsuite/reloc11.sh
index 5d3f4f1..ab0cbee 100755
--- a/testsuite/reloc11.sh
+++ b/testsuite/reloc11.sh
@@ -12,7 +12,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc11 > reloc11.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc11 >> reloc11.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc11.log && exit 2
-LD_LIBRARY_PATH=. ./reloc11 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc11 || exit 3
+fi
readelf -a ./reloc11 >> reloc11.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc11
diff --git a/testsuite/reloc2.sh b/testsuite/reloc2.sh
index ca043b0..6560879 100755
--- a/testsuite/reloc2.sh
+++ b/testsuite/reloc2.sh
@@ -12,12 +12,14 @@ $CC -shared $SHFLAGS -O2 -o reloc2lib2.so $srcdir/reloc2lib2.c \
BINS="reloc2"
LIBS="reloc2lib1.so reloc2lib2.so"
$CCLINK -o reloc2 $srcdir/reloc2.c -Wl,--rpath-link,. reloc2lib2.so
-strip -R .comment $BINS $LIBS
+$STRIP -R .comment $BINS $LIBS
savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc2 > reloc2.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc2 >> reloc2.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc2.log && exit 2
-LD_LIBRARY_PATH=. ./reloc2 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc2 || exit 3
+fi
readelf -a ./reloc2 >> reloc2.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc2
diff --git a/testsuite/reloc3.sh b/testsuite/reloc3.sh
index 66e1bca..acf0497 100755
--- a/testsuite/reloc3.sh
+++ b/testsuite/reloc3.sh
@@ -7,12 +7,14 @@ $CC -shared -O2 -fpic -o reloc3lib2.so $srcdir/reloc1lib2.c reloc3lib1.so
BINS="reloc3"
LIBS="reloc3lib1.so reloc3lib2.so"
$CCLINK -o reloc3 $srcdir/reloc3.c -Wl,--rpath-link,. reloc3lib2.so
-strip -g $BINS $LIBS
+$STRIP -g $BINS $LIBS
savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc3 > reloc3.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc3 >> reloc3.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc3.log && exit 2
-LD_LIBRARY_PATH=. ./reloc3 >> reloc3.log || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc3 >> reloc3.log || exit 3
+fi
readelf -a ./reloc3 >> reloc3.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc3
diff --git a/testsuite/reloc4.sh b/testsuite/reloc4.sh
index d83e3db..6163d31 100755
--- a/testsuite/reloc4.sh
+++ b/testsuite/reloc4.sh
@@ -4,10 +4,10 @@
[ -z "$CHECK_ME_HARDER" ] && exit 77
rm -f reloc4 reloc4lib*.so reloc4.log
rm -f prelink.cache
-$CC -O2 -o reloc4lib1.tmp $srcdir/reloc4lib1.c
-$CC -O2 -o reloc4lib2.tmp $srcdir/reloc4lib2.c
-$CC -O2 -o reloc4lib3.tmp $srcdir/reloc4lib3.c
-$CC -O2 -o reloc4.tmp $srcdir/reloc4.c
+$HOST_CC -O2 -o reloc4lib1.tmp $srcdir/reloc4lib1.c
+$HOST_CC -O2 -o reloc4lib2.tmp $srcdir/reloc4lib2.c
+$HOST_CC -O2 -o reloc4lib3.tmp $srcdir/reloc4lib3.c
+$HOST_CC -O2 -o reloc4.tmp $srcdir/reloc4.c
./reloc4lib1.tmp > reloc4lib1.tmp.c
./reloc4lib2.tmp > reloc4lib2.tmp.c
./reloc4lib3.tmp > reloc4lib3.tmp.c
@@ -23,7 +23,9 @@ rm -f reloc4*.tmp reloc4*.tmp.c
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc4 > reloc4.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc4 >> reloc4.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc4.log && exit 2
-LD_LIBRARY_PATH=. ./reloc4 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc4 || exit 3
+fi
readelf -a ./reloc4 >> reloc4.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc4
diff --git a/testsuite/reloc5.c b/testsuite/reloc5.c
index c1bc199..6c1b3c9 100644
--- a/testsuite/reloc5.c
+++ b/testsuite/reloc5.c
@@ -14,5 +14,9 @@ int main (void)
printf (" for (x = 0; x < 16384; ++x)\n");
printf (" if (testzero[x]) abort ();\n");
printf (" exit (0);\n}\n\n");
+ printf ("#ifdef __arm__\n");
+ printf ("asm (\".section nonalloced,\\\"aw\\\",%%nobits; testzero: .skip 16384\");\n");
+ printf ("#else\n");
printf ("asm (\".section nonalloced,\\\"aw\\\",@nobits; testzero: .skip 16384\");\n");
+ printf ("#endif\n");
}
diff --git a/testsuite/reloc5.sh b/testsuite/reloc5.sh
index 16d2b7a..f543f69 100755
--- a/testsuite/reloc5.sh
+++ b/testsuite/reloc5.sh
@@ -4,7 +4,7 @@
[ -z "$CHECK_ME_HARDER" ] && exit 77
rm -f reloc5 reloc5.log
rm -f prelink.cache
-$CC -O2 -o reloc5.tmp $srcdir/reloc5.c
+$HOST_CC -O2 -o reloc5.tmp $srcdir/reloc5.c
./reloc5.tmp > reloc5.tmp.c
BINS="reloc5"
$CCLINK -o reloc5 reloc5.tmp.c -Wl,--rpath-link,. reloc4lib3.so
@@ -13,7 +13,9 @@ rm -f reloc5*.tmp reloc5*.tmp.c
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc5 > reloc5.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc5 >> reloc5.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc5.log && exit 2
-LD_LIBRARY_PATH=. ./reloc5 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc5 || exit 3
+fi
readelf -a ./reloc5 >> reloc5.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc5
diff --git a/testsuite/reloc6.sh b/testsuite/reloc6.sh
index 0ddd8d8..7f72936 100755
--- a/testsuite/reloc6.sh
+++ b/testsuite/reloc6.sh
@@ -9,15 +9,27 @@ $CCLINK -o reloc6.nop $srcdir/reloc3.c -Wl,--rpath-link,. reloc6lib2.so
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc6 > reloc6.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc6 >> reloc6.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc6.log && exit 2
-LD_LIBRARY_PATH=. ./reloc6 >> reloc6.log || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc6 >> reloc6.log || exit 3
+fi
readelf -a ./reloc6 >> reloc6.log 2>&1 || exit 4
-LD_LIBRARY_PATH=. ./reloc6.nop >> reloc6.log || exit 5
-LD_LIBRARY_PATH=. LD_BIND_NOW=1 ./reloc6.nop >> reloc6.log || exit 6
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc6.nop >> reloc6.log || exit 5
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. LD_BIND_NOW=1 ./reloc6.nop >> reloc6.log || exit 6
+fi
mv -f reloc6lib2.so reloc6lib2.so.p
$CC -shared -O2 -fpic -o reloc6lib2.so $srcdir/reloc1lib2.c reloc6lib1.so
-LD_LIBRARY_PATH=. ./reloc6 >> reloc6.log || exit 7
-LD_LIBRARY_PATH=. ./reloc6.nop >> reloc6.log || exit 8
-LD_LIBRARY_PATH=. LD_BIND_NOW=1 ./reloc6.nop >> reloc6.log || exit 9
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc6 >> reloc6.log || exit 7
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc6.nop >> reloc6.log || exit 8
+fi
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. LD_BIND_NOW=1 ./reloc6.nop >> reloc6.log || exit 9
+fi
mv -f reloc6lib2.so reloc6lib2.so.nop
mv -f reloc6lib2.so.p reloc6lib2.so
# So that it is not prelinked again
diff --git a/testsuite/reloc7.sh b/testsuite/reloc7.sh
index 640ca78..edbbcbf 100755
--- a/testsuite/reloc7.sh
+++ b/testsuite/reloc7.sh
@@ -11,7 +11,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc7 > reloc7.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc7 >> reloc7.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc7.log && exit 2
-LD_LIBRARY_PATH=. ./reloc7 >> reloc7.log || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc7 >> reloc7.log || exit 3
+fi
readelf -a ./reloc7 >> reloc7.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc7
diff --git a/testsuite/reloc8.sh b/testsuite/reloc8.sh
index ea0a89e..9f5e1fb 100755
--- a/testsuite/reloc8.sh
+++ b/testsuite/reloc8.sh
@@ -1,7 +1,9 @@
#!/bin/bash
. `dirname $0`/functions.sh
# Disable this test under SELinux
-test -x /usr/sbin/getenforce -a "`/usr/sbin/getenforce`" = Enforcing && exit 77
+if [ "x$CROSS" = "x" ]; then
+ test -x /usr/sbin/getenforce -a "`/usr/sbin/getenforce`" = Enforcing && exit 77
+fi
rm -f reloc8 reloc8lib*.so reloc8.log
rm -f prelink.cache
NOCOPYRELOC=-Wl,-z,nocopyreloc
@@ -17,7 +19,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc8 > reloc8.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc8 >> reloc8.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc8.log && exit 2
-LD_LIBRARY_PATH=. ./reloc8 >> reloc8.log || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc8 >> reloc8.log || exit 3
+fi
readelf -a ./reloc8 >> reloc8.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc8
diff --git a/testsuite/reloc9.sh b/testsuite/reloc9.sh
index 41fe578..d3a449c 100755
--- a/testsuite/reloc9.sh
+++ b/testsuite/reloc9.sh
@@ -1,7 +1,9 @@
#!/bin/bash
. `dirname $0`/functions.sh
# Disable this test under SELinux
-test -x /usr/sbin/getenforce -a "`/usr/sbin/getenforce`" = Enforcing && exit 77
+if [ "x$CROSS" = "x" ]; then
+ test -x /usr/sbin/getenforce -a "`/usr/sbin/getenforce`" = Enforcing && exit 77
+fi
rm -f reloc9 reloc9lib*.so reloc9.log
rm -f prelink.cache
NOCOPYRELOC=-Wl,-z,nocopyreloc
@@ -17,7 +19,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./reloc9 > reloc9.log
$PRELINK ${PRELINK_OPTS--vm} ./reloc9 >> reloc9.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc9.log && exit 2
-LD_LIBRARY_PATH=. ./reloc9 >> reloc9.log || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./reloc9 >> reloc9.log || exit 3
+fi
readelf -a ./reloc9 >> reloc9.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./reloc9
diff --git a/testsuite/shuffle1.sh b/testsuite/shuffle1.sh
index 7798d9e..4553d2e 100755
--- a/testsuite/shuffle1.sh
+++ b/testsuite/shuffle1.sh
@@ -15,7 +15,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle1 > shuffle1.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle1 >> shuffle1.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle1.log && exit 2
-LD_LIBRARY_PATH=. ./shuffle1 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle1 || exit 3
+fi
readelf -a ./shuffle1 >> shuffle1.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./shuffle1
diff --git a/testsuite/shuffle2.c b/testsuite/shuffle2.c
index b7cbd1a..870b189 100644
--- a/testsuite/shuffle2.c
+++ b/testsuite/shuffle2.c
@@ -16,4 +16,8 @@ int main()
exit (0);
}
+#ifdef __arm__
+asm (".section nonalloced,\"aw\",%nobits; testzero: .skip 16384");
+#else
asm (".section nonalloced,\"aw\",@nobits; testzero: .skip 16384");
+#endif
diff --git a/testsuite/shuffle2.sh b/testsuite/shuffle2.sh
index fcfbfb1..fdaf03e 100755
--- a/testsuite/shuffle2.sh
+++ b/testsuite/shuffle2.sh
@@ -1,9 +1,11 @@
#!/bin/bash
. `dirname $0`/functions.sh
# Kernels before 2.4.10 are known not to work
-case "`uname -r`" in
+if [ "x$CROSS" = "x" ]; then
+ case "`uname -r`" in
[01].*|2.[0-3].*|2.4.[0-9]|2.4.[0-9][^0-9]*) exit 77;;
-esac
+ esac
+fi
rm -f shuffle2 shuffle2lib*.so shuffle2.log shuffle2.lds
$CC -shared -O2 -fpic -o shuffle2lib1.so $srcdir/reloc1lib1.c
$CC -shared -O2 -fpic -o shuffle2lib2.so $srcdir/reloc1lib2.c shuffle2lib1.so
@@ -18,7 +20,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle2 > shuffle2.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle2 >> shuffle2.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle2.log && exit 2
-LD_LIBRARY_PATH=. ./shuffle2 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle2 || exit 3
+fi
readelf -a ./shuffle2 >> shuffle2.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./shuffle2
diff --git a/testsuite/shuffle3.sh b/testsuite/shuffle3.sh
index d731102..989bfcb 100755
--- a/testsuite/shuffle3.sh
+++ b/testsuite/shuffle3.sh
@@ -1,9 +1,11 @@
#!/bin/bash
. `dirname $0`/functions.sh
# Kernels before 2.4.10 are known not to work
-case "`uname -r`" in
+if [ "x$CROSS" = "x" ]; then
+ case "`uname -r`" in
[01].*|2.[0-3].*|2.4.[0-9]|2.4.[0-9][^0-9]*) exit 77;;
-esac
+ esac
+fi
rm -f shuffle3 shuffle3lib*.so shuffle3.log shuffle3.lds
rm -f prelink.cache
$CC -shared -O2 -fpic -o shuffle3lib1.so $srcdir/reloc1lib1.c
@@ -19,7 +21,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle3 > shuffle3.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle3 >> shuffle3.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle3.log && exit 2
-LD_LIBRARY_PATH=. ./shuffle3 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle3 || exit 3
+fi
readelf -a ./shuffle3 >> shuffle3.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./shuffle3
diff --git a/testsuite/shuffle4.sh b/testsuite/shuffle4.sh
index 127e224..781431c 100755
--- a/testsuite/shuffle4.sh
+++ b/testsuite/shuffle4.sh
@@ -1,9 +1,11 @@
#!/bin/bash
. `dirname $0`/functions.sh
# Kernels before 2.4.10 are known not to work
-case "`uname -r`" in
+if [ "x$CROSS" = "x" ]; then
+ case "`uname -r`" in
[01].*|2.[0-3].*|2.4.[0-9]|2.4.[0-9][^0-9]*) exit 77;;
-esac
+ esac
+fi
rm -f shuffle4 shuffle4.log
BINS="shuffle4"
$CCLINK -o shuffle4 $srcdir/shuffle2.c -Wl,--rpath-link,. shuffle3lib2.so
@@ -11,7 +13,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle4 > shuffle4.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle4 >> shuffle4.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle4.log && exit 2
-LD_LIBRARY_PATH=. ./shuffle4 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle4 || exit 3
+fi
readelf -a ./shuffle4 >> shuffle4.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./shuffle4
diff --git a/testsuite/shuffle5.sh b/testsuite/shuffle5.sh
index ce09d46..db722e8 100755
--- a/testsuite/shuffle5.sh
+++ b/testsuite/shuffle5.sh
@@ -15,7 +15,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle5 > shuffle5.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle5 >> shuffle5.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle5.log && exit 2
-LD_LIBRARY_PATH=. ./shuffle5 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle5 || exit 3
+fi
readelf -a ./shuffle5 >> shuffle5.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./shuffle5
diff --git a/testsuite/shuffle6.sh b/testsuite/shuffle6.sh
index 3eec2ff..eb28d62 100755
--- a/testsuite/shuffle6.sh
+++ b/testsuite/shuffle6.sh
@@ -15,7 +15,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle6 > shuffle6.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle6 >> shuffle6.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle6.log && exit 2
-LD_LIBRARY_PATH=. ./shuffle6 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle6 || exit 3
+fi
readelf -a ./shuffle6 >> shuffle6.log 2>&1 || exit 4
comparelibs >> shuffle6.log 2>&1 || exit 5
for l in shuffle6lib{1,2}.so{,.orig}; do mv -f $l $l.first; done
@@ -26,7 +28,9 @@ for l in shuffle6lib{1,2}.so; do cp -p $l $l.orig; done
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle6 >> shuffle6.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle6 >> shuffle6.log 2>&1 || exit 6
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle6.log && exit 7
-LD_LIBRARY_PATH=. ./shuffle6 || exit 8
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle6 || exit 8
+fi
readelf -a ./shuffle6 >> shuffle6.log 2>&1 || exit 9
# So that it is not prelinked again
chmod -x ./shuffle6
diff --git a/testsuite/shuffle7.sh b/testsuite/shuffle7.sh
index 23c3c60..c6449c8 100755
--- a/testsuite/shuffle7.sh
+++ b/testsuite/shuffle7.sh
@@ -16,7 +16,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle7 > shuffle7.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle7.log && exit 2
-LD_LIBRARY_PATH=. ./shuffle7 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle7 || exit 3
+fi
readelf -a ./shuffle7 >> shuffle7.log 2>&1 || exit 4
comparelibs >> shuffle7.log 2>&1 || exit 5
for l in shuffle7lib{1,2}.so{,.orig}; do mv -f $l $l.first; done
@@ -27,7 +29,9 @@ for l in shuffle7lib{1,2}.so; do cp -p $l $l.orig; done
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log 2>&1 || exit 6
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle7.log && exit 7
-LD_LIBRARY_PATH=. ./shuffle7 || exit 8
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle7 || exit 8
+fi
readelf -a ./shuffle7 >> shuffle7.log 2>&1 || exit 9
comparelibs >> shuffle7.log 2>&1 || exit 10
for l in shuffle7lib{1,2}.so{,.orig}; do mv -f $l $l.second; done
@@ -36,7 +40,9 @@ for l in shuffle7lib{1,2}.so{,.orig}; do cp -p $l.first $l; done
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log 2>&1 || exit 11
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle7.log && exit 12
-LD_LIBRARY_PATH=. ./shuffle7 || exit 13
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle7 || exit 13
+fi
readelf -a ./shuffle7 >> shuffle7.log 2>&1 || exit 14
comparelibs >> shuffle7.log 2>&1 || exit 15
cmp -s shuffle7{,.first} || exit 16
diff --git a/testsuite/shuffle8.sh b/testsuite/shuffle8.sh
index d0768a4..51dcc4c 100755
--- a/testsuite/shuffle8.sh
+++ b/testsuite/shuffle8.sh
@@ -7,12 +7,14 @@ $CC -shared -O2 -fpic -o shuffle8lib2.so $srcdir/reloc1lib2.c shuffle8lib1.so
BINS="shuffle8"
LIBS="shuffle8lib1.so shuffle8lib2.so"
$CCLINK -o shuffle8 $srcdir/shuffle8.c -Wl,--rpath-link,. shuffle8lib2.so
-strip -R .comment shuffle8
+$STRIP -R .comment shuffle8
savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle8 > shuffle8.log
$PRELINK ${PRELINK_OPTS--vm} ./shuffle8 >> shuffle8.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle8.log && exit 2
-LD_LIBRARY_PATH=. ./shuffle8 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./shuffle8 || exit 3
+fi
readelf -a ./shuffle8 >> shuffle8.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./shuffle8
diff --git a/testsuite/tls1.sh b/testsuite/tls1.sh
index 0fb4986..f3d2113 100755
--- a/testsuite/tls1.sh
+++ b/testsuite/tls1.sh
@@ -2,9 +2,9 @@
. `dirname $0`/functions.sh
# First check if __thread is supported by ld.so/gcc/ld/as:
rm -f tlstest
-echo '__thread int a; int main (void) { return a; }' \
- | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
-( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
+#echo '__thread int a; int main (void) { return a; }' \
+# | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
+#( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
rm -f tls1 tls1lib*.so tls1.log
rm -f prelink.cache
$CC -shared -O2 -fpic -o tls1lib1.so $srcdir/tls1lib1.c
@@ -16,7 +16,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./tls1 > tls1.log
$PRELINK ${PRELINK_OPTS--vm} ./tls1 >> tls1.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls1.log && exit 2
-LD_LIBRARY_PATH=. ./tls1 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./tls1 || exit 3
+fi
readelf -a ./tls1 >> tls1.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./tls1
diff --git a/testsuite/tls2.sh b/testsuite/tls2.sh
index bf9e1eb..4b515b0 100755
--- a/testsuite/tls2.sh
+++ b/testsuite/tls2.sh
@@ -2,9 +2,9 @@
. `dirname $0`/functions.sh
# First check if __thread is supported by ld.so/gcc/ld/as:
rm -f tlstest
-echo '__thread int a; int main (void) { return a; }' \
- | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
-( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
+#echo '__thread int a; int main (void) { return a; }' \
+# | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
+#( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
rm -f tls2 tls2lib*.so tls2.log
rm -f prelink.cache
$CC -shared -O2 -fpic -o tls2lib1.so $srcdir/tls2lib1.c
@@ -17,7 +17,9 @@ echo $PRELINK ${PRELINK_OPTS--vm} ./tls2 > tls2.log
$PRELINK ${PRELINK_OPTS--vm} ./tls2 >> tls2.log 2>&1 || exit 1
grep -v 'has undefined non-weak symbols' tls2.log \
| grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` && exit 2
-LD_LIBRARY_PATH=. ./tls2 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./tls2 || exit 3
+fi
readelf -a ./tls2 >> tls2.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./tls2
diff --git a/testsuite/tls3.sh b/testsuite/tls3.sh
index e98f5ea..1663ad7 100755
--- a/testsuite/tls3.sh
+++ b/testsuite/tls3.sh
@@ -2,9 +2,9 @@
. `dirname $0`/functions.sh
# First check if __thread is supported by ld.so/gcc/ld/as:
rm -f tlstest
-echo '__thread int a; int main (void) { return a; }' \
- | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
-( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
+#echo '__thread int a; int main (void) { return a; }' \
+# | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
+#( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
SHFLAGS=
case "`uname -m`" in
ia64|ppc*|x86_64|alpha*|s390*) SHFLAGS=-fpic;; # Does not support non-pic shared libs
@@ -21,7 +21,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./tls3 > tls3.log
$PRELINK ${PRELINK_OPTS--vm} ./tls3 >> tls3.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls3.log && exit 2
-LD_LIBRARY_PATH=. ./tls3 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./tls3 || exit 3
+fi
readelf -a ./tls3 >> tls3.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./tls3
diff --git a/testsuite/tls4.sh b/testsuite/tls4.sh
index 556a6d5..e6bdde2 100755
--- a/testsuite/tls4.sh
+++ b/testsuite/tls4.sh
@@ -2,9 +2,9 @@
. `dirname $0`/functions.sh
# First check if __thread is supported by ld.so/gcc/ld/as:
rm -f tlstest
-echo '__thread int a; int main (void) { return a; }' \
- | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
-( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
+#echo '__thread int a; int main (void) { return a; }' \
+# | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
+#( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
rm -f tls4 tls4lib*.so tls4.log
rm -f prelink.cache
$CC -shared -O2 -fpic -o tls4lib1.so $srcdir/tls4lib1.c
@@ -17,7 +17,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./tls4 > tls4.log
$PRELINK ${PRELINK_OPTS--vm} ./tls4 >> tls4.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls4.log && exit 2
-LD_LIBRARY_PATH=. ./tls4 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./tls4 || exit 3
+fi
readelf -a ./tls4 >> tls4.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./tls4
diff --git a/testsuite/tls5.sh b/testsuite/tls5.sh
index dbc0470..68ec82f 100755
--- a/testsuite/tls5.sh
+++ b/testsuite/tls5.sh
@@ -2,9 +2,9 @@
. `dirname $0`/functions.sh
# First check if __thread is supported by ld.so/gcc/ld/as:
rm -f tlstest
-echo '__thread int a; int main (void) { return a; }' \
- | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
-( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
+#echo '__thread int a; int main (void) { return a; }' \
+# | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
+#( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
rm -f tls5 tls5lib*.so tls5.log
rm -f prelink.cache
echo 'int tls5;' | $CC -shared -O2 -fpic -xc - -o tls5lib3.so
@@ -18,12 +18,16 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./tls5 > tls5.log
$PRELINK ${PRELINK_OPTS--vm} ./tls5 >> tls5.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls5.log && exit 2
-LD_LIBRARY_PATH=. ./tls5 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./tls5 || exit 3
+fi
$PRELINK -u tls5lib3.so || exit 4
echo $PRELINK ${PRELINK_OPTS--vm} ./tls5 >> tls5.log
$PRELINK ${PRELINK_OPTS--vm} ./tls5 >> tls5.log 2>&1 || exit 5
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls5.log && exit 6
-LD_LIBRARY_PATH=. ./tls5 || exit 7
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./tls5 || exit 7
+fi
readelf -a ./tls5 >> tls5.log 2>&1 || exit 8
# So that it is not prelinked again
chmod -x ./tls5
diff --git a/testsuite/tls6.sh b/testsuite/tls6.sh
index 2d854d9..60ae492 100755
--- a/testsuite/tls6.sh
+++ b/testsuite/tls6.sh
@@ -2,9 +2,9 @@
. `dirname $0`/functions.sh
# First check if __thread is supported by ld.so/gcc/ld/as:
rm -f tlstest
-echo '__thread int a; int main (void) { return a; }' \
- | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
-( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
+#echo '__thread int a; int main (void) { return a; }' \
+# | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
+#( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
rm -f tls6 tls6lib*.so tls6.log
rm -f prelink.cache
echo 'int tls6;' | $CC -shared -O2 -fpic -xc - -o tls6lib3.so
@@ -19,13 +19,17 @@ echo $PRELINK ${PRELINK_OPTS--vm} ./tls6 > tls6.log
$PRELINK ${PRELINK_OPTS--vm} ./tls6 >> tls6.log 2>&1 || exit 1
grep -v 'has undefined non-weak symbols' tls6.log \
| grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` && exit 2
-LD_LIBRARY_PATH=. ./tls6 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./tls6 || exit 3
+fi
$PRELINK -u tls6lib3.so || exit 4
echo $PRELINK ${PRELINK_OPTS--vm} ./tls6 >> tls6.log
$PRELINK ${PRELINK_OPTS--vm} ./tls6 >> tls6.log 2>&1 || exit 5
grep -v 'has undefined non-weak symbols' tls6.log \
| grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` && exit 6
-LD_LIBRARY_PATH=. ./tls6 || exit 7
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./tls6 || exit 7
+fi
readelf -a ./tls6 >> tls6.log 2>&1 || exit 8
# So that it is not prelinked again
chmod -x ./tls6
diff --git a/testsuite/tls7.sh b/testsuite/tls7.sh
index ab93719..216a379 100755
--- a/testsuite/tls7.sh
+++ b/testsuite/tls7.sh
@@ -2,9 +2,9 @@
. `dirname $0`/functions.sh
# First check if __thread is supported by ld.so/gcc/ld/as:
rm -f tlstest
-echo '__thread int a; int main (void) { return a; }' \
- | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
-( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
+#echo '__thread int a; int main (void) { return a; }' \
+# | $CC -xc - -o tlstest > /dev/null 2>&1 || exit 77
+#( ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77
rm -f tls7 tls7.log
rm -f prelink.cache
BINS="tls7"
@@ -14,7 +14,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./tls7 > tls7.log
$PRELINK ${PRELINK_OPTS--vm} ./tls7 >> tls7.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls7.log && exit 2
-LD_LIBRARY_PATH=. ./tls7 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./tls7 || exit 3
+fi
readelf -a ./tls7 >> tls7.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./tls7
diff --git a/testsuite/undo1.sh b/testsuite/undo1.sh
index d8436a5..ed61b6b 100755
--- a/testsuite/undo1.sh
+++ b/testsuite/undo1.sh
@@ -11,7 +11,9 @@ savelibs
echo $PRELINK ${PRELINK_OPTS--vm} ./undo1 > undo1.log
$PRELINK ${PRELINK_OPTS--vm} ./undo1 >> undo1.log 2>&1 || exit 1
grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` undo1.log && exit 2
-LD_LIBRARY_PATH=. ./undo1 || exit 3
+if [ "x$CROSS" = "x" ]; then
+ LD_LIBRARY_PATH=. ./undo1 || exit 3
+fi
readelf -a ./undo1 >> undo1.log 2>&1 || exit 4
# So that it is not prelinked again
chmod -x ./undo1