diff options
Diffstat (limited to 'trunk/testsuite')
126 files changed, 0 insertions, 3816 deletions
diff --git a/trunk/testsuite/Makefile.am b/trunk/testsuite/Makefile.am deleted file mode 100644 index 65d035d..0000000 --- a/trunk/testsuite/Makefile.am +++ /dev/null @@ -1,57 +0,0 @@ -## Process this file with automake to create Makefile.in - -AUTOMAKE_OPTIONS = 1.4 gnu - -DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -Wall -AM_CFLAGS = -Wall - -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 shuffle9.sh undo1.sh \ - layout1.sh layout2.sh unprel1.sh \ - tls1.sh tls2.sh tls3.sh tls4.sh tls5.sh tls6.sh tls7.sh \ - cxx1.sh cxx2.sh cxx3.sh quick1.sh quick2.sh quick3.sh \ - cycle1.sh cycle2.sh \ - deps1.sh deps2.sh \ - ifunc1.sh ifunc2.sh ifunc3.sh \ - undosyslibs.sh preload1.sh -TESTS_ENVIRONMENT = \ - PRELINK="../src/prelink -c ./prelink.conf -C ./prelink.cache --ld-library-path=. --dynamic-linker=`echo ./ld*.so.*[0-9]` --rtld=../src/rtld/prelink-rtld" \ - CC="$(CC) $(LINKOPTS)" CCLINK="$(CC) -Wl,--dynamic-linker=`echo ./ld*.so.*[0-9]`" \ - CXX="$(CXX) $(LINKOPTS)" CXXLINK="$(CXX) -Wl,--dynamic-linker=`echo ./ld*.so.*[0-9]`" - -extra_DIST = $(TESTS) functions.sh - -CLEANFILES = *.so *.so.* *.nop syslib.list syslnk.list prelink.cache prelink.conf \ - $(TESTS:%.sh=%) $(TESTS:%.sh=%.log) $(TESTS:%.sh=%.lds) \ - *.orig *.new core* *.\#prelink\#* tlstest *.first *.second - -clean-am: clean-dirs - -clean-dirs: - rm -rf *.tree - -.NOTPARALLEL: - -check-cycle: - @optlist=.; \ - if [ "`uname -m | sed s/i.86/i.86/`" = i.86 ]; then \ - optlist="--no-exec-shield --exec-shield"; \ - fi; \ - for opts2 in $$optlist; do \ - for opts in -v -vm -vR -vmR; do \ - PRELINK_OPTS="$$opts"; \ - [ $$opts2 != . ] && PRELINK_OPTS="$$opts $$opts2"; \ - echo "Checking with $$PRELINK_OPTS"; \ - PRELINK_OPTS="$$PRELINK_OPTS" $(MAKE) $(AM_MAKEFLAGS) check || exit; \ - $(MAKE) $(AM_MAKEFLAGS) clean || exit; \ - done; \ - done; \ - echo "Checking with -Wl,-z,nocombreloc"; \ - LINKOPTS=-Wl,-z,nocombreloc $(MAKE) $(AM_MAKEFLAGS) check || exit; \ - $(MAKE) $(AM_MAKEFLAGS) clean || exit - -check-harder: - @CHECK_ME_HARDER=1 $(MAKE) $(AM_MAKEFLAGS) check || exit diff --git a/trunk/testsuite/cxx1.C b/trunk/testsuite/cxx1.C deleted file mode 100644 index 9c11a6d..0000000 --- a/trunk/testsuite/cxx1.C +++ /dev/null @@ -1,26 +0,0 @@ -#include "cxx1.h" -extern "C" void abort (void); - -void -check (A *x, B *y) -{ - C d; - if (x->b () != 21) - abort (); - if (y->B::a () != 22) - abort (); - if (d.a () != 23) - abort (); - if (d.C::b () != 24) - abort (); -} - -int -main () -{ - A x; - if (x.a () != 20) - abort (); - do_check (check, &x); - return 0; -} diff --git a/trunk/testsuite/cxx1.h b/trunk/testsuite/cxx1.h deleted file mode 100644 index d6efe9b..0000000 --- a/trunk/testsuite/cxx1.h +++ /dev/null @@ -1,19 +0,0 @@ -struct A - { - virtual int a (); - virtual int b (); - int c; - }; -struct B - { - virtual int a (); - int b; - }; -struct C - { - virtual int a (); - virtual int b (); - int c; - }; - -void do_check (void (*check) (A *x, B *y), A *x); diff --git a/trunk/testsuite/cxx1.sh b/trunk/testsuite/cxx1.sh deleted file mode 100755 index b208746..0000000 --- a/trunk/testsuite/cxx1.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f cxx1 cxx1lib*.so cxx1.log -rm -f prelink.cache -$RUN_HOST $CXX -shared -O2 -fpic -o cxx1lib1.so $srcdir/cxx1lib1.C -$RUN_HOST $CXX -shared -O2 -fpic -o cxx1lib2.so $srcdir/cxx1lib2.C cxx1lib1.so -BINS="cxx1" -LIBS="cxx1lib1.so cxx1lib2.so" -$RUN_HOST $CXXLINK -o cxx1 $srcdir/cxx1.C -Wl,--rpath-link,. cxx1lib2.so cxx1lib1.so -savelibs -echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx1 > cxx1.log -$RUN_HOST $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 -case "`$RUN uname -m`" in - arm*) ;; # EABI says that vtables/typeinfo aren't vague linkage if there is a key method - *) [ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx1.log | grep 'Removing C++ conflict' | wc -l ) -ge 5 ] || exit 3;; -esac -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./cxx1 || exit 4 -fi -$RUN_HOST $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 6 diff --git a/trunk/testsuite/cxx1lib1.C b/trunk/testsuite/cxx1lib1.C deleted file mode 100644 index 1eb192a..0000000 --- a/trunk/testsuite/cxx1lib1.C +++ /dev/null @@ -1,34 +0,0 @@ -#include "cxx1.h" - -int A::a () -{ - return 10; -} - -int A::b () -{ - return 11; -} - -int B::a () -{ - return 12; -} - -int C::a () -{ - return 13; -} - -int C::b () -{ - return 14; -} - -void -do_check (void (*check) (A *x, B *y), A *x) -{ - B y; - - check (x, &y); -} diff --git a/trunk/testsuite/cxx1lib2.C b/trunk/testsuite/cxx1lib2.C deleted file mode 100644 index 77055da..0000000 --- a/trunk/testsuite/cxx1lib2.C +++ /dev/null @@ -1,28 +0,0 @@ -#include "cxx1.h" - -int A::a () -{ - return 20; -} - -int A::b () -{ - return 21; -} - -int B::a () -{ - return 22; -} - -int C::a () -{ - return 23; -} - -int C::b () -{ - return 24; -} - -C c; diff --git a/trunk/testsuite/cxx2.C b/trunk/testsuite/cxx2.C deleted file mode 100644 index 8b6e0bf..0000000 --- a/trunk/testsuite/cxx2.C +++ /dev/null @@ -1,51 +0,0 @@ -#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 deleted file mode 100755 index 651e595..0000000 --- a/trunk/testsuite/cxx2.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f cxx2 cxx2lib*.so cxx2.log -rm -f prelink.cache -$RUN_HOST $CXX -shared -O2 -fpic -o cxx2lib1.so $srcdir/cxx1lib1.C -$RUN_HOST $CXX -shared -O2 -fpic -o cxx2lib2.so $srcdir/cxx1lib2.C cxx2lib1.so -BINS="cxx2" -LIBS="cxx2lib1.so cxx2lib2.so" -$RUN_HOST $CXXLINK -o cxx2 $srcdir/cxx2.C -Wl,--rpath-link,. cxx2lib2.so cxx2lib1.so -savelibs -echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx2 > cxx2.log -$RUN_HOST $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 -case "`$RUN uname -m`" in - arm*) ;; # EABI says that vtables/typeinfo aren't vague linkage if there is a key method - *) [ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx2.log | grep 'Removing C++ conflict' | wc -l ) -ge 9 ] || exit 3;; -esac -$RUN LD_LIBRARY_PATH=. ./cxx2 || exit 4 -$RUN_HOST $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/cxx3.C b/trunk/testsuite/cxx3.C deleted file mode 100644 index 0a4ad7b..0000000 --- a/trunk/testsuite/cxx3.C +++ /dev/null @@ -1,26 +0,0 @@ -#include "cxx3.h" -extern "C" void abort (void); - -void -check (A *x, B *y) -{ - C d; - if (x->b () != 2) - abort (); - if (y->B::a () != 3) - abort (); - if (d.a () != 4) - abort (); - if (d.C::b () != 5) - abort (); -} - -int -main () -{ - A x; - if (x.a () != 1) - abort (); - do_check (check, &x); - return 0; -} diff --git a/trunk/testsuite/cxx3.h b/trunk/testsuite/cxx3.h deleted file mode 100644 index ad2de7e..0000000 --- a/trunk/testsuite/cxx3.h +++ /dev/null @@ -1,22 +0,0 @@ -struct A - { - virtual int a () { return 1; } - virtual int b () { return 2; } - virtual ~A () {} - int c; - }; -struct B - { - virtual int a () { return 3; } - virtual ~B () {} - int b; - }; -struct C - { - virtual int a () { return 4; } - virtual int b () { return 5; } - virtual ~C () {} - int c; - }; - -void do_check (void (*check) (A *x, B *y), A *x); diff --git a/trunk/testsuite/cxx3.sh b/trunk/testsuite/cxx3.sh deleted file mode 100755 index 0908978..0000000 --- a/trunk/testsuite/cxx3.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f cxx3 cxx3lib*.so cxx3.log -rm -f prelink.cache -$RUN_HOST $CXX -shared -O2 -fpic -o cxx3lib1.so $srcdir/cxx3lib1.C -$RUN_HOST $CXX -shared -O2 -fpic -o cxx3lib2.so $srcdir/cxx3lib2.C cxx3lib1.so -BINS="cxx3" -LIBS="cxx3lib1.so cxx3lib2.so" -$RUN_HOST $CXXLINK -o cxx3 $srcdir/cxx3.C -Wl,--rpath-link,. cxx3lib2.so cxx3lib1.so -savelibs -echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx3 > cxx3.log -$RUN_HOST $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx3 >> cxx3.log 2>&1 || exit 1 -grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx3.log | grep -q -v 'C++ conflict' && exit 2 -[ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx3.log | grep 'Removing C++ conflict' | wc -l ) -ge 29 ] || exit 3 -$RUN LD_LIBRARY_PATH=. ./cxx3 || exit 4 -$RUN_HOST $READELF -a ./cxx3 >> cxx3.log 2>&1 || exit 5 -# So that it is not prelinked again -chmod -x ./cxx3 -comparelibs >> cxx3.log 2>&1 || exit 6 diff --git a/trunk/testsuite/cxx3lib1.C b/trunk/testsuite/cxx3lib1.C deleted file mode 100644 index f870bf0..0000000 --- a/trunk/testsuite/cxx3lib1.C +++ /dev/null @@ -1,13 +0,0 @@ -#include "cxx3.h" - -A a1; -B b1; -C c1; - -void -do_check (void (*check) (A *x, B *y), A *x) -{ - B y; - - check (x, &y); -} diff --git a/trunk/testsuite/cxx3lib2.C b/trunk/testsuite/cxx3lib2.C deleted file mode 100644 index 75f2b12..0000000 --- a/trunk/testsuite/cxx3lib2.C +++ /dev/null @@ -1,5 +0,0 @@ -#include "cxx3.h" - -A a2; -B b2; -C c; diff --git a/trunk/testsuite/cycle1.sh b/trunk/testsuite/cycle1.sh deleted file mode 100755 index f8c32b6..0000000 --- a/trunk/testsuite/cycle1.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f cycle1 cycle1lib*.so cycle1.log -rm -f prelink.cache -# Test whether prelink doesn't segfault or loop endlessly on -# bogus library dependency chains -echo 'int foo;' | $RUN_HOST $CC -shared -O2 -fpic -o cycle1lib1.so -xc - -echo 'int bar;' | $RUN_HOST $CC -shared -O2 -fpic -o cycle1lib2.so -xc - -xnone cycle1lib1.so -echo 'int foo;' | $RUN_HOST $CC -shared -O2 -fpic -o cycle1lib1.so -xc - -xnone cycle1lib2.so -BINS="cycle1" -LIBS="cycle1lib1.so cycle1lib2.so" -echo 'int main (void) { return 0; } ' \ - | $RUN_HOST $CCLINK -o cycle1 -xc - -xnone -Wl,--rpath-link,. cycle1lib2.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./cycle1 > cycle1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./cycle1 >> cycle1.log 2>&1 || exit 1 -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 -if [ "x$CROSS" = "x" ] ; then - $RUN LD_LIBRARY_PATH=. ./cycle1 || exit 4 -fi -# So that it is not prelinked again -chmod -x ./cycle1 diff --git a/trunk/testsuite/cycle2.sh b/trunk/testsuite/cycle2.sh deleted file mode 100755 index 9616464..0000000 --- a/trunk/testsuite/cycle2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f cycle2 cycle2lib*.so cycle2.log -rm -f prelink.cache -# Test whether prelink doesn't segfault or loop endlessly on -# bogus library dependency chains -echo 'int i1;' | $RUN_HOST $CC -shared -O2 -fpic -o cycle2lib1.so -xc - -echo 'int i2;' | $RUN_HOST $CC -shared -O2 -fpic -o cycle2lib2.so -xc - -xnone cycle2lib1.so -echo 'int i3;' | $RUN_HOST $CC -shared -O2 -fpic -o cycle2lib3.so -xc - -xnone cycle2lib2.so -echo 'int i4;' | $RUN_HOST $CC -shared -O2 -fpic -o cycle2lib4.so -xc - -xnone cycle2lib3.so -echo 'int i5;' | $RUN_HOST $CC -shared -O2 -fpic -o cycle2lib5.so -xc - -xnone cycle2lib4.so -echo 'int i1;' | $RUN_HOST $CC -shared -O2 -fpic -o cycle2lib1.so -xc - -xnone cycle2lib5.so -BINS="cycle2" -LIBS="cycle2lib1.so cycle2lib2.so cycle2lib3.so cycle2lib4.so cycle2lib5.so" -echo 'int main (void) { return 0; } ' \ - | $RUN_HOST $CCLINK -o cycle2 -xc - -xnone -Wl,--rpath-link,. cycle2lib5.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./cycle2 > cycle2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./cycle2 >> cycle2.log 2>&1 || exit 1 -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 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./cycle2 || exit 4 -fi -# So that it is not prelinked again -chmod -x ./cycle2 diff --git a/trunk/testsuite/deps1.c b/trunk/testsuite/deps1.c deleted file mode 100644 index 331546c..0000000 --- a/trunk/testsuite/deps1.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "reloc1.h" -#include <stdlib.h> - -static struct A local = { 77, &local, &bar + 4 }; - -int main() -{ - if (foo.a != 1 || foo.b != &foo || foo.c != &bar || bar != 26) - abort (); - if (f1 () != 1 || f2 () != 2) - abort (); - local.c -= 4; - if (local.a != 77 || local.b != &local || local.c != &bar) - abort (); - if (f8 () != 17) - abort (); - exit (0); -} diff --git a/trunk/testsuite/deps1.h b/trunk/testsuite/deps1.h deleted file mode 100644 index d5868f7..0000000 --- a/trunk/testsuite/deps1.h +++ /dev/null @@ -1,4 +0,0 @@ -#include "reloc1.h" - -extern int f8 (void); -extern int f9 (void); diff --git a/trunk/testsuite/deps1.sh b/trunk/testsuite/deps1.sh deleted file mode 100755 index a5bdcac..0000000 --- a/trunk/testsuite/deps1.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh - -PRELINK=`echo $PRELINK \ - | sed -e 's, \./\(prelink\.\(cache\|conf\)\), deps1.tree/etc/\1,g' \ - -e 's,path=\.,path=deps1.tree/lib:deps1.tree/usr/lib:deps1.tree/opt/lib,' \ - -e 's,linker=\./,linker=deps1.tree/lib/,'` -CCLINK=`echo $CCLINK \ - | sed -e 's,linker=\./,linker=deps1.tree/lib/,'` -rm -rf deps1.tree -rm -f deps1.log -mkdir -p deps1.tree/{lib,etc,usr/lib,opt/lib,usr/bin} -$RUN_HOST $CC -shared -O2 -fpic -o deps1.tree/usr/lib/lib1.so $srcdir/deps1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o deps1.tree/opt/lib/lib1.so $srcdir/deps1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o deps1.tree/usr/lib/lib2.so $srcdir/deps1lib2.c \ - -L deps1.tree/opt/lib -Wl,-rpath,deps1.tree/opt/lib -l1 -echo '' | $RUN_HOST $CC -shared -O2 -fpic -o deps1.tree/usr/lib/lib3.so -xc - -xnone \ - -L deps1.tree/usr/lib -L deps1.tree/opt/lib -Wl,-rpath,deps1.tree/usr/lib \ - -l1 -l2 -for lib in `cat syslib.list`; do - cp -p $lib.orig deps1.tree/lib/$lib - cp -p $lib.orig deps1.tree/lib/$lib.orig -done -for lib in `cat syslnk.list`; do - cp -dp $lib deps1.tree/lib -done -$RUN_HOST $CCLINK -o deps1.tree/usr/bin/bin1 $srcdir/deps1.c \ - -Wl,-rpath,deps1.tree/usr/lib -L deps1.tree/usr/lib -l3 -lc -l1 -l2 -cat > deps1.tree/etc/prelink.conf <<EOF -deps1.tree/usr/bin -deps1.tree/lib -deps1.tree/usr/lib -deps1.tree/opt/lib -EOF -LIBS="deps1.tree/usr/lib/lib1.so deps1.tree/usr/lib/lib2.so" -LIBS="$LIBS deps1.tree/usr/lib/lib3.so deps1.tree/opt/lib/lib1.so" -LIBS="$LIBS `sed 's|^|deps1.tree/lib/|' syslib.list`" -BINS="deps1.tree/usr/bin/bin1" -savelibs -chmod 644 `ls $BINS | sed 's|$|.orig|'` -echo $PRELINK ${PRELINK_OPTS--v} -avvvvv > deps1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--v} -avvvvv > deps1.tree/etc/log1 2>&1 || exit 1 -cat deps1.tree/etc/log1 >> deps1.log -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=deps1.tree/lib deps1.tree/usr/bin/bin1 || exit 2 -fi -$RUN_HOST $READELF -d deps1.tree/{usr,opt}/lib/lib1.so 2>&1 | grep CHECKSUM >> deps1.log || exit 3 -$RUN_HOST $READELF -A deps1.tree/usr/lib/lib1.so >> deps1.log 2>&1 || exit 4 -$RUN_HOST $READELF -A deps1.tree/opt/lib/lib1.so >> deps1.log 2>&1 || exit 5 -$RUN_HOST $READELF -A deps1.tree/usr/lib/lib2.so >> deps1.log 2>&1 || exit 6 -$RUN_HOST $READELF -A deps1.tree/usr/lib/lib3.so >> deps1.log 2>&1 || exit 7 -$RUN_HOST $READELF -A deps1.tree/usr/bin/bin1 >> deps1.log 2>&1 || exit 8 -LIBS="deps1.tree/usr/lib/lib1.so deps1.tree/usr/lib/lib2.so" -LIBS="$LIBS deps1.tree/opt/lib/lib1.so" -$RUN_HOST $READELF -S deps1.tree/usr/lib/lib3.so | grep -q .gnu.prelink_undo \ - && LIBS="$LIBS deps1.tree/usr/lib/lib3.so" -$RUN_HOST $READELF -S deps1.tree/usr/bin/bin1 | grep -q .gnu.prelink_undo \ - || BINS= -comparelibs >> deps1.log 2>&1 || exit 8 -exit 0 diff --git a/trunk/testsuite/deps1lib1.c b/trunk/testsuite/deps1lib1.c deleted file mode 100644 index d4ab28b..0000000 --- a/trunk/testsuite/deps1lib1.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "deps1.h" - -int bar = 26; -int baz = 28; - -struct A foo = { 1, &foo, &bar }; - -int f1 (void) -{ - return 1; -} - -int f2 (void) -{ - return f1 () + 1; -} - -int f9 (void) -{ - return 18; -} diff --git a/trunk/testsuite/deps1lib2.c b/trunk/testsuite/deps1lib2.c deleted file mode 100644 index f73b456..0000000 --- a/trunk/testsuite/deps1lib2.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "reloc1.h" - -int f1 (void) -{ - return 11; -} - -int f8 (void) -{ - return f9 () - 1; -} diff --git a/trunk/testsuite/deps2.sh b/trunk/testsuite/deps2.sh deleted file mode 100755 index cdd6f59..0000000 --- a/trunk/testsuite/deps2.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh - -PRELINK=`echo $PRELINK \ - | sed -e 's, \./\(prelink\.\(cache\|conf\)\), deps2.tree/etc/\1,g' \ - -e 's,path=\.,path=deps2.tree/lib:deps2.tree/usr/lib:deps2.tree/opt/lib,' \ - -e 's,linker=\./,linker=deps2.tree/lib/,'` -CCLINK=`echo $CCLINK \ - | sed -e 's,linker=\./,linker=deps2.tree/lib/,'` -rm -rf deps2.tree -rm -f deps2.log -mkdir -p deps2.tree/{lib,etc,usr/lib,opt/lib,usr/bin} -$RUN_HOST $CC -shared -O2 -fpic -o deps2.tree/usr/lib/lib1.so $srcdir/deps1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o deps2.tree/opt/lib/lib1.so $srcdir/deps2lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o deps2.tree/usr/lib/lib2.so $srcdir/deps1lib2.c \ - -L deps2.tree/opt/lib -Wl,-rpath,deps2.tree/opt/lib -l1 -echo '' | $RUN_HOST $CC -shared -O2 -fpic -o deps2.tree/usr/lib/lib3.so -xc - -xnone \ - -L deps2.tree/usr/lib -L deps2.tree/opt/lib -Wl,-rpath,deps2.tree/usr/lib \ - -l1 -l2 -for lib in `cat syslib.list`; do - cp -p $lib.orig deps2.tree/lib/$lib - cp -p $lib.orig deps2.tree/lib/$lib.orig -done -for lib in `cat syslnk.list`; do - cp -dp $lib deps2.tree/lib -done -$RUN_HOST $CCLINK -o deps2.tree/usr/bin/bin1 $srcdir/deps1.c \ - -Wl,-rpath,deps2.tree/usr/lib -L deps2.tree/usr/lib -l3 -lc -l1 -l2 -cat > deps2.tree/etc/prelink.conf <<EOF -deps2.tree/usr/bin -deps2.tree/lib -deps2.tree/usr/lib -deps2.tree/opt/lib -EOF -LIBS="deps2.tree/usr/lib/lib1.so deps2.tree/usr/lib/lib2.so" -LIBS="$LIBS deps2.tree/usr/lib/lib3.so deps2.tree/opt/lib/lib1.so" -LIBS="$LIBS `sed 's|^|deps2.tree/lib/|' syslib.list`" -BINS="deps2.tree/usr/bin/bin1" -savelibs -chmod 644 `ls $BINS | sed 's|$|.orig|'` -echo $PRELINK ${PRELINK_OPTS--v} -avvvvv > deps2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--v} -avvvvv > deps2.tree/etc/log1 2>&1 || exit 1 -cat deps2.tree/etc/log1 >> deps2.log -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=deps2.tree/lib deps2.tree/usr/bin/bin1 || exit 2 -fi -$RUN_HOST $READELF -d deps2.tree/{usr,opt}/lib/lib1.so 2>&1 | grep CHECKSUM >> deps2.log || exit 3 -$RUN_HOST $READELF -A deps2.tree/usr/lib/lib1.so >> deps2.log 2>&1 || exit 4 -$RUN_HOST $READELF -A deps2.tree/opt/lib/lib1.so >> deps2.log 2>&1 || exit 5 -$RUN_HOST $READELF -A deps2.tree/usr/lib/lib2.so >> deps2.log 2>&1 || exit 6 -$RUN_HOST $READELF -A deps2.tree/usr/lib/lib3.so >> deps2.log 2>&1 || exit 7 -$RUN_HOST $READELF -A deps2.tree/usr/bin/bin1 >> deps2.log 2>&1 || exit 8 -LIBS="deps2.tree/usr/lib/lib1.so deps2.tree/usr/lib/lib2.so" -LIBS="$LIBS deps2.tree/opt/lib/lib1.so" -BINS= -comparelibs >> deps2.log 2>&1 || exit 9 -exit 0 diff --git a/trunk/testsuite/deps2lib1.c b/trunk/testsuite/deps2lib1.c deleted file mode 100644 index 9d4b2de..0000000 --- a/trunk/testsuite/deps2lib1.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "deps1.h" - -int bar = 26; -int baz = 28; - -struct A foo = { 1, &foo, &bar }; - -int f0 (void) -{ - return f1 () + f2 () + f9 () + bar + baz; -} - -int f1 (void) -{ - return 1; -} - -int f2 (void) -{ - return f1 () + 1; -} - -int f9 (void) -{ - return 18; -} diff --git a/trunk/testsuite/functions.sh b/trunk/testsuite/functions.sh deleted file mode 100755 index 07a3827..0000000 --- a/trunk/testsuite/functions.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -CC="${CC:-gcc} ${LINKOPTS}" -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]` --rtld=../src/rtld/prelink-rtld} -LDD=${LDD:-../src/rtld/prelink-rtld} -STRIP=${STRIP:-strip} -HOST_CC=${HOST_CC:-$CC} -READELF=${READELF:-readelf} -RUN=${RUN:-env} -RUN_HOST=${RUN_HOST:-env} -srcdir=${srcdir:-`dirname $0`} -savelibs() { - for i in $LIBS $BINS; do cp -p $i $i.orig; done -} -comparelibs() { - for i in $LIBS $BINS; do - cp -p $i $i.new - echo $PRELINK -u $i.new - $RUN_HOST $PRELINK -u $i.new || exit - cmp -s $i.orig $i.new || exit - rm -f $i.new - echo $PRELINK -y $i \> $i.new - $RUN_HOST $PRELINK -y $i > $i.new || exit - cmp -s $i.orig $i.new || exit - rm -f $i.new - done -} diff --git a/trunk/testsuite/ifunc.h b/trunk/testsuite/ifunc.h deleted file mode 100644 index 8507f19..0000000 --- a/trunk/testsuite/ifunc.h +++ /dev/null @@ -1,92 +0,0 @@ -#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 -#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 ", .-.L" #name "\n") -# endif -#elif defined __s390x__ -# define IFUNC_ASM(fn) "\tlarl %r2," fn "\n" \ - "\tbr %r14\n" -#elif defined __s390__ -# define IFUNC_ASM(fn) "\t" \ - "\tst %r12,48(%r15)\n" \ - "\tbasr %r5,0\n" \ - "1:\tl %r12,3f-1b(%r5)\n" \ - "\tl %r1,2f-1b(%r5)\n" \ - "\tla %r12,0(%r12,%r5)\n" \ - "\tla %r2,0(%r1,%r12)\n" \ - "\tl %r12,48(%r15)\n" \ - "\tbr %r14\n" \ - "\t.align 4\n" \ - "2:\t.long " fn "@GOTOFF\n" \ - "3:\t.long _GLOBAL_OFFSET_TABLE_-1b\n" -elif defined __arm__ -# ifdef __thumb__ -# define PIPE_OFFSET "4" -# else -# define PIPE_OFFSET "8" -# endif -# define IFUNC_ASM(fn) \ - "\tldr r0, .L" fn "\n" \ - "1:\tadd r0, pc, r0\n" \ - "\tmov pc, lr\n" \ - ".L" fn ": .long " fn " - 1b - " PIPE_OFFSET "\n" -# 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") -#else -# error Architecture not supported -#endif -#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/ifunc1.c b/trunk/testsuite/ifunc1.c deleted file mode 100644 index f5500df..0000000 --- a/trunk/testsuite/ifunc1.c +++ /dev/null @@ -1,29 +0,0 @@ -#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 deleted file mode 100755 index 39a008a..0000000 --- a/trunk/testsuite/ifunc1.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# First check if __thread is supported by ld.so/gcc/ld/as: -$RUN_HOST $CCLINK -o ifunctest $srcdir/ifunctest.c -Wl,--rpath-link,. > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./ifunctest || { rm -f ifunctest; exit 77; } ) 2>/dev/null || exit 77 -fi -rm -f ifunctest ifunc1 ifunc1lib*.so ifunc1.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o ifunc1lib1.so $srcdir/ifunc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o ifunc1lib2.so $srcdir/ifunc1lib2.c ifunc1lib1.so -BINS="ifunc1" -LIBS="ifunc1lib1.so ifunc1lib2.so" -$RUN_HOST $CCLINK -o ifunc1 $srcdir/ifunc1.c -Wl,--rpath-link,. ifunc1lib2.so -lc ifunc1lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./ifunc1 >> ifunc1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./ifunc1 >> ifunc1.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` ifunc1.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./ifunc1 || exit 3 -fi -$RUN_HOST $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 deleted file mode 100644 index 27a3f03..0000000 --- a/trunk/testsuite/ifunc1lib1.c +++ /dev/null @@ -1,32 +0,0 @@ -#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 deleted file mode 100644 index ca12e3d..0000000 --- a/trunk/testsuite/ifunc1lib2.c +++ /dev/null @@ -1,39 +0,0 @@ -#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 deleted file mode 100755 index 16f427c..0000000 --- a/trunk/testsuite/ifunc2.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# First check if __thread is supported by ld.so/gcc/ld/as: -$RUN_HOST $CCLINK -o ifunctest $srcdir/ifunctest.c -Wl,--rpath-link,. > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./ifunctest || { rm -f ifunctest; exit 77; } ) 2>/dev/null || exit 77 -fi -rm -f ifunctest ifunc2 ifunc2lib*.so ifunc2.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o ifunc2lib1.so $srcdir/ifunc1lib1.c -DPICKNO=2 -$RUN_HOST $CC -shared -O2 -fpic -o ifunc2lib2.so $srcdir/ifunc1lib2.c ifunc2lib1.so -DPICKNO=2 -BINS="ifunc2" -LIBS="ifunc2lib1.so ifunc2lib2.so" -$RUN_HOST $CCLINK -o ifunc2 $srcdir/ifunc1.c -Wl,--rpath-link,. ifunc2lib2.so -lc ifunc2lib1.so -DPICKNO=2 -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./ifunc2 >> ifunc2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./ifunc2 >> ifunc2.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` ifunc2.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./ifunc2 || exit 3 -fi -$RUN_HOST $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 deleted file mode 100644 index 1f243d8..0000000 --- a/trunk/testsuite/ifunc3.c +++ /dev/null @@ -1,32 +0,0 @@ -#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 deleted file mode 100755 index 2f8c0aa..0000000 --- a/trunk/testsuite/ifunc3.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# First check if __thread is supported by ld.so/gcc/ld/as: -$RUN_HOST $CCLINK -o ifunctest $srcdir/ifunctest.c -Wl,--rpath-link,. > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./ifunctest || { rm -f ifunctest; exit 77; } ) 2>/dev/null || exit 77 -fi -rm -f ifunctest ifunc3 ifunc3lib*.so ifunc3.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o ifunc3lib1.so $srcdir/ifunc3lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o ifunc3lib2.so $srcdir/ifunc1lib2.c ifunc3lib1.so -BINS="ifunc3" -LIBS="ifunc3lib1.so ifunc3lib2.so" -$RUN_HOST $CCLINK -o ifunc3 $srcdir/ifunc3.c -Wl,--rpath-link,. ifunc3lib2.so -lc ifunc3lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./ifunc3 >> ifunc3.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./ifunc3 >> ifunc3.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` ifunc3.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./ifunc3 || exit 3 -fi -$RUN_HOST $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 deleted file mode 100644 index 133b389..0000000 --- a/trunk/testsuite/ifunc3lib1.c +++ /dev/null @@ -1,37 +0,0 @@ -#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 deleted file mode 100644 index 9ce7b1a..0000000 --- a/trunk/testsuite/ifunctest.c +++ /dev/null @@ -1,16 +0,0 @@ -#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/layout.C b/trunk/testsuite/layout.C deleted file mode 100644 index 5047a34..0000000 --- a/trunk/testsuite/layout.C +++ /dev/null @@ -1,3 +0,0 @@ -int main() -{ -} diff --git a/trunk/testsuite/layout1.sh b/trunk/testsuite/layout1.sh deleted file mode 100755 index 0af196e..0000000 --- a/trunk/testsuite/layout1.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f prelink.cache -rm -f layout1 layoutlib*.so layout1.log -i=10 -BINS="layout1" -LIBS= -while [ $i -lt 74 ]; do - $RUN_HOST $CXX -shared -fpic -o layout1lib$i.so $srcdir/layoutlib.C - LIBS="$LIBS layout1lib$i.so" - i=`expr $i + 1` -done -$RUN_HOST $CXXLINK -o layout1 $srcdir/layout.C layout1lib*.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vR} ./layout1 > layout1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vR} ./layout1 >> layout1.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` layout1.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./layout1 || exit 3 -fi -$RUN_HOST $READELF -a ./layout1 >> layout1.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./layout1 -comparelibs >> layout1.log 2>&1 || exit 5 diff --git a/trunk/testsuite/layout2.sh b/trunk/testsuite/layout2.sh deleted file mode 100755 index 03f8b28..0000000 --- a/trunk/testsuite/layout2.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f layout2 layout2lib*.so layout2.log -i=1 -BINS="layout2" -LIBS= -while [ $i -lt 6 ]; do - $RUN_HOST $CXX -shared -fpic -o layout2lib$i.so $srcdir/layoutlib.C - LIBS="$LIBS layout2lib$i.so" - i=`expr $i + 1` -done -$RUN_HOST $CXXLINK -o layout2 $srcdir/layout.C layout2lib*.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vR} ./layout2 > layout2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vR} ./layout2 >> layout2.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` layout2.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./layout2 || exit 3 -fi -$RUN_HOST $READELF -a ./layout2 >> layout2.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./layout2 -comparelibs >> layout2.log 2>&1 || exit 5 diff --git a/trunk/testsuite/layoutlib.C b/trunk/testsuite/layoutlib.C deleted file mode 100644 index 8162515..0000000 --- a/trunk/testsuite/layoutlib.C +++ /dev/null @@ -1,10 +0,0 @@ -struct A - { - virtual int a(); - int b; - }; - -int A::a() -{ - return 10; -} diff --git a/trunk/testsuite/movelibs.sh b/trunk/testsuite/movelibs.sh deleted file mode 100755 index c640f45..0000000 --- a/trunk/testsuite/movelibs.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# This script copies needed C and C++ libraries into the test directory -echo 'int main() { }' > movelibs.C -$RUN_HOST $CXX -o movelibs movelibs.C -> syslib.list -> syslnk.list -for i in `$RUN_HOST RTLD_TRACE_PRELINKING=1 RTLD_WARN= $LDD ./movelibs \ - | awk '$1 !~ /^\.\/movelibs/ { print $3 } '`; do - k=`basename $i` - if [ -L $i ]; then - j=`ls -l $i | sed 's/^.* -> //'` - if echo $j | grep / >/dev/null 2>&1; then - cp -p $i . - echo $k >> syslib.list - else - cp -dp $i . - cp -p `dirname $i`/$j . - echo $j >> syslib.list - echo $k >> syslnk.list - fi - else - cp -p $i . - echo $k >> syslib.list - fi -done -rm -f movelibs.C movelibs -pwd > prelink.conf -for i in `cat syslib.list`; do - if $RUN_HOST $READELF -WS $i 2>/dev/null | grep -q .gnu.prelink_undo; then - $RUN_HOST $PRELINK -u $i > /dev/null 2>&1 || exit 1 - fi - cp -p $i $i.orig -done -exit 77 diff --git a/trunk/testsuite/preload1.c b/trunk/testsuite/preload1.c deleted file mode 100644 index d6ee489..0000000 --- a/trunk/testsuite/preload1.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <stdlib.h> -#include "preload1.h" - -int main() -{ - int rc = foo(2, 2); - - if (rc != 0) - abort (); - - exit (rc); -} diff --git a/trunk/testsuite/preload1.h b/trunk/testsuite/preload1.h deleted file mode 100644 index 139bee0..0000000 --- a/trunk/testsuite/preload1.h +++ /dev/null @@ -1,2 +0,0 @@ -int foo(int x, int y); - diff --git a/trunk/testsuite/preload1.sh b/trunk/testsuite/preload1.sh deleted file mode 100755 index a44ea5c..0000000 --- a/trunk/testsuite/preload1.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -check_one() { - cnt=0 - log=$1 - echo -n . >> preload1.log - text="$2" - shift 2 - while [ $# -gt 0 ]; do - grep -q "^$text .*$1" $log || exit 40 - cnt=$((++cnt)) - shift - done - [ `grep "^$text " $log | wc -l` = $cnt ] || exit 41 -} -check_log() { - log=$1 - echo -n "Checking $1 " >> preload1.log - check_one $log 'Checking executable' $CHECKE - check_one $log 'Checking shared library' $CHECKL - check_one $log 'Assuming prelinked' $ASSUME - check_one $log 'Prelinking' $PREL - echo >> preload1.log -} - -PRELINK=`echo $PRELINK \ - | sed -e 's, \./\(prelink\.\(cache\|conf\)\), preload1.tree/etc/\1,g' \ - -e 's,path=\.,path=preload1.tree/lib:preload1.tree/usr/lib,' \ - -e 's,linker=\./,linker=preload1.tree/lib/,'` -CCLINK=`echo $CCLINK \ - | sed -e 's,linker=\./,linker=preload1.tree/lib/,'` -rm -rf preload1.tree -rm -f preload1.log -mkdir -p preload1.tree/{lib,etc,usr/lib,usr/bin} -$RUN_HOST $CC -shared -O2 -fpic -o preload1.tree/usr/lib/lib1.so $srcdir/preload1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o preload1.tree/usr/lib/lib2.so $srcdir/preload1lib2.c -for lib in `cat syslib.list`; do - cp -p $lib.orig preload1.tree/lib/$lib - cp -p $lib.orig preload1.tree/lib/$lib.orig -done -for lib in `cat syslnk.list`; do - cp -dp $lib preload1.tree/lib -done -$RUN_HOST $CCLINK -o preload1.tree/usr/bin/bin1 $srcdir/preload1.c \ - -Wl,--rpath-link,preload1.tree/usr/lib -L preload1.tree/usr/lib -lc -l1 -cat > preload1.tree/etc/prelink.conf <<EOF -preload1.tree/usr/bin -preload1.tree/lib -preload1.tree/usr/lib -EOF -LIBS="preload1.tree/usr/lib/lib1.so preload1.tree/usr/lib/lib2.so" -LIBS="$LIBS `sed 's|^|preload1.tree/lib/|' syslib.list`" -BINS="preload1.tree/usr/bin/bin1" -savelibs -chmod 644 `ls $BINS | sed 's|$|.orig|'` -# Make sure prelinked binaries and libraries will have different ctimes -# than mtimes -sleep 3s -echo $PRELINK ${PRELINK_OPTS--vm} -avvvvv > preload1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -avvvvv > preload1.tree/etc/log1 2>&1 || exit 1 -cat preload1.tree/etc/log1 >> preload1.log -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> preload1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > preload1.tree/etc/log2 2>&1 || exit 2 -cat preload1.tree/etc/log2 >> preload1.log -if [ "x$CROSS" = "x" ]; then - # We -expect- a failure here! - $RUN LD_LIBRARY_PATH=preload1.tree/lib:preload1.tree/usr/lib preload1.tree/usr/bin/bin1 && exit 3 -fi -for f in $LIBS $BINS ; do - cp $f $f.orig -done -echo $PRELINK ${PRELINK_OPTS--vm} --ld-preload=preload1.tree/usr/lib/lib2.so -avvvvv >> preload1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} --ld-preload=preload1.tree/usr/lib/lib2.so -avvvvv > preload1.tree/etc/log4 2>&1 || exit 4 -cat preload1.tree/etc/log4 >> preload1.log -# System libs and lib1.so MIGHT change, but lib2.so and bin1 must change -for i in preload1.tree/usr/lib/lib2.so preload1.tree/usr/bin/bin1; do - cmp -s $i.orig $i && exit 5 -done -if [ "x$CROSS" = "x" ]; then - # Should run, but fail (no preload) - $RUN LD_LIBRARY_PATH=preload1.tree/lib:preload1.tree/usr/lib preload1.tree/usr/bin/bin1 && exit 6 - # Should run, and exit successfully - $RUN LD_PRELOAD=preload1.tree/usr/lib/lib2.so LD_LIBRARY_PATH=preload1.tree/lib:preload1.tree/usr/lib preload1.tree/usr/bin/bin1 || exit 7 -fi -chmod 755 $BINS -exit 0 diff --git a/trunk/testsuite/preload1lib1.c b/trunk/testsuite/preload1lib1.c deleted file mode 100644 index 0c1fa43..0000000 --- a/trunk/testsuite/preload1lib1.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "preload1.h" - -int foo(int x, int y) { - return x * y; -} diff --git a/trunk/testsuite/preload1lib2.c b/trunk/testsuite/preload1lib2.c deleted file mode 100644 index 7ab50aa..0000000 --- a/trunk/testsuite/preload1lib2.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "preload1.h" - -int foo(int x, int y) { - return 0; -} diff --git a/trunk/testsuite/quick1.c b/trunk/testsuite/quick1.c deleted file mode 100644 index dc98441..0000000 --- a/trunk/testsuite/quick1.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "reloc1.h" -#include <stdlib.h> - -static struct A local = { 77, &local, &bar + 4 }; -extern int baz; -static char *bazp0 = (char *) &baz; -static char *bazp1 = ((char *) &baz) + 1; - -int main() -{ - if (foo.a != 1 || foo.b != &foo || foo.c != &bar || bar != 26) - abort (); - if (f1 () != 11 || f2 () != 12) - abort (); - local.c -= 4; - if (local.a != 77 || local.b != &local || local.c != &bar) - abort (); - if (bazp1 - bazp0 != 1) - abort (); - exit (0); -} diff --git a/trunk/testsuite/quick1.sh b/trunk/testsuite/quick1.sh deleted file mode 100755 index 228ba4c..0000000 --- a/trunk/testsuite/quick1.sh +++ /dev/null @@ -1,212 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -check_one() { - cnt=0 - log=$1 - echo -n . >> quick1.log - text="$2" - shift 2 - while [ $# -gt 0 ]; do - grep -q "^$text .*$1" $log || exit 40 - cnt=$((++cnt)) - shift - done - [ `grep "^$text " $log | wc -l` = $cnt ] || exit 41 -} -check_log() { - log=$1 - echo -n "Checking $1 " >> quick1.log - check_one $log 'Checking executable' $CHECKE - check_one $log 'Checking shared library' $CHECKL - check_one $log 'Assuming prelinked' $ASSUME - check_one $log 'Prelinking' $PREL - echo >> quick1.log -} - -PRELINK=`echo $PRELINK \ - | sed -e 's, \./\(prelink\.\(cache\|conf\)\), quick1.tree/etc/\1,g' \ - -e 's,path=\.,path=quick1.tree/lib:quick1.tree/usr/lib,' \ - -e 's,linker=\./,linker=quick1.tree/lib/,'` -CCLINK=`echo $CCLINK \ - | sed -e 's,linker=\./,linker=quick1.tree/lib/,'` -rm -rf quick1.tree -rm -f quick1.log -mkdir -p quick1.tree/{lib,etc,usr/lib,usr/bin} -$RUN_HOST $CC -shared -O2 -fpic -o quick1.tree/usr/lib/lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o quick1.tree/usr/lib/lib2.so $srcdir/reloc1lib2.c \ - -L quick1.tree/usr/lib -l1 -$RUN_HOST $CC -shared -O2 -fpic -o quick1.tree/usr/lib/lib3.so $srcdir/quick1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o quick1.tree/usr/lib/lib2.later.so \ - $srcdir/quick1lib2.c -L quick1.tree/usr/lib -l1 -l3 -echo 'int foo;' | $RUN_HOST $CC -shared -O2 -fpic -o quick1.tree/usr/lib/lib4.so -xc - -$RUN_HOST $CC -shared -O2 -fpic -o quick1.tree/usr/lib/lib5.so $srcdir/quick1lib3.c \ - -L quick1.tree/usr/lib -Wl,--rpath-link,quick1.tree/usr/lib -l2 -$RUN_HOST $CC -shared -O2 -fpic -o quick1.tree/usr/lib/lib6.so $srcdir/quick1lib4.c \ - -L quick1.tree/usr/lib -Wl,--rpath-link,quick1.tree/usr/lib -l5 -echo 'int baz;' | $RUN_HOST $CC -shared -O2 -fpic -o quick1.tree/usr/lib/lib7.so -xc - \ - -L quick1.tree/usr/lib -Wl,--rpath-link,quick1.tree/usr/lib -l6 -echo 'int baz;' | $RUN_HOST $CC -shared -O2 -fpic -o quick1.tree/usr/lib/lib7.later.so \ - -xc - -L quick1.tree/usr/lib -Wl,--rpath-link,quick1.tree/usr/lib -l2 -for lib in `cat syslib.list`; do - cp -p $lib.orig quick1.tree/lib/$lib - cp -p $lib.orig quick1.tree/lib/$lib.orig -done -for lib in `cat syslnk.list`; do - cp -dp $lib quick1.tree/lib -done -$RUN_HOST $CCLINK -o quick1.tree/usr/bin/bin1 $srcdir/reloc1.c \ - -Wl,--rpath-link,quick1.tree/usr/lib -L quick1.tree/usr/lib -l2 -lc -l1 -echo 'int main () { extern int foo; return foo; }' \ - | $RUN_HOST $CCLINK -o quick1.tree/usr/bin/bin2 -xc - -xnone \ - -L quick1.tree/usr/lib -l4 -$RUN_HOST $CCLINK -o quick1.tree/usr/bin/bin3 $srcdir/reloc1.c \ - -Wl,--rpath-link,quick1.tree/usr/lib -L quick1.tree/usr/lib -l7 -lc -l2 -l1 -$RUN_HOST $CCLINK -o quick1.tree/usr/bin/bin4 $srcdir/quick1.c \ - -Wl,--rpath-link,quick1.tree/usr/lib -L quick1.tree/usr/lib -l2 -lc -l1 -$RUN_HOST $CCLINK -o quick1.tree/usr/bin/bin5 $srcdir/quick1.c \ - -Wl,--rpath-link,quick1.tree/usr/lib -L quick1.tree/usr/lib -l7 -lc -l2 -l1 -echo 'int main () { return 0; }' \ - | $RUN_HOST $CCLINK -o quick1.tree/usr/bin/bin6 -xc - -xnone \ - -Wl,--rpath-link,quick1.tree/usr/lib -L quick1.tree/usr/lib -l6 -cat > quick1.tree/etc/prelink.conf <<EOF -quick1.tree/usr/bin -quick1.tree/lib -quick1.tree/usr/lib -EOF -LIBS="quick1.tree/usr/lib/lib1.so quick1.tree/usr/lib/lib2.so" -LIBS="$LIBS quick1.tree/usr/lib/lib3.so quick1.tree/usr/lib/lib4.so" -LIBS="$LIBS quick1.tree/usr/lib/lib5.so quick1.tree/usr/lib/lib6.so" -LIBS="$LIBS quick1.tree/usr/lib/lib7.so" -LIBS="$LIBS `sed 's|^|quick1.tree/lib/|' syslib.list`" -BINS="quick1.tree/usr/bin/bin1 quick1.tree/usr/bin/bin2" -BINS="$BINS quick1.tree/usr/bin/bin3 quick1.tree/usr/bin/bin4" -BINS="$BINS quick1.tree/usr/bin/bin5 quick1.tree/usr/bin/bin6" -savelibs -chmod 644 `ls $BINS | sed 's|$|.orig|'` -# Make sure prelinked binaries and libraries will have different ctimes -# than mtimes -sleep 3s -# lib2.later.so needs different timestamps than lib2.so for the tests below -touch quick1.tree/usr/lib/lib2.later.so -cp -p quick1.tree/usr/lib/lib2.later.so{,.orig} -# lib7.later.so needs different timestamps than lib7.so for the tests below -touch quick1.tree/usr/lib/lib7.later.so -cp -p quick1.tree/usr/lib/lib7.later.so{,.orig} -echo $PRELINK ${PRELINK_OPTS--vm} -avvvvv > quick1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -avvvvv > quick1.tree/etc/log1 2>&1 || exit 1 -cat quick1.tree/etc/log1 >> quick1.log -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick1.tree/etc/log2 2>&1 || exit 2 -cat quick1.tree/etc/log2 >> quick1.log -stat quick1.tree/usr/lib/lib2.so >> quick1.log -echo chmod 644 quick1.tree/usr/lib/lib2.so >> quick1.log -chmod 644 quick1.tree/usr/lib/lib2.so -sleep 3s -echo chmod 755 quick1.tree/usr/lib/lib2.so >> quick1.log -chmod 755 quick1.tree/usr/lib/lib2.so -stat quick1.tree/usr/lib/lib2.so >> quick1.log -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick1.tree/etc/log3 2>&1 || exit 3 -cat quick1.tree/etc/log3 >> quick1.log -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick1.tree/etc/log4 2>&1 || exit 4 -cat quick1.tree/etc/log4 >> quick1.log -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin1 || exit 5 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin2 || exit 6 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin3 || exit 7 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin4 || exit 8 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin5 || exit 9 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin6 || exit 10 -fi -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin1 >> quick1.log 2>&1 || exit 11 -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin3 >> quick1.log 2>&1 || exit 12 -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin4 >> quick1.log 2>&1 || exit 13 -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin5 >> quick1.log 2>&1 || exit 14 -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin6 >> quick1.log 2>&1 || exit 15 -BINS="quick1.tree/usr/bin/bin1 quick1.tree/usr/bin/bin3" -BINS="$BINS quick1.tree/usr/bin/bin4 quick1.tree/usr/bin/bin5" -BINS="$BINS quick1.tree/usr/bin/bin6" -LIBS="quick1.tree/usr/lib/lib2.so quick1.tree/usr/lib/lib7.so" -comparelibs >> quick1.log 2>&1 || exit 16 -for l in 2 7; do - mv -f quick1.tree/usr/lib/lib$l.so{,.old} - mv -f quick1.tree/usr/lib/lib$l.so{,.old}.orig - cp -p quick1.tree/usr/lib/lib$l{.later,}.so - cp -p quick1.tree/usr/lib/lib$l{.later,}.so.orig -done -for b in 1 3 4 5 6; do - cp -p quick1.tree/usr/bin/bin$b{,.old} - chmod 644 quick1.tree/usr/bin/bin$b.old -done -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick1.tree/etc/log5 2>&1 || exit 17 -cat quick1.tree/etc/log5 >> quick1.log -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin1 || exit 18 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin2 || exit 19 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin3 || exit 20 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin4 || exit 21 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin5 || exit 22 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick1.tree/lib:quick1.tree/usr/lib quick1.tree/usr/bin/bin6 || exit 23 -fi -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin1 >> quick1.log 2>&1 || exit 24 -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin3 >> quick1.log 2>&1 || exit 25 -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin4 >> quick1.log 2>&1 || exit 26 -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin5 >> quick1.log 2>&1 || exit 27 -$RUN_HOST $READELF -a quick1.tree/usr/bin/bin6 >> quick1.log 2>&1 || exit 28 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` quick1.log && exit 29 -L=quick1.tree/usr/lib/lib -L1=${L}1.so; L2=${L}2.so; L3=${L}3.so; L4=${L}4.so -L5=${L}5.so; L6=${L}6.so; L7=${L}7.so -B=quick1.tree/usr/bin/bin -B1=${B}1; B2=${B}2; B3=${B}3; B4=${B}4; B5=${B}5; B6=${B}6 -SL=`grep -f syslib.list quick1.tree/etc/log1 \ - | sed -n '/^Prelinking/s|^.*\(quick1.tree/lib/\)|\1|p'` -CHECKE="$B1 $B2 $B3 $B4 $B5 $B6"; CHECKL="$SL $L1 $L2 $L4 $L5 $L6 $L7" PREL="$CHECKE $CHECKL"; ASSUME="" -check_log quick1.tree/etc/log1 -CHECKE=""; CHECKL=""; PREL=""; ASSUME="$B1 $B2 $B3 $B4 $B5 $B6 $SL $L1 $L2 $L4 $L5 $L6 $L7" -check_log quick1.tree/etc/log2 -CHECKE="$B1 $B3 $B4 $B5 $B6"; CHECKL="$SL $L1 $L2 $L5 $L6 $L7"; PREL=""; ASSUME="$B2 $L4" -check_log quick1.tree/etc/log3 -CHECKE=""; CHECKL=""; PREL=""; ASSUME="$B1 $B2 $B3 $B4 $B5 $B6 $SL $L1 $L2 $L4 $L5 $L6 $L7" -check_log quick1.tree/etc/log4 -CHECKE="$B1 $B3 $B4 $B5 $B6"; CHECKL="$SL $L1 $L2 $L3 $L5 $L7 $L7"; PREL="$B1 $B3 $B4 $B5 $B6 $L2 $L3 $L5 $L6 $L7"; ASSUME="$B2 $L4" -check_log quick1.tree/etc/log5 -BINS="$B1 $B2 $B3 $B4 $B5 $B6" -LIBS="$SL $L1 $L2 $L3 $L4 $L5 $L6 $L7 $L2.old" -comparelibs >> quick1.log 2>&1 || exit 30 -for i in $BINS $SL $L1 $L2 $L3 $L4 $L5 $L6 $L7; do - cp -p $i $i.prelinked -done -for i in $BINS; do - chmod 644 $i.prelinked -done -echo $PRELINK -uavvvvvv >> quick1.log -$RUN_HOST $PRELINK -uavvvvvv >> quick1.log 2>&1 || exit 31 -for i in $BINS $SL $L1 $L2 $L3 $L4 $L5 $L6 $L7; do - cmp -s $i.orig $i || exit 32 - mv -f $i.prelinked $i -done -chmod 755 $BINS -exit 0 diff --git a/trunk/testsuite/quick1lib1.c b/trunk/testsuite/quick1lib1.c deleted file mode 100644 index 41767ce..0000000 --- a/trunk/testsuite/quick1lib1.c +++ /dev/null @@ -1,9 +0,0 @@ -int q1 (void) -{ - return q2 () + 1; -} - -int q2 (void) -{ - return 77; -} diff --git a/trunk/testsuite/quick1lib2.c b/trunk/testsuite/quick1lib2.c deleted file mode 100644 index b545086..0000000 --- a/trunk/testsuite/quick1lib2.c +++ /dev/null @@ -1,11 +0,0 @@ -extern int q1 (void); - -int f1 (void) -{ - return q1 () + 1; -} - -int q2 (void) -{ - return 9; -} diff --git a/trunk/testsuite/quick1lib3.c b/trunk/testsuite/quick1lib3.c deleted file mode 100644 index 06760a3..0000000 --- a/trunk/testsuite/quick1lib3.c +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef D1 -#define D1(n) int qvar##n; int *qpvar##n = &qvar##n; -#endif -#define D2(n) D1(n##0) D1(n##1) D1(n##2) D1(n##3) D1(n##4) -#define D3(n) D2(n##0) D2(n##1) D2(n##2) D2(n##3) D2(n##4) -#define D4(n) D3(n##0) D3(n##1) D3(n##2) D3(n##3) D3(n##4) -D4(0) D4(1) diff --git a/trunk/testsuite/quick1lib4.c b/trunk/testsuite/quick1lib4.c deleted file mode 100644 index 53e23d7..0000000 --- a/trunk/testsuite/quick1lib4.c +++ /dev/null @@ -1,2 +0,0 @@ -#define D1(n) int qvar##n; -#include "quick1lib3.c" diff --git a/trunk/testsuite/quick2.sh b/trunk/testsuite/quick2.sh deleted file mode 100755 index 8ffaf76..0000000 --- a/trunk/testsuite/quick2.sh +++ /dev/null @@ -1,282 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -check_one() { - cnt=0 - log=$1 - echo -n . >> quick2.log - text="$2" - shift 2 - while [ $# -gt 0 ]; do - grep -q "^$text .*$1" $log || exit 40 - cnt=$((++cnt)) - shift - done - [ `grep "^$text " $log | wc -l` = $cnt ] || exit 41 -} -check_log() { - log=$1 - echo -n "Checking $1 " >> quick2.log - check_one $log 'Checking executable' $CHECKE - check_one $log 'Checking shared library' $CHECKL - check_one $log 'Assuming prelinked' $ASSUME - check_one $log 'Prelinking' $PREL - check_one $log 'Assuming non-prelinkable' $UNPREL - echo >> quick2.log -} - -PRELINK=`echo $PRELINK \ - | sed -e 's, \./\(prelink\.\(cache\|conf\)\), quick2.tree/etc/\1,g' \ - -e 's,path=\.,path=quick2.tree/lib:quick2.tree/usr/lib,' \ - -e 's,linker=\./,linker=quick2.tree/lib/,'` -CCLINK=`echo $CCLINK \ - | sed -e 's,linker=\./,linker=quick2.tree/lib/,'` -rm -rf quick2.tree -rm -f quick2.log -mkdir -p quick2.tree/{lib,etc,usr/lib,usr/bin} -$RUN_HOST $CC -shared -O2 -fpic -o quick2.tree/usr/lib/lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o quick2.tree/usr/lib/lib2.so $srcdir/reloc1lib2.c \ - -L quick2.tree/usr/lib -l1 -$RUN_HOST $CC -shared -O2 -fpic -o quick2.tree/usr/lib/lib3.so $srcdir/quick1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o quick2.tree/usr/lib/lib2.later.so \ - $srcdir/quick1lib2.c -L quick2.tree/usr/lib -l1 -l3 -echo 'int foo;' | $RUN_HOST $CC -shared -O2 -fpic -o quick2.tree/usr/lib/lib4.so -xc - -$RUN_HOST $CC -shared -O2 -fpic -o quick2.tree/usr/lib/lib5.so $srcdir/quick1lib3.c \ - -L quick2.tree/usr/lib -Wl,--rpath-link,quick2.tree/usr/lib -l2 -$RUN_HOST $CC -shared -O2 -fpic -o quick2.tree/usr/lib/lib6.so $srcdir/quick1lib4.c \ - -L quick2.tree/usr/lib -Wl,--rpath-link,quick2.tree/usr/lib -l5 -echo 'int baz;' | $RUN_HOST $CC -shared -O2 -fpic -o quick2.tree/usr/lib/lib7.so -xc - \ - -L quick2.tree/usr/lib -Wl,--rpath-link,quick2.tree/usr/lib -l6 \ - -Wl,--spare-dynamic-tags=0 -echo 'int baz;' | $RUN_HOST $CC -shared -O2 -fpic -o quick2.tree/usr/lib/lib7.later.so \ - -xc - -L quick2.tree/usr/lib -Wl,--rpath-link,quick2.tree/usr/lib -l2 -for lib in `cat syslib.list`; do - cp -p $lib.orig quick2.tree/lib/$lib - cp -p $lib.orig quick2.tree/lib/$lib.orig -done -for lib in `cat syslnk.list`; do - cp -dp $lib quick2.tree/lib -done -$RUN_HOST $CCLINK -o quick2.tree/usr/bin/bin1 $srcdir/reloc1.c \ - -Wl,--rpath-link,quick2.tree/usr/lib -L quick2.tree/usr/lib -l2 -lc -l1 -echo 'int main () { extern int foo; return foo; }' \ - | $RUN_HOST $CCLINK -o quick2.tree/usr/bin/bin2 -xc - -xnone \ - -L quick2.tree/usr/lib -l4 -$RUN_HOST $CCLINK -o quick2.tree/usr/bin/bin3 $srcdir/reloc1.c \ - -Wl,--rpath-link,quick2.tree/usr/lib -L quick2.tree/usr/lib -l7 -lc -l2 -l1 -$RUN_HOST $CCLINK -o quick2.tree/usr/bin/bin4 $srcdir/quick1.c \ - -Wl,--rpath-link,quick2.tree/usr/lib -L quick2.tree/usr/lib -l2 -lc -l1 -$RUN_HOST $CCLINK -o quick2.tree/usr/bin/bin5 $srcdir/quick1.c \ - -Wl,--rpath-link,quick2.tree/usr/lib -L quick2.tree/usr/lib -l7 -lc -l2 -l1 -echo 'int main () { return 0; }' \ - | $RUN_HOST $CCLINK -o quick2.tree/usr/bin/bin6 -xc - -xnone \ - -Wl,--rpath-link,quick2.tree/usr/lib -L quick2.tree/usr/lib -l6 -echo 'int main () { return 0; }' \ - | $RUN_HOST $CCLINK -o quick2.tree/usr/bin/bin7 -static -xc - -xnone -cat > quick2.tree/usr/bin/bin8 <<EOF -#!/bin/sh -echo This is a sample shell script -echo used to test whether even shell scripts -echo and other executable non-ELF files -echo are cached as non-prelinkable -echo in /etc/prelink.cache and thus do not -echo need to be reread every time prelink -aq -echo is run. -exit 0 -EOF -chmod 755 quick2.tree/usr/bin/bin8 -cat > quick2.tree/usr/bin/bin9.sh <<EOF -#!/bin/sh -echo This is another sample shell script, -echo this time with a .sh extension. -echo This does not need to be even cached -echo as non-prelinkable, provided -b *.sh -echo is present in prelink.conf. -exit 0 -EOF -chmod 755 quick2.tree/usr/bin/bin9.sh -cat > quick2.tree/usr/bin/bin10.py <<EOF -#! /usr/bin/env python -print "This is a sample python script." -print "This does not need to be even cached" -print "as non-prelinkable, provided -b *.py" -print "is present in prelink.conf." -EOF -chmod 755 quick2.tree/usr/bin/bin10.py -cat > quick2.tree/usr/bin/bin11.script <<EOF -#!/bin/sh -echo This is another sample shell script, -echo this time matching b*11*r[hijk]*t shell pattern. -echo This does not need to be even cached -echo as non-prelinkable, provided -b b*11*r[hijk]*t -echo is present in prelink.conf. -exit 0 -EOF -chmod 755 quick2.tree/usr/bin/bin11.script -echo 'int main () { return 0; }' \ - | $RUN_HOST $CCLINK -o quick2.tree/usr/bin/bin12 -pie -fPIE -xc - -xnone -cat > quick2.tree/etc/prelink.conf <<EOF --b *.sh --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 -EOF -LIBS="quick2.tree/usr/lib/lib1.so quick2.tree/usr/lib/lib2.so" -LIBS="$LIBS quick2.tree/usr/lib/lib3.so quick2.tree/usr/lib/lib4.so" -LIBS="$LIBS quick2.tree/usr/lib/lib5.so quick2.tree/usr/lib/lib6.so" -LIBS="$LIBS quick2.tree/usr/lib/lib7.so" -LIBS="$LIBS `sed 's|^|quick2.tree/lib/|' syslib.list`" -BINS="quick2.tree/usr/bin/bin1 quick2.tree/usr/bin/bin2" -BINS="$BINS quick2.tree/usr/bin/bin3 quick2.tree/usr/bin/bin4" -BINS="$BINS quick2.tree/usr/bin/bin5 quick2.tree/usr/bin/bin6" -BINS="$BINS quick2.tree/usr/bin/bin7 quick2.tree/usr/bin/bin8" -savelibs -chmod 644 `ls $BINS | sed 's|$|.orig|'` -# Make sure prelinked binaries and libraries will have different ctimes -# than mtimes -sleep 3s -# lib2.later.so needs different timestamps than lib2.so for the tests below -touch quick2.tree/usr/lib/lib2.later.so -cp -p quick2.tree/usr/lib/lib2.later.so{,.orig} -# lib7.later.so needs different timestamps than lib7.so for the tests below -touch quick2.tree/usr/lib/lib7.later.so -cp -p quick2.tree/usr/lib/lib7.later.so{,.orig} -echo $PRELINK ${PRELINK_OPTS--vm} -avvvvv > quick2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -avvvvv > quick2.tree/etc/log1 2>&1 || exit 1 -cat quick2.tree/etc/log1 >> quick2.log -grep -q 'lib7.so: Not enough room to add .dynamic entry' \ - quick2.tree/etc/log1 || exit 60 -grep -q 'Could not prelink .*bin3 because its dependency .*lib7.so could not be prelinked' \ - quick2.tree/etc/log1 || exit 61 -grep -q 'Could not prelink .*bin5 because its dependency .*lib7.so could not be prelinked' \ - quick2.tree/etc/log1 || exit 62 -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick2.tree/etc/log2 2>&1 || exit 2 -cat quick2.tree/etc/log2 >> quick2.log -stat quick2.tree/usr/lib/lib2.so >> quick2.log -echo chmod 644 quick2.tree/usr/lib/lib2.so >> quick2.log -chmod 644 quick2.tree/usr/lib/lib2.so -sleep 3s -echo chmod 755 quick2.tree/usr/lib/lib2.so >> quick2.log -chmod 755 quick2.tree/usr/lib/lib2.so -stat quick2.tree/usr/lib/lib2.so >> quick2.log -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick2.tree/etc/log3 2>&1 || exit 3 -cat quick2.tree/etc/log3 >> quick2.log -grep -q 'lib7.so: Not enough room to add .dynamic entry' \ - quick2.tree/etc/log3 || exit 63 -grep -q 'Could not prelink .*bin3 because its dependency .*lib7.so could not be prelinked' \ - quick2.tree/etc/log3 || exit 64 -grep -q 'Could not prelink .*bin5 because its dependency .*lib7.so could not be prelinked' \ - quick2.tree/etc/log3 || exit 65 -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick2.tree/etc/log4 2>&1 || exit 4 -cat quick2.tree/etc/log4 >> quick2.log -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin1 || exit 5 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin2 || exit 6 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin3 || exit 7 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin4 || exit 8 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin5 || exit 9 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin6 || exit 10 -fi -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin1 >> quick2.log 2>&1 || exit 11 -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin3 >> quick2.log 2>&1 || exit 12 -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin4 >> quick2.log 2>&1 || exit 13 -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin5 >> quick2.log 2>&1 || exit 14 -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin6 >> quick2.log 2>&1 || exit 15 -BINS="quick2.tree/usr/bin/bin1 quick2.tree/usr/bin/bin4" -BINS="$BINS quick2.tree/usr/bin/bin6" -LIBS="quick2.tree/usr/lib/lib2.so" -comparelibs >> quick2.log 2>&1 || exit 16 -for l in 2 7; do - mv -f quick2.tree/usr/lib/lib$l.so{,.old} - mv -f quick2.tree/usr/lib/lib$l.so{,.old}.orig - cp -p quick2.tree/usr/lib/lib$l{.later,}.so - cp -p quick2.tree/usr/lib/lib$l{.later,}.so.orig -done -for b in 1 3 4 5 6; do - cp -p quick2.tree/usr/bin/bin$b{,.old} - chmod 644 quick2.tree/usr/bin/bin$b.old -done -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick2.tree/etc/log5 2>&1 || exit 17 -cat quick2.tree/etc/log5 >> quick2.log -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin1 || exit 18 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin2 || exit 19 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin3 || exit 20 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin4 || exit 21 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin5 || exit 22 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=quick2.tree/lib:quick2.tree/usr/lib quick2.tree/usr/bin/bin6 || exit 23 -fi -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin1 >> quick2.log 2>&1 || exit 24 -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin3 >> quick2.log 2>&1 || exit 25 -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin4 >> quick2.log 2>&1 || exit 26 -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin5 >> quick2.log 2>&1 || exit 27 -$RUN_HOST $READELF -a quick2.tree/usr/bin/bin6 >> quick2.log 2>&1 || exit 28 -# In both etc/log1 and etc/log3 there should be one -# "Not enough room" and two "Could not prelink" warnings. -[ $(grep ^`echo $PRELINK | sed 's/ .*$/: /'` quick2.log | wc -l) -eq 6 ] || exit 29 -L=quick2.tree/usr/lib/lib -L1=${L}1.so; L2=${L}2.so; L3=${L}3.so; L4=${L}4.so -L5=${L}5.so; L6=${L}6.so; L7=${L}7.so -B=quick2.tree/usr/bin/bin -B1=${B}1; B2=${B}2; B3=${B}3; B4=${B}4; B5=${B}5 -B6=${B}6; B7=${B}7; B8=${B}8; B12=${B}12 -SL=`grep -f syslib.list quick2.tree/etc/log1 \ - | sed -n '/^Prelinking/s|^.*\(quick2.tree/lib/\)|\1|p'` -CHECK_E="$B1 $B2 $B4 $B6"; CHECKE="$CHECK_E $B3 $B5 $B7" -CHECKL="$SL $L1 $L2 $L4 $L5 $L6 $L7"; PREL="$CHECK_E $CHECKL"; ASSUME=""; UNPREL="" -check_log quick2.tree/etc/log1 -CHECKE=""; CHECKL=""; PREL=""; ASSUME="$B1 $B2 $B4 $B6 $SL $L1 $L2 $L4 $L5 $L6" -UNPREL="$B3 $B5 $B7 $B8 $B12 $L7" -check_log quick2.tree/etc/log2 -CHECKE="$B1 $B3 $B4 $B5 $B6"; CHECKL="$SL $L1 $L2 $L5 $L6 $L7"; PREL="$L7"; ASSUME="$B2 $L4"; UNPREL="$B7 $B8 $B12" -check_log quick2.tree/etc/log3 -CHECKE=""; CHECKL=""; PREL=""; ASSUME="$B1 $B2 $B4 $B6 $SL $L1 $L2 $L4 $L5 $L6"; UNPREL="$B3 $B5 $B7 $B8 $B12 $L7" -check_log quick2.tree/etc/log4 -CHECKE="$B1 $B3 $B4 $B5 $B6"; CHECKL="$SL $L1 $L2 $L3 $L5 $L7 $L7"; PREL="$B1 $B3 $B4 $B5 $B6 $L2 $L3 $L5 $L6 $L7"; ASSUME="$B2 $L4"; UNPREL="$B7 $B8 $B12" -check_log quick2.tree/etc/log5 -BINS="$B1 $B2 $B3 $B4 $B5 $B6" -LIBS="$SL $L1 $L2 $L3 $L4 $L5 $L6 $L7 $L2.old" -comparelibs >> quick2.log 2>&1 || exit 30 -for i in $BINS $SL $L1 $L2 $L3 $L4 $L5 $L6 $L7; do - cp -p $i $i.prelinked -done -for i in $BINS; do - chmod 644 $i.prelinked -done -echo $PRELINK -uavvvvvv >> quick2.log -$RUN_HOST $PRELINK -uavvvvvv >> quick2.log 2>&1 || exit 31 -for i in $BINS $SL $L1 $L2 $L3 $L4 $L5 $L6 $L7; do - cmp -s $i.orig $i || exit 32 - mv -f $i.prelinked $i -done -chmod 755 $BINS -exit 0 diff --git a/trunk/testsuite/quick3.sh b/trunk/testsuite/quick3.sh deleted file mode 100755 index d302748..0000000 --- a/trunk/testsuite/quick3.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -check_one() { - cnt=0 - log=$1 - echo -n . >> quick3.log - text="$2" - shift 2 - while [ $# -gt 0 ]; do - grep -q "^$text .*$1" $log || exit 40 - cnt=$((++cnt)) - shift - done - [ `grep "^$text " $log | wc -l` = $cnt ] || exit 41 -} -check_log() { - log=$1 - echo -n "Checking $1 " >> quick3.log - check_one $log 'Checking executable' $CHECKE - check_one $log 'Checking shared library' $CHECKL - check_one $log 'Assuming prelinked' $ASSUME - check_one $log 'Prelinking' $PREL - echo >> quick3.log -} - -PRELINK=`echo $PRELINK \ - | sed -e 's, \./\(prelink\.\(cache\|conf\)\), quick3.tree/etc/\1,g' \ - -e 's,path=\.,path=quick3.tree/lib:quick3.tree/usr/lib,' \ - -e 's,linker=\./,linker=quick3.tree/lib/,'` -CCLINK=`echo $CCLINK \ - | sed -e 's,linker=\./,linker=quick3.tree/lib/,'` -rm -rf quick3.tree -rm -f quick3.log -mkdir -p quick3.tree/{lib,etc,usr/lib,usr/bin} -$RUN_HOST $CC -shared -O2 -fpic -o quick3.tree/usr/lib/lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o quick3.tree/usr/lib/lib2.so $srcdir/reloc1lib2.c \ - -L quick3.tree/usr/lib -l1 -Wl,-soname,lib2.so -for lib in `cat syslib.list`; do - cp -p $lib.orig quick3.tree/lib/$lib - cp -p $lib.orig quick3.tree/lib/$lib.orig -done -for lib in `cat syslnk.list`; do - cp -dp $lib quick3.tree/lib -done -$RUN_HOST $CCLINK -o quick3.tree/usr/bin/bin1 $srcdir/reloc1.c \ - -Wl,--rpath-link,quick3.tree/usr/lib -L quick3.tree/usr/lib -l2 -lc -l1 -cat > quick3.tree/etc/prelink.conf <<EOF -quick3.tree/usr/bin -quick3.tree/lib -quick3.tree/usr/lib -EOF -LIBS="quick3.tree/usr/lib/lib1.so quick3.tree/usr/lib/lib2.so" -LIBS="$LIBS `sed 's|^|quick3.tree/lib/|' syslib.list`" -BINS="quick3.tree/usr/bin/bin1" -savelibs -chmod 644 `ls $BINS | sed 's|$|.orig|'` -# Make sure prelinked binaries and libraries will have different ctimes -# than mtimes -sleep 3s -echo $PRELINK ${PRELINK_OPTS--vm} -avvvvv > quick3.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -avvvvv > quick3.tree/etc/log1 2>&1 || exit 1 -cat quick3.tree/etc/log1 >> quick3.log -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick3.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick3.tree/etc/log2 2>&1 || exit 2 -cat quick3.tree/etc/log2 >> quick3.log -$RUN_HOST $CC -shared -O2 -fpic -o quick3.tree/usr/lib/lib2.so.0 $srcdir/reloc1lib2.c \ - -L quick3.tree/usr/lib -l1 -Wl,-soname,lib2.so -rm -f quick3.tree/usr/lib/lib2.so{,.orig} -cp -p quick3.tree/usr/lib/lib2.so.0{,.orig} -ln -sf lib2.so.0 quick3.tree/usr/lib/lib2.so -sleep 3s -echo $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv >> quick3.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick3.tree/etc/log3 2>&1 || exit 3 -cat quick3.tree/etc/log3 >> quick3.log -if [ "x$CROSS" = "x" ]; then - $RUN 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 -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} -aqvvvvv > quick3.tree/etc/log4 2>&1 || exit 5 -cat quick3.tree/etc/log4 >> quick3.log -comparelibs >> quick3.log 2>&1 || exit 6 -[ -L quick3.tree/usr/lib/lib2.so ] || exit 7 -L=quick3.tree/usr/lib/lib -L1=${L}1.so; L2=${L}2.so; L3=${L}2.so.0 -B1=quick3.tree/usr/bin/bin1 -SL=`grep -f syslib.list quick3.tree/etc/log1 \ - | sed -n '/^Prelinking/s|^.*\(quick3.tree/lib/\)|\1|p'` -CHECKE="$B1"; CHECKL="$SL $L1 $L2" PREL="$CHECKE $CHECKL"; ASSUME="" -check_log quick3.tree/etc/log1 -CHECKE=""; CHECKL=""; PREL=""; ASSUME="$B1 $L1 $L2 $SL" -check_log quick3.tree/etc/log2 -CHECKE="$B1"; CHECKL="$SL $L1 $L3"; PREL="$B1 $L3"; ASSUME="" -check_log quick3.tree/etc/log3 -CHECKE=""; CHECKL=""; PREL=""; ASSUME="$B1 $L1 $L3 $SL" -check_log quick3.tree/etc/log4 -for i in $B1 $SL $L1 $L3; do - cp -p $i $i.prelinked -done -for i in $B1; do - chmod 644 $i.prelinked -done -echo $PRELINK -uavvvvvv >> quick3.log -$RUN_HOST $PRELINK -uavvvvvv >> quick3.log 2>&1 || exit 31 -for i in $B1 $SL $L1 $L3; do - cmp -s $i.orig $i || exit 32 - mv -f $i.prelinked $i -done -chmod 755 $BINS -exit 0 diff --git a/trunk/testsuite/reloc1.c b/trunk/testsuite/reloc1.c deleted file mode 100644 index e679bed..0000000 --- a/trunk/testsuite/reloc1.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "reloc1.h" -#include <stdlib.h> - -static struct A local = { 77, &local, &bar + 4 }; - -int main() -{ - if (foo.a != 1 || foo.b != &foo || foo.c != &bar || bar != 26) - abort (); - if (f1 () != 11 || f2 () != 12) - abort (); - local.c -= 4; - if (local.a != 77 || local.b != &local || local.c != &bar) - abort (); - exit (0); -} diff --git a/trunk/testsuite/reloc1.h b/trunk/testsuite/reloc1.h deleted file mode 100644 index 093dd3a..0000000 --- a/trunk/testsuite/reloc1.h +++ /dev/null @@ -1,12 +0,0 @@ -struct A - { - char a; - struct A *b; - int *c; - }; - -extern struct A foo; -extern int bar; -extern int f1 (void); -extern int f2 (void); -extern struct A *f3 (void); diff --git a/trunk/testsuite/reloc1.sh b/trunk/testsuite/reloc1.sh deleted file mode 100755 index 06c6aba..0000000 --- a/trunk/testsuite/reloc1.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f reloc1 reloc1lib*.so reloc1.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o reloc1lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o reloc1lib2.so $srcdir/reloc1lib2.c reloc1lib1.so -BINS="reloc1" -LIBS="reloc1lib1.so reloc1lib2.so" -$RUN_HOST $CCLINK -o reloc1 $srcdir/reloc1.c -Wl,--rpath-link,. reloc1lib2.so -lc reloc1lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc1 > reloc1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc1 >> reloc1.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc1.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc1 || exit 3 -fi -$RUN_HOST $READELF -a ./reloc1 >> reloc1.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc1 -comparelibs >> reloc1.log 2>&1 || exit 5 diff --git a/trunk/testsuite/reloc10.c b/trunk/testsuite/reloc10.c deleted file mode 100644 index 5720d33..0000000 --- a/trunk/testsuite/reloc10.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <stdlib.h> - -extern int bar, baz, *barp, *bazp, dummy; -extern int f1 (void), f2 (void), f3 (void), f4 (void); -/* Try to use COPY reloc for bar and get away without COPY - reloc for baz. Similarly for barp and bazp. */ -int *bazp2 = &baz; -int **bazp3 = &bazp; - -int main (void) -{ - if (f1 () != 11 || f2 () != 12 || bar != 36 || *bazp2 != 38) - abort (); - if (f3 () != 14 || f4 () != 16 || *barp != 36 || **bazp3 != 38) - abort (); - if (dummy != 24) - abort (); - exit (0); -} diff --git a/trunk/testsuite/reloc10.sh b/trunk/testsuite/reloc10.sh deleted file mode 100755 index 55181cc..0000000 --- a/trunk/testsuite/reloc10.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f reloc10 reloc10lib*.so reloc10.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o reloc10lib1.so $srcdir/reloc10lib1.c -$RUN_HOST $CC -shared -O2 -nostdlib -fpic -o reloc10lib2.so $srcdir/reloc10lib2.c reloc10lib1.so -$RUN_HOST $CC -shared -O2 -nostdlib -fpic -o reloc10lib3.so $srcdir/reloc10lib3.c reloc10lib1.so -$RUN_HOST $CC -shared -O2 -nostdlib -fpic -o reloc10lib4.so $srcdir/reloc10lib4.c reloc10lib1.so -$RUN_HOST $CC -shared -O2 -fpic -o reloc10lib5.so $srcdir/reloc10lib5.c -Wl,--rpath-link,. \ - reloc10lib2.so reloc10lib3.so reloc10lib4.so -BINS="reloc10" -LIBS="reloc10lib1.so reloc10lib2.so reloc10lib3.so reloc10lib4.so reloc10lib5.so" -$RUN_HOST $CCLINK -o reloc10 $srcdir/reloc10.c -Wl,--rpath-link,. reloc10lib5.so -lc reloc10lib{2,3,4}.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc10 > reloc10.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc10 >> reloc10.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc10.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc10 || exit 3 -fi -$RUN_HOST $READELF -a ./reloc10 >> reloc10.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc10 -comparelibs >> reloc10.log 2>&1 || exit 5 diff --git a/trunk/testsuite/reloc10lib1.c b/trunk/testsuite/reloc10lib1.c deleted file mode 100644 index 2ee06d2..0000000 --- a/trunk/testsuite/reloc10lib1.c +++ /dev/null @@ -1,12 +0,0 @@ -int bar = 26; -int baz = 28; - -int f1 (void) -{ - return 1; -} - -int f2 (void) -{ - return 2; -} diff --git a/trunk/testsuite/reloc10lib2.c b/trunk/testsuite/reloc10lib2.c deleted file mode 100644 index fc327fc..0000000 --- a/trunk/testsuite/reloc10lib2.c +++ /dev/null @@ -1,11 +0,0 @@ -extern int bar, baz, f1 (void), f2 (void); - -int f3 (void) -{ - return f1 () + 3; -} - -int f4 (void) -{ - return f2 () + 4; -} diff --git a/trunk/testsuite/reloc10lib3.c b/trunk/testsuite/reloc10lib3.c deleted file mode 100644 index 2ec80ab..0000000 --- a/trunk/testsuite/reloc10lib3.c +++ /dev/null @@ -1,3 +0,0 @@ -extern int bar, baz, f1 (void), f2 (void); - -int *barp = &bar, *bazp = &baz; diff --git a/trunk/testsuite/reloc10lib4.c b/trunk/testsuite/reloc10lib4.c deleted file mode 100644 index 4376249..0000000 --- a/trunk/testsuite/reloc10lib4.c +++ /dev/null @@ -1 +0,0 @@ -int dummy = 24; diff --git a/trunk/testsuite/reloc10lib5.c b/trunk/testsuite/reloc10lib5.c deleted file mode 100644 index 19fd925..0000000 --- a/trunk/testsuite/reloc10lib5.c +++ /dev/null @@ -1,12 +0,0 @@ -int bar = 36; -int baz = 38; - -int f1 (void) -{ - return 11; -} - -int f2 (void) -{ - return 12; -} diff --git a/trunk/testsuite/reloc11.c b/trunk/testsuite/reloc11.c deleted file mode 100644 index 923aff4..0000000 --- a/trunk/testsuite/reloc11.c +++ /dev/null @@ -1,16 +0,0 @@ -#include <stdlib.h> - -extern int dummy; -extern int var, var2, varp1 (), var2m1 (), bar (); -int *pvar = &var, *pvar2 = &var2; - -int main (void) -{ - if (dummy != 24) - abort (); - if (*pvar != 32 || *pvar2 != 16) - abort (); - if (varp1 () != 33 || var2m1 () != 6 || bar () != 40) - abort (); - exit (0); -} diff --git a/trunk/testsuite/reloc11.sh b/trunk/testsuite/reloc11.sh deleted file mode 100755 index 706fdb4..0000000 --- a/trunk/testsuite/reloc11.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f reloc11 reloc11lib*.so reloc11.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -nostdlib -fpic -o reloc11lib1.so $srcdir/reloc10lib4.c -$RUN_HOST $CC -shared -O2 -nostdlib -fpic -o reloc11lib2.so $srcdir/reloc11lib2.c -$RUN_HOST $CC -shared -O2 -nostdlib -fpic -o reloc11lib3.so $srcdir/reloc11lib3.c reloc11lib2.so -BINS="reloc11" -LIBS="reloc11lib1.so reloc11lib2.so reloc11lib3.so" -$RUN_HOST $CCLINK -o reloc11 $srcdir/reloc11.c -Wl,--rpath-link,. reloc11lib1.so reloc11lib3.so -lc reloc11lib2.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc11 > reloc11.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc11 >> reloc11.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc11.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc11 || exit 3 -fi -$RUN_HOST $READELF -a ./reloc11 >> reloc11.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc11 -comparelibs >> reloc11.log 2>&1 || exit 5 diff --git a/trunk/testsuite/reloc11lib2.c b/trunk/testsuite/reloc11lib2.c deleted file mode 100644 index 6a2191c..0000000 --- a/trunk/testsuite/reloc11lib2.c +++ /dev/null @@ -1,16 +0,0 @@ -int var = 24, var2 = 16; - -int varp1 (void) -{ - return var + 1; -} - -int var2m1 (void) -{ - return var2 - 1; -} - -int bar (void) -{ - return varp1 () + var2m1 () + 1; -} diff --git a/trunk/testsuite/reloc11lib3.c b/trunk/testsuite/reloc11lib3.c deleted file mode 100644 index 0cea7f3..0000000 --- a/trunk/testsuite/reloc11lib3.c +++ /dev/null @@ -1,7 +0,0 @@ -int var = 32; -extern int var2; - -int var2m1 (void) -{ - return var2 - 10; -} diff --git a/trunk/testsuite/reloc1lib1.c b/trunk/testsuite/reloc1lib1.c deleted file mode 100644 index 8aa0628..0000000 --- a/trunk/testsuite/reloc1lib1.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "reloc1.h" - -int bar = 26; -int baz = 28; - -struct A foo = { 1, &foo, &bar }; - -int f1 (void) -{ - return 1; -} - -int f2 (void) -{ - return f1 () + 1; -} diff --git a/trunk/testsuite/reloc1lib2.c b/trunk/testsuite/reloc1lib2.c deleted file mode 100644 index a338c1d..0000000 --- a/trunk/testsuite/reloc1lib2.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "reloc1.h" - -int f1 (void) -{ - return 11; -} diff --git a/trunk/testsuite/reloc2.c b/trunk/testsuite/reloc2.c deleted file mode 100644 index 6c7fed5..0000000 --- a/trunk/testsuite/reloc2.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdlib.h> - -extern int f2 (int add); -extern void * f3 (void); - -int main() -{ - if (f2 (1) != 27 || f2 (0) != 1) - abort (); - if (f3 () != (void *) f3) - abort (); - exit (0); -} diff --git a/trunk/testsuite/reloc2.sh b/trunk/testsuite/reloc2.sh deleted file mode 100755 index b21d535..0000000 --- a/trunk/testsuite/reloc2.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -SHFLAGS= -case "`$RUN uname -m`" in - 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 -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 -$RUN_HOST $CC -shared $SHFLAGS -O2 -o reloc2lib1.so $srcdir/reloc2lib1.c -$RUN_HOST $CC -shared $SHFLAGS -O2 -o reloc2lib2.so $srcdir/reloc2lib2.c \ - reloc2lib1.so 2>/dev/null -BINS="reloc2" -LIBS="reloc2lib1.so reloc2lib2.so" -$RUN_HOST $CCLINK -o reloc2 $srcdir/reloc2.c -Wl,--rpath-link,. reloc2lib2.so -$RUN_HOST $STRIP -R .comment $BINS $LIBS -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc2 > reloc2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc2 >> reloc2.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc2.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc2 || exit 3 -fi -$RUN_HOST $READELF -a ./reloc2 >> reloc2.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc2 -comparelibs >> reloc2.log 2>&1 || exit 5 diff --git a/trunk/testsuite/reloc2lib1.c b/trunk/testsuite/reloc2lib1.c deleted file mode 100644 index 3551704..0000000 --- a/trunk/testsuite/reloc2lib1.c +++ /dev/null @@ -1,4 +0,0 @@ -int f1 (int dummy) -{ - return 1; -} diff --git a/trunk/testsuite/reloc2lib2.c b/trunk/testsuite/reloc2lib2.c deleted file mode 100644 index 094daad..0000000 --- a/trunk/testsuite/reloc2lib2.c +++ /dev/null @@ -1,15 +0,0 @@ -extern int f1 (int dummy); - -int f2 (int add) -{ - if (add) - return f1 (0) + 26; - return f1 (0); -} - -/* Make sure conflict in f3 is not against read-only segment. */ -asm (".section trampoline, \"awx\"; .previous"); -void * __attribute__((section ("trampoline"))) f3 (void) -{ - return (void *) f3; -} diff --git a/trunk/testsuite/reloc3.c b/trunk/testsuite/reloc3.c deleted file mode 100644 index 2f455d7..0000000 --- a/trunk/testsuite/reloc3.c +++ /dev/null @@ -1,29 +0,0 @@ -#include "reloc1.h" -#include <stdlib.h> -#include <stdio.h> - -int i; -int j __attribute__((aligned (32))); -int k[2048]; -int l = 26; - -void f5 (FILE *f) -{ - fprintf (stdout, "OK"); -} - -int main() -{ - struct A *x; - foo.c -= 2; - if (foo.a != 1 || foo.b != &foo || foo.c[0] != 28 || foo.c[1] != 29 - || foo.c[2] != 30) - abort (); - if (f1 () != 11 || f2 () != 12) - abort (); - x = f3 (); - if (x->a != 2 || x->b != x || x->c != foo.c + 1) - abort (); - f5 (stdout); - exit (0); -} diff --git a/trunk/testsuite/reloc3.sh b/trunk/testsuite/reloc3.sh deleted file mode 100755 index 96c2c05..0000000 --- a/trunk/testsuite/reloc3.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f reloc3 reloc3lib*.so reloc3.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o reloc3lib1.so $srcdir/reloc3lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o reloc3lib2.so $srcdir/reloc1lib2.c reloc3lib1.so -BINS="reloc3" -LIBS="reloc3lib1.so reloc3lib2.so" -$RUN_HOST $CCLINK -o reloc3 $srcdir/reloc3.c -Wl,--rpath-link,. reloc3lib2.so -lc reloc3lib1.so -$RUN_HOST $STRIP -g $BINS $LIBS -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc3 > reloc3.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc3 >> reloc3.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc3.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc3 >> reloc3.log || exit 3 -fi -$RUN_HOST $READELF -a ./reloc3 >> reloc3.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc3 -comparelibs >> reloc3.log 2>&1 || exit 5 diff --git a/trunk/testsuite/reloc3lib1.c b/trunk/testsuite/reloc3lib1.c deleted file mode 100644 index fd649c6..0000000 --- a/trunk/testsuite/reloc3lib1.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "reloc1.h" - -int baz[3] = { 28, 29, 30 }; - -struct A foo = { 1, &foo, &baz[2] }; -static struct A xfoo = { 2, &xfoo, &baz[1] }; - -int f1 (void) -{ - return 1; -} - -int f2 (void) -{ - return f1 () + 1; -} - -struct A *f3 (void) -{ - return &xfoo; -} diff --git a/trunk/testsuite/reloc4.c b/trunk/testsuite/reloc4.c deleted file mode 100644 index cb3b17a..0000000 --- a/trunk/testsuite/reloc4.c +++ /dev/null @@ -1,14 +0,0 @@ -#include <stdio.h> - -int main (void) -{ - int i; - - printf ("#include <stdlib.h>\nextern int"); - for (i = 0; i < 255; ++i) - printf (" bar%02x (int),", i); - printf (" barff (int);\nint main (void)\n{\n int x = 0;\n"); - for (i = 0; i < 256; ++i) - printf (" x = bar%02x (x);\n", i); - printf (" if (x != 0x7fff8000) abort ();\n exit (0);\n}\n"); -} diff --git a/trunk/testsuite/reloc4.sh b/trunk/testsuite/reloc4.sh deleted file mode 100755 index 0201205..0000000 --- a/trunk/testsuite/reloc4.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# This test takes a lot of time, so skip it normally -[ -z "$CHECK_ME_HARDER" ] && exit 77 -rm -f reloc4 reloc4lib*.so reloc4.log -rm -f prelink.cache -$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 -./reloc4.tmp > reloc4.tmp.c -case "`$RUN uname -m`" in - mips*) extra=-mxgot ;; - *) extra= ;; -esac -$RUN_HOST $CC -shared -fpic $extra -o reloc4lib1.so reloc4lib1.tmp.c -$RUN_HOST $CC -shared -fpic $extra -o reloc4lib2.so reloc4lib2.tmp.c reloc4lib1.so -$RUN_HOST $CC -shared -fpic $extra -o reloc4lib3.so reloc4lib3.tmp.c reloc4lib2.so -BINS="reloc4" -LIBS="reloc4lib1.so reloc4lib2.so reloc4lib3.so" -$RUN_HOST $CCLINK $extra -o reloc4 reloc4.tmp.c -Wl,--rpath-link,. reloc4lib3.so -lc reloc4lib2.so -savelibs -rm -f reloc4*.tmp reloc4*.tmp.c -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc4 > reloc4.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc4 >> reloc4.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc4.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc4 || exit 3 -fi -$RUN_HOST $READELF -a ./reloc4 >> reloc4.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc4 -comparelibs >> reloc4.log 2>&1 || exit 5 diff --git a/trunk/testsuite/reloc4lib1.c b/trunk/testsuite/reloc4lib1.c deleted file mode 100644 index f1297d8..0000000 --- a/trunk/testsuite/reloc4lib1.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <stdio.h> - -int main (void) -{ - int i; - - for (i = 0; i < 65536; ++i) - printf ("int foo%04x (void) { return %d; }\n", i, (i & 31) == 0 ? 0 : i); -} diff --git a/trunk/testsuite/reloc4lib2.c b/trunk/testsuite/reloc4lib2.c deleted file mode 100644 index 07aa721..0000000 --- a/trunk/testsuite/reloc4lib2.c +++ /dev/null @@ -1,17 +0,0 @@ -#include <stdio.h> - -int main (void) -{ - int i, j; - - for (i = 0; i < 256; ++i) - { - printf ("extern int "); - for (j = 0; j < 255; ++j) - printf ("foo%02x%02x (void), ", i, j); - printf ("foo%02xff (void);\nint bar%02x (int x) { return x", i, i); - for (j = 0; j < 256; ++j) - printf (" + foo%02x%02x ()", i, j); - printf ("; }\n"); - } -} diff --git a/trunk/testsuite/reloc4lib3.c b/trunk/testsuite/reloc4lib3.c deleted file mode 100644 index 1f30817..0000000 --- a/trunk/testsuite/reloc4lib3.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <stdio.h> - -int main (void) -{ - int i; - - for (i = 0; i < 65536; i += 32) - printf ("int foo%04x (void) { return %d; }\n", i, i); -} diff --git a/trunk/testsuite/reloc5.c b/trunk/testsuite/reloc5.c deleted file mode 100644 index 123ad5d..0000000 --- a/trunk/testsuite/reloc5.c +++ /dev/null @@ -1,21 +0,0 @@ -#include <stdio.h> - -int main (void) -{ - int i; - - printf ("#include <stdlib.h>\nextern char testzero[16384];\nextern int"); - for (i = 0; i < 255; ++i) - printf (" bar%02x (int),", i); - printf (" barff (int);\nint main (void)\n{\n int x = 0;\n"); - for (i = 0; i < 256; ++i) - printf (" x = bar%02x (x);\n", i); - printf (" if (x != 0x7fff8000) abort ();\n"); - printf (" for (x = 0; x < 16384; ++x)\n"); - printf (" if (testzero[x]) abort ();\n"); - printf (" exit (0);\n}\n\n"); - printf ("asm (\".section nonalloced,\\\"aw\\\",%%nobits\\n\\t\"\n"); - printf (" \".globl testzero\\n\\t\"\n"); - printf (" \"testzero: .skip 16384\\n\\t\"\n"); - printf (" \".previous\");\n"); -} diff --git a/trunk/testsuite/reloc5.sh b/trunk/testsuite/reloc5.sh deleted file mode 100755 index 0fbf2a8..0000000 --- a/trunk/testsuite/reloc5.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# This test takes a lot of time, so skip it normally -[ -z "$CHECK_ME_HARDER" ] && exit 77 -rm -f reloc5 reloc5.log -rm -f prelink.cache -$HOST_CC -O2 -o reloc5.tmp $srcdir/reloc5.c -./reloc5.tmp > reloc5.tmp.c -BINS="reloc5" -$RUN_HOST $CCLINK -o reloc5 reloc5.tmp.c -Wl,--rpath-link,. reloc4lib3.so -lc reloc4lib2.so -savelibs -rm -f reloc5*.tmp reloc5*.tmp.c -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc5 > reloc5.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc5 >> reloc5.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc5.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc5 || exit 3 -fi -$RUN_HOST $READELF -a ./reloc5 >> reloc5.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc5 -comparelibs >> reloc5.log 2>&1 || exit 5 diff --git a/trunk/testsuite/reloc6.sh b/trunk/testsuite/reloc6.sh deleted file mode 100755 index a660233..0000000 --- a/trunk/testsuite/reloc6.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f reloc6 reloc6lib*.so reloc6.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o reloc6lib1.so $srcdir/reloc3lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o reloc6lib2.so $srcdir/reloc1lib2.c reloc6lib1.so -$RUN_HOST $CCLINK -o reloc6 $srcdir/reloc3.c -Wl,--rpath-link,. reloc6lib2.so -lc reloc6lib1.so -$RUN_HOST $CCLINK -o reloc6.nop $srcdir/reloc3.c -Wl,--rpath-link,. reloc6lib2.so -lc reloc6lib1.so -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc6 > reloc6.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc6 >> reloc6.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc6.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc6 >> reloc6.log || exit 3 -fi -$RUN_HOST $READELF -a ./reloc6 >> reloc6.log 2>&1 || exit 4 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc6.nop >> reloc6.log || exit 5 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. LD_BIND_NOW=1 ./reloc6.nop >> reloc6.log || exit 6 -fi -mv -f reloc6lib2.so reloc6lib2.so.p -$RUN_HOST $CC -shared -O2 -fpic -o reloc6lib2.so $srcdir/reloc1lib2.c reloc6lib1.so -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc6 >> reloc6.log || exit 7 -fi -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc6.nop >> reloc6.log || exit 8 -fi -if [ "x$CROSS" = "x" ]; then - $RUN 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 -chmod -x ./reloc6 ./reloc6.nop diff --git a/trunk/testsuite/reloc7.c b/trunk/testsuite/reloc7.c deleted file mode 100644 index c1f6dc8..0000000 --- a/trunk/testsuite/reloc7.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "reloc1.h" -#include <stdlib.h> -#include <stdio.h> - -int i; -int j __attribute__((aligned (32))); -int k[2048]; -int l = 26; -int m[3] = { 28, 29, 30 }; -extern int baz[3]; - -struct A n __attribute__((section("nsec"))) = { 1, &n, &m[2] }; -static struct A o __attribute__((section("osec"))) = { 2, &o, &baz[1] }; - -void f5 (FILE *f) -{ - fprintf (stdout, "OK"); -} - -int main() -{ - struct A *x; - foo.c -= 2; - if (foo.a != 1 || foo.b != &foo || foo.c[0] != 28 || foo.c[1] != 29 - || foo.c[2] != 30) - abort (); - if (f1 () != 11 || f2 () != 12) - abort (); - x = f3 (); - if (x->a != 2 || x->b != x || x->c != foo.c + 1) - abort (); - if (n.a != 1 || n.b != &n || n.c != m + 2) - abort (); - if (o.a != 2 || o.b != &o || o.c != baz + 1) - abort (); - f5 (stdout); - exit (0); -} diff --git a/trunk/testsuite/reloc7.sh b/trunk/testsuite/reloc7.sh deleted file mode 100755 index a3dcaf6..0000000 --- a/trunk/testsuite/reloc7.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f reloc7 reloc7lib*.so reloc7.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc7lib1.so $srcdir/reloc3lib1.c -$RUN_HOST $CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc7lib2.so $srcdir/reloc1lib2.c reloc7lib1.so -BINS="reloc7" -LIBS="reloc7lib1.so reloc7lib2.so" -$RUN_HOST $CCLINK -o reloc7 -Wl,-z,nocombreloc $srcdir/reloc7.c -Wl,--rpath-link,. reloc7lib2.so -lc reloc7lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc7 > reloc7.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc7 >> reloc7.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc7.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc7 >> reloc7.log || exit 3 -fi -$RUN_HOST $READELF -a ./reloc7 >> reloc7.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc7 -comparelibs >> reloc7.log 2>&1 || exit 5 diff --git a/trunk/testsuite/reloc8.sh b/trunk/testsuite/reloc8.sh deleted file mode 100755 index 46382af..0000000 --- a/trunk/testsuite/reloc8.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# Disable this test under SELinux -if [ "x$CROSS" = "x" ]; then - 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 "`$RUN uname -m`" in - x86_64|s390*|sparc*) if file reloc1lib1.so | grep -q 64-bit; then NOCOPYRELOC=; fi;; -esac -$RUN_HOST $CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc8lib1.so $srcdir/reloc3lib1.c -$RUN_HOST $CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc8lib2.so $srcdir/reloc1lib2.c reloc8lib1.so -BINS="reloc8" -LIBS="reloc8lib1.so reloc8lib2.so" -$RUN_HOST $CCLINK -o reloc8 $NOCOPYRELOC $srcdir/reloc7.c -Wl,--rpath-link,. reloc8lib2.so -lc reloc8lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc8 > reloc8.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc8 >> reloc8.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc8.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc8 >> reloc8.log || exit 3 -fi -$RUN_HOST $READELF -a ./reloc8 >> reloc8.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc8 -comparelibs >> reloc8.log 2>&1 || exit 5 diff --git a/trunk/testsuite/reloc9.sh b/trunk/testsuite/reloc9.sh deleted file mode 100755 index 4350c30..0000000 --- a/trunk/testsuite/reloc9.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# Disable this test under SELinux -if [ "x$CROSS" = "x" ]; then - 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 "`$RUN uname -m`" in - x86_64|s390*|sparc*) if file reloc1lib1.so | grep -q 64-bit; then NOCOPYRELOC=; fi;; -esac -$RUN_HOST $CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc9lib1.so $srcdir/reloc3lib1.c -$RUN_HOST $CC -shared -O2 -Wl,-z,nocombreloc -fpic -o reloc9lib2.so $srcdir/reloc1lib2.c reloc9lib1.so -BINS="reloc9" -LIBS="reloc9lib1.so reloc9lib2.so" -$RUN_HOST $CCLINK -o reloc9 -Wl,-z,nocombreloc $NOCOPYRELOC $srcdir/reloc7.c -Wl,--rpath-link,. reloc9lib2.so -lc reloc9lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./reloc9 > reloc9.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc9 >> reloc9.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc9.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./reloc9 >> reloc9.log || exit 3 -fi -$RUN_HOST $READELF -a ./reloc9 >> reloc9.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./reloc9 -comparelibs >> reloc9.log 2>&1 || exit 5 diff --git a/trunk/testsuite/shuffle1.sh b/trunk/testsuite/shuffle1.sh deleted file mode 100755 index d3d3e18..0000000 --- a/trunk/testsuite/shuffle1.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f shuffle1 shuffle1lib*.so shuffle1.log shuffle1.lds -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o shuffle1lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o shuffle1lib2.so $srcdir/reloc1lib2.c shuffle1lib1.so -BINS="shuffle1" -LIBS="shuffle1lib1.so shuffle1lib2.so" -$RUN_HOST $CCLINK -o shuffle1 $srcdir/reloc1.c -Wl,--rpath-link,. shuffle1lib2.so -lc shuffle1lib1.so \ - -Wl,--verbose 2>&1 | sed -e '/^=========/,/^=========/!d;/^=========/d' \ - -e 's/0x08048000/0x08000000/;s/SIZEOF_HEADERS.*$/& . += 56;/' > shuffle1.lds -$RUN_HOST $CCLINK -o shuffle1 $srcdir/reloc1.c -Wl,--rpath-link,. shuffle1lib2.so -lc shuffle1lib1.so \ - -Wl,-T,shuffle1.lds -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle1 > shuffle1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle1 >> shuffle1.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle1.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle1 || exit 3 -fi -$RUN_HOST $READELF -a ./shuffle1 >> shuffle1.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./shuffle1 -comparelibs >> shuffle1.log 2>&1 || exit 5 diff --git a/trunk/testsuite/shuffle2.c b/trunk/testsuite/shuffle2.c deleted file mode 100644 index 8c06942..0000000 --- a/trunk/testsuite/shuffle2.c +++ /dev/null @@ -1,22 +0,0 @@ -#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"); diff --git a/trunk/testsuite/shuffle2.sh b/trunk/testsuite/shuffle2.sh deleted file mode 100755 index 0ce3758..0000000 --- a/trunk/testsuite/shuffle2.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# Kernels before 2.4.10 are known not to work -if [ "x$CROSS" = "x" ]; then - case "`$RUN uname -r`" in - [01].*|2.[0-3].*|2.4.[0-9]|2.4.[0-9][^0-9]*) exit 77;; - esac -fi -rm -f shuffle2 shuffle2lib*.so shuffle2.log shuffle2.lds -$RUN_HOST $CC -shared -O2 -fpic -o shuffle2lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o shuffle2lib2.so $srcdir/reloc1lib2.c shuffle2lib1.so -BINS="shuffle2" -LIBS="shuffle2lib1.so shuffle2lib2.so" -$RUN_HOST $CCLINK -o shuffle2 $srcdir/shuffle2.c -Wl,--rpath-link,. shuffle2lib2.so -lc shuffle2lib1.so \ - -Wl,--verbose 2>&1 | sed -e '/^=========/,/^=========/!d;/^=========/d' \ - -e 's/0x08048000/0x08000000/;s/SIZEOF_HEADERS.*$/& . += 56;/' > shuffle2.lds -$RUN_HOST $CCLINK -o shuffle2 $srcdir/shuffle2.c -Wl,--rpath-link,. shuffle2lib2.so -lc shuffle2lib1.so \ - -Wl,-T,shuffle2.lds -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle2 > shuffle2.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle2 >> shuffle2.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle2.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle2 || exit 3 -fi -$RUN_HOST $READELF -a ./shuffle2 >> shuffle2.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./shuffle2 -comparelibs >> shuffle2.log 2>&1 || exit 5 diff --git a/trunk/testsuite/shuffle3.sh b/trunk/testsuite/shuffle3.sh deleted file mode 100755 index 985de3a..0000000 --- a/trunk/testsuite/shuffle3.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# Kernels before 2.4.10 are known not to work -if [ "x$CROSS" = "x" ]; then - case "`$RUN uname -r`" in - [01].*|2.[0-3].*|2.4.[0-9]|2.4.[0-9][^0-9]*) exit 77;; - esac -fi -rm -f shuffle3 shuffle3lib*.so shuffle3.log shuffle3.lds -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o shuffle3lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o shuffle3lib2.so $srcdir/reloc1lib2.c shuffle3lib1.so -BINS="shuffle3" -LIBS="shuffle3lib1.so shuffle3lib2.so" -$RUN_HOST $CCLINK -o shuffle3 $srcdir/shuffle2.c -Wl,--rpath-link,. shuffle3lib2.so -lc shuffle3lib1.so \ - -Wl,--verbose 2>&1 | sed -e '/^=========/,/^=========/!d;/^=========/d' \ - -e 's/0x08048000/0x08000000/' > shuffle3.lds -$RUN_HOST $CCLINK -o shuffle3 $srcdir/shuffle2.c -Wl,--rpath-link,. shuffle3lib2.so -lc shuffle3lib1.so \ - -Wl,-T,shuffle3.lds -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle3 > shuffle3.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle3 >> shuffle3.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle3.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle3 || exit 3 -fi -$RUN_HOST $READELF -a ./shuffle3 >> shuffle3.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./shuffle3 -comparelibs >> shuffle3.log 2>&1 || exit 5 diff --git a/trunk/testsuite/shuffle4.sh b/trunk/testsuite/shuffle4.sh deleted file mode 100755 index b9375ee..0000000 --- a/trunk/testsuite/shuffle4.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# Kernels before 2.4.10 are known not to work -if [ "x$CROSS" = "x" ]; then - case "`$RUN uname -r`" in - [01].*|2.[0-3].*|2.4.[0-9]|2.4.[0-9][^0-9]*) exit 77;; - esac -fi -rm -f shuffle4 shuffle4.log -BINS="shuffle4" -$RUN_HOST $CCLINK -o shuffle4 $srcdir/shuffle2.c -Wl,--rpath-link,. shuffle3lib2.so -lc shuffle3lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle4 > shuffle4.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle4 >> shuffle4.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle4.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle4 || exit 3 -fi -$RUN_HOST $READELF -a ./shuffle4 >> shuffle4.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./shuffle4 -comparelibs >> shuffle4.log 2>&1 || exit 5 diff --git a/trunk/testsuite/shuffle5.sh b/trunk/testsuite/shuffle5.sh deleted file mode 100755 index 0c71a19..0000000 --- a/trunk/testsuite/shuffle5.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f shuffle5 shuffle5lib*.so shuffle5.log shuffle5.lds -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o shuffle5lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o shuffle5lib2.so $srcdir/reloc1lib2.c shuffle5lib1.so -BINS="shuffle5" -LIBS="shuffle5lib1.so shuffle5lib2.so" -$RUN_HOST $CCLINK -o shuffle5 $srcdir/reloc1.c -Wl,--rpath-link,. shuffle5lib2.so -lc shuffle5lib1.so \ - -Wl,--verbose 2>&1 | sed -e '/^=========/,/^=========/!d;/^=========/d' \ - -e 's/0x08048000/0x08000000/;s/SIZEOF_HEADERS.*$/& . += 180;/' > shuffle5.lds -$RUN_HOST $CCLINK -o shuffle5 $srcdir/reloc1.c -Wl,--rpath-link,. shuffle5lib2.so -lc shuffle5lib1.so \ - -Wl,-T,shuffle5.lds -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle5 > shuffle5.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle5 >> shuffle5.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle5.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle5 || exit 3 -fi -$RUN_HOST $READELF -a ./shuffle5 >> shuffle5.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./shuffle5 -comparelibs >> shuffle5.log 2>&1 || exit 5 diff --git a/trunk/testsuite/shuffle6.sh b/trunk/testsuite/shuffle6.sh deleted file mode 100755 index 4ce00ee..0000000 --- a/trunk/testsuite/shuffle6.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f shuffle6 shuffle6lib*.so shuffle6.log shuffle6.lds -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o shuffle6lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o shuffle6lib2.so $srcdir/reloc1lib2.c shuffle6lib1.so -BINS="shuffle6" -LIBS="shuffle6lib1.so shuffle6lib2.so" -$RUN_HOST $CCLINK -o shuffle6 $srcdir/reloc1.c -Wl,--rpath-link,. shuffle6lib2.so -lc shuffle6lib1.so \ - -Wl,--verbose 2>&1 | sed -e '/^=========/,/^=========/!d;/^=========/d' \ - -e 's/0x08048000/0x08000000/;s/SIZEOF_HEADERS.*$/& . += 56;/' > shuffle6.lds -$RUN_HOST $CCLINK -o shuffle6 $srcdir/reloc1.c -Wl,--rpath-link,. shuffle6lib2.so -lc shuffle6lib1.so \ - -Wl,-T,shuffle6.lds -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle6 > shuffle6.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle6 >> shuffle6.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle6.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle6 || exit 3 -fi -$RUN_HOST $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 -cp -p shuffle6 shuffle6.first -$RUN_HOST $CC -shared -O2 -fpic -o shuffle6lib1.so $srcdir/shuffle6lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o shuffle6lib2.so $srcdir/shuffle6lib2.c shuffle6lib1.so -for l in shuffle6lib{1,2}.so; do cp -p $l $l.orig; done -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle6 >> shuffle6.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle6 >> shuffle6.log 2>&1 || exit 6 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle6.log && exit 7 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle6 || exit 8 -fi -$RUN_HOST $READELF -a ./shuffle6 >> shuffle6.log 2>&1 || exit 9 -# So that it is not prelinked again -chmod -x ./shuffle6 -comparelibs >> shuffle6.log 2>&1 || exit 10 diff --git a/trunk/testsuite/shuffle6lib1.c b/trunk/testsuite/shuffle6lib1.c deleted file mode 100644 index 8053293..0000000 --- a/trunk/testsuite/shuffle6lib1.c +++ /dev/null @@ -1,20 +0,0 @@ -#include "reloc1.h" - -int bar = 26; -int baz = 28; -#define M(i) int b##i, *pb##i = &b##i; -M(0) M(1) M(2) M(3) M(4) M(5) M(6) M(7) M(8) M(9) -M(10) M(11) M(12) M(13) M(14) M(15) M(16) M(17) M(18) M(19) -#undef M - -struct A foo = { 1, &foo, &bar }; - -int f1 (void) -{ - return 1; -} - -int f2 (void) -{ - return f1 () + 1; -} diff --git a/trunk/testsuite/shuffle6lib2.c b/trunk/testsuite/shuffle6lib2.c deleted file mode 100644 index ed18f6b..0000000 --- a/trunk/testsuite/shuffle6lib2.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "reloc1.h" -#include <stdlib.h> - -#define M(i) int b##i; extern *pb##i; -M(0) M(1) M(2) M(3) M(4) M(5) M(6) M(7) M(8) M(9) -M(10) M(11) M(12) M(13) M(14) M(15) M(16) M(17) M(18) M(19) -#undef M - -int f1 (void) -{ -#define M(i) if (pb##i != &b##i) abort (); -M(0) M(1) M(2) M(3) M(4) M(5) M(6) M(7) M(8) M(9) -M(10) M(11) M(12) M(13) M(14) M(15) M(16) M(17) M(18) M(19) -#undef M - return 11; -} diff --git a/trunk/testsuite/shuffle7.sh b/trunk/testsuite/shuffle7.sh deleted file mode 100755 index e94002d..0000000 --- a/trunk/testsuite/shuffle7.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f shuffle7 shuffle7lib*.so shuffle7.log shuffle7.lds -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o shuffle7lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o shuffle7lib2.so $srcdir/reloc1lib2.c shuffle7lib1.so -BINS="shuffle7" -LIBS="shuffle7lib1.so shuffle7lib2.so" -$RUN_HOST $CCLINK -o shuffle7 $srcdir/reloc1.c -Wl,--rpath-link,. shuffle7lib2.so -lc shuffle7lib1.so \ - -Wl,--verbose 2>&1 | sed -e '/^=========/,/^=========/!d;/^=========/d' \ - -e '/\.hash/a\ - . = . + 0x300;' > shuffle7.lds -$RUN_HOST $CCLINK -o shuffle7 $srcdir/reloc1.c -Wl,--rpath-link,. shuffle7lib2.so -lc shuffle7lib1.so \ - -Wl,-T,shuffle7.lds -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle7 > shuffle7.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle7.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle7 || exit 3 -fi -$RUN_HOST $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 -cp -p shuffle7 shuffle7.first -$RUN_HOST $CC -shared -O2 -fpic -o shuffle7lib1.so $srcdir/shuffle6lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o shuffle7lib2.so $srcdir/shuffle6lib2.c shuffle7lib1.so -for l in shuffle7lib{1,2}.so; do cp -p $l $l.orig; done -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log 2>&1 || exit 6 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle7.log && exit 7 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle7 || exit 8 -fi -$RUN_HOST $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 -cp -p shuffle7 shuffle7.second -for l in shuffle7lib{1,2}.so{,.orig}; do cp -p $l.first $l; done -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle7 >> shuffle7.log 2>&1 || exit 11 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle7.log && exit 12 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle7 || exit 13 -fi -$RUN_HOST $READELF -a ./shuffle7 >> shuffle7.log 2>&1 || exit 14 -comparelibs >> shuffle7.log 2>&1 || exit 15 -cmp -s shuffle7{,.first} || exit 16 -# So that it is not prelinked again -chmod -x ./shuffle7 diff --git a/trunk/testsuite/shuffle8.c b/trunk/testsuite/shuffle8.c deleted file mode 100644 index 4e80184..0000000 --- a/trunk/testsuite/shuffle8.c +++ /dev/null @@ -1,20 +0,0 @@ -#include "reloc1.h" -#include <stdlib.h> - -static struct A local = { 77, &local, &bar + 4 }; -int vbss[16384] __attribute__((aligned (4096))); -int vdata __attribute__((aligned (4096))) = 5; - -asm (".text; .balign 4096; vtext:; .previous"); - -int main() -{ - if (foo.a != 1 || foo.b != &foo || foo.c != &bar || bar != 26) - abort (); - if (f1 () != 11 || f2 () != 12) - abort (); - local.c -= 4; - if (local.a != 77 || local.b != &local || local.c != &bar) - abort (); - exit (vbss[31] + vdata - 5); -} diff --git a/trunk/testsuite/shuffle8.sh b/trunk/testsuite/shuffle8.sh deleted file mode 100755 index da2e499..0000000 --- a/trunk/testsuite/shuffle8.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f shuffle8 shuffle8lib*.so shuffle8.log shuffle8.lds -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o shuffle8lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o shuffle8lib2.so $srcdir/reloc1lib2.c shuffle8lib1.so -BINS="shuffle8" -LIBS="shuffle8lib1.so shuffle8lib2.so" -$RUN_HOST $CCLINK -o shuffle8 $srcdir/shuffle8.c -Wl,--rpath-link,. shuffle8lib2.so -lc shuffle8lib1.so -$RUN_HOST $STRIP -R .comment shuffle8 -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle8 > shuffle8.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle8 >> shuffle8.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle8.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./shuffle8 || exit 3 -fi -$RUN_HOST $READELF -a ./shuffle8 >> shuffle8.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./shuffle8 -comparelibs >> shuffle8.log 2>&1 || exit 5 diff --git a/trunk/testsuite/shuffle9.c b/trunk/testsuite/shuffle9.c deleted file mode 100644 index 201eabc..0000000 --- a/trunk/testsuite/shuffle9.c +++ /dev/null @@ -1,58 +0,0 @@ -#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 deleted file mode 100755 index 6b54646..0000000 --- a/trunk/testsuite/shuffle9.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -# Kernels before 2.4.10 are known not to work -case "`$RUN 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" -$RUN_HOST $CCLINK -o shuffle9 $srcdir/shuffle9.c -Wl,--rpath-link,. shuffle3lib2.so -lc shuffle3lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./shuffle9 > shuffle9.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./shuffle9 >> shuffle9.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` shuffle9.log && exit 2 -$RUN LD_LIBRARY_PATH=. ./shuffle9 || exit 3 -$RUN_HOST $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/tls1.c b/trunk/testsuite/tls1.c deleted file mode 100644 index 08bd26f..0000000 --- a/trunk/testsuite/tls1.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -static __thread int dummy = 12; -__thread struct A local = { 1, 2, 3 }; - -#define CHECK(N, S) \ - p = f##N##a (); \ - if (p->a != S || p->b != S + 1 || p->c != S + 2) \ - abort () - -int main() -{ - struct A *p; - if (local.a != 1 || local.b != 2 || local.c != 3) - abort (); - if (a1.a != 4 || a1.b != 5 || a1.c != 6) - abort (); - if (a2.a != 22 || a2.b != 23 || a2.c != 24) - abort (); - if (a3.a != 10 || a3.b != 11 || a3.c != 12) - abort (); - if (a4.a != 25 || a4.b != 26 || a4.c != 27) - abort (); - check1 (); - check2 (); - if (f1a () != &a1 || f2a () != &a2 || f3a () != &a3 || f4a () != &a4) - abort (); - CHECK (5, 16); - CHECK (6, 19); - if (f7a () != &a2 || f8a () != &a4) - abort (); - CHECK (9, 28); - CHECK (10, 31); - exit (0); -} diff --git a/trunk/testsuite/tls1.h b/trunk/testsuite/tls1.h deleted file mode 100644 index d627340..0000000 --- a/trunk/testsuite/tls1.h +++ /dev/null @@ -1,30 +0,0 @@ -struct A - { - char a; - int b; - long long c; - }; - -extern __thread struct A a1, a2, a3, a4; -extern struct A *f1a (void); -extern struct A *f2a (void); -extern struct A *f3a (void); -extern struct A *f4a (void); -extern struct A *f5a (void); -extern struct A *f6a (void); -extern struct A *f7a (void); -extern struct A *f8a (void); -extern struct A *f9a (void); -extern struct A *f10a (void); -extern int f1b (void); -extern int f2b (void); -extern int f3b (void); -extern int f4b (void); -extern int f5b (void); -extern int f6b (void); -extern int f7b (void); -extern int f8b (void); -extern int f9b (void); -extern int f10b (void); -extern void check1 (void); -extern void check2 (void); diff --git a/trunk/testsuite/tls1.sh b/trunk/testsuite/tls1.sh deleted file mode 100755 index 664a2f5..0000000 --- a/trunk/testsuite/tls1.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -. `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; }' \ - | $RUN_HOST $CCLINK -xc - -o tlstest > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77 -fi -rm -f tls1 tls1lib*.so tls1.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o tls1lib1.so $srcdir/tls1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o tls1lib2.so $srcdir/tls1lib2.c tls1lib1.so -BINS="tls1" -LIBS="tls1lib1.so tls1lib2.so" -$RUN_HOST $CCLINK -o tls1 $srcdir/tls1.c -Wl,--rpath-link,. tls1lib2.so -lc tls1lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./tls1 > tls1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./tls1 >> tls1.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls1.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./tls1 || exit 3 -fi -$RUN_HOST $READELF -a ./tls1 >> tls1.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./tls1 -comparelibs >> tls1.log 2>&1 || exit 5 diff --git a/trunk/testsuite/tls1lib1.c b/trunk/testsuite/tls1lib1.c deleted file mode 100644 index eb0734b..0000000 --- a/trunk/testsuite/tls1lib1.c +++ /dev/null @@ -1,89 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -static __thread int dummy = 12; -__thread struct A a1 = { 4, 5, 6 }; -__thread struct A a2 = { 7, 8, 9 }; -__thread struct A a3 __attribute__((tls_model("initial-exec"))) - = { 10, 11, 12 }; -__thread struct A a4 __attribute__((tls_model("initial-exec"))) - = { 13, 14, 15 }; -static __thread struct A local1 = { 16, 17, 18 }; -static __thread struct A local2 __attribute__((tls_model("initial-exec"))) - = { 19, 20, 21 }; - -void check1 (void) -{ - if (a1.a != 4 || a1.b != 5 || a1.c != 6) - abort (); - if (a2.a != 22 || a2.b != 23 || a2.c != 24) - abort (); - if (a3.a != 10 || a3.b != 11 || a3.c != 12) - abort (); - if (a4.a != 25 || a4.b != 26 || a4.c != 27) - abort (); - if (local1.a != 16 || local1.b != 17 || local1.c != 18) - abort (); - if (local2.a != 19 || local2.b != 20 || local2.c != 21) - abort (); -} - -struct A *f1a (void) -{ - return &a1; -} - -struct A *f2a (void) -{ - return &a2; -} - -struct A *f3a (void) -{ - return &a3; -} - -struct A *f4a (void) -{ - return &a4; -} - -struct A *f5a (void) -{ - return &local1; -} - -struct A *f6a (void) -{ - return &local2; -} - -int f1b (void) -{ - return a1.a; -} - -int f2b (void) -{ - return a2.b; -} - -int f3b (void) -{ - return a3.c; -} - -int f4b (void) -{ - return a4.a; -} - -int f5b (void) -{ - return local1.b; -} - -int f6b (void) -{ - return local2.c; -} diff --git a/trunk/testsuite/tls1lib2.c b/trunk/testsuite/tls1lib2.c deleted file mode 100644 index eee03a9..0000000 --- a/trunk/testsuite/tls1lib2.c +++ /dev/null @@ -1,62 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -static __thread long long dummy = 12; -__thread struct A a2 = { 22, 23, 24 }; -__thread struct A a4 __attribute__((tls_model("initial-exec"))) - = { 25, 26, 27 }; -static __thread struct A local1 = { 28, 29, 30 }; -static __thread struct A local2 __attribute__((tls_model("initial-exec"))) - = { 31, 32, 33 }; - -void check2 (void) -{ - if (a2.a != 22 || a2.b != 23 || a2.c != 24) - abort (); - if (a4.a != 25 || a4.b != 26 || a4.c != 27) - abort (); - if (local1.a != 28 || local1.b != 29 || local1.c != 30) - abort (); - if (local2.a != 31 || local2.b != 32 || local2.c != 33) - abort (); -} - -struct A *f7a (void) -{ - return &a2; -} - -struct A *f8a (void) -{ - return &a4; -} - -struct A *f9a (void) -{ - return &local1; -} - -struct A *f10a (void) -{ - return &local2; -} - -int f7b (void) -{ - return a2.b; -} - -int f8b (void) -{ - return a4.a; -} - -int f9b (void) -{ - return local1.b; -} - -int f10b (void) -{ - return local2.c; -} diff --git a/trunk/testsuite/tls2.c b/trunk/testsuite/tls2.c deleted file mode 100644 index 1246165..0000000 --- a/trunk/testsuite/tls2.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -#define CHECK(N, S) \ - p = f##N##a (); \ - if (p->a != S || p->b != S + 1 || p->c != S + 2) \ - abort () - -int main() -{ - struct A *p; - check1 (); - check2 (); - CHECK (1, 4); - CHECK (2, 22); - CHECK (3, 10); - CHECK (4, 25); - CHECK (5, 16); - CHECK (6, 19); - CHECK (7, 22); - CHECK (8, 25); - CHECK (9, 28); - CHECK (10, 31); - exit (0); -} diff --git a/trunk/testsuite/tls2.sh b/trunk/testsuite/tls2.sh deleted file mode 100755 index 8c21625..0000000 --- a/trunk/testsuite/tls2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -. `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; }' \ - | $RUN_HOST $CCLINK -xc - -o tlstest > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77 -fi -rm -f tls2 tls2lib*.so tls2.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o tls2lib1.so $srcdir/tls2lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o tls2lib2.so $srcdir/tls1lib2.c tls2lib1.so -BINS="tls2" -LIBS="tls2lib1.so tls2lib2.so" -$RUN_HOST $CCLINK -o tls2 $srcdir/tls2.c -Wl,--rpath-link,. tls2lib2.so -lc tls2lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./tls2 > tls2.log -$RUN_HOST $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 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./tls2 || exit 3 -fi -$RUN_HOST $READELF -a ./tls2 >> tls2.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./tls2 -comparelibs >> tls2.log 2>&1 || exit 5 diff --git a/trunk/testsuite/tls2lib1.c b/trunk/testsuite/tls2lib1.c deleted file mode 100644 index 24b7555..0000000 --- a/trunk/testsuite/tls2lib1.c +++ /dev/null @@ -1,87 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -static __thread int dummy = 12; -__thread struct A a1 = { 4, 5, 6 }; -__thread struct A a3 __attribute__((tls_model("initial-exec"))) - = { 10, 11, 12 }; -extern __thread struct A a4 __attribute__((tls_model("initial-exec"))); -static __thread struct A local1 = { 16, 17, 18 }; -static __thread struct A local2 __attribute__((tls_model("initial-exec"))) - = { 19, 20, 21 }; - -void check1 (void) -{ - if (a1.a != 4 || a1.b != 5 || a1.c != 6) - abort (); - if (a2.a != 22 || a2.b != 23 || a2.c != 24) - abort (); - if (a3.a != 10 || a3.b != 11 || a3.c != 12) - abort (); - if (a4.a != 25 || a4.b != 26 || a4.c != 27) - abort (); - if (local1.a != 16 || local1.b != 17 || local1.c != 18) - abort (); - if (local2.a != 19 || local2.b != 20 || local2.c != 21) - abort (); -} - -struct A *f1a (void) -{ - return &a1; -} - -struct A *f2a (void) -{ - return &a2; -} - -struct A *f3a (void) -{ - return &a3; -} - -struct A *f4a (void) -{ - return &a4; -} - -struct A *f5a (void) -{ - return &local1; -} - -struct A *f6a (void) -{ - return &local2; -} - -int f1b (void) -{ - return a1.a; -} - -int f2b (void) -{ - return a2.b; -} - -int f3b (void) -{ - return a3.c; -} - -int f4b (void) -{ - return a4.a; -} - -int f5b (void) -{ - return local1.b; -} - -int f6b (void) -{ - return local2.c; -} diff --git a/trunk/testsuite/tls3.sh b/trunk/testsuite/tls3.sh deleted file mode 100755 index eb6e626..0000000 --- a/trunk/testsuite/tls3.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -. `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; }' \ - | $RUN_HOST $CCLINK -xc - -o tlstest > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77 -fi -SHFLAGS= -case "`$RUN 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 -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 -$RUN_HOST $CC -shared -O2 -fpic -o tls3lib1.so $srcdir/tls1lib1.c -$RUN_HOST $CC -shared -O2 $SHFLAGS -o tls3lib2.so $srcdir/tls3lib2.c \ - tls3lib1.so 2>/dev/null -BINS="tls3" -LIBS="tls3lib1.so tls3lib2.so" -$RUN_HOST $CCLINK -o tls3 $srcdir/tls1.c -Wl,--rpath-link,. tls3lib2.so -lc tls3lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./tls3 > tls3.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./tls3 >> tls3.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls3.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./tls3 || exit 3 -fi -$RUN_HOST $READELF -a ./tls3 >> tls3.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./tls3 -comparelibs >> tls3.log 2>&1 || exit 5 diff --git a/trunk/testsuite/tls3lib2.c b/trunk/testsuite/tls3lib2.c deleted file mode 100644 index ba485d3..0000000 --- a/trunk/testsuite/tls3lib2.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -asm (".section trampoline, \"awx\"; .previous"); - -#if !defined __sparc__ || defined __pic__ || defined __PIC__ -#define ieattr __attribute__((tls_model("initial-exec"))) -#else -#define ieattr -#endif - -static __thread long long dummy = 12; -__thread struct A a2 = { 22, 23, 24 }; -__thread struct A a4 ieattr = { 25, 26, 27 }; -static __thread struct A local1 = { 28, 29, 30 }; -static __thread struct A local2 ieattr = { 31, 32, 33 }; - -void __attribute__((section ("trampoline"))) check2 (void) -{ - if (a2.a != 22 || a2.b != 23 || a2.c != 24) - abort (); - if (a4.a != 25 || a4.b != 26 || a4.c != 27) - abort (); - if (local1.a != 28 || local1.b != 29 || local1.c != 30) - abort (); - if (local2.a != 31 || local2.b != 32 || local2.c != 33) - abort (); -} - -struct A * __attribute__((section ("trampoline"))) f7a (void) -{ - return &a2; -} - -struct A * __attribute__((section ("trampoline"))) f8a (void) -{ - return &a4; -} - -struct A * __attribute__((section ("trampoline"))) f9a (void) -{ - return &local1; -} - -struct A * __attribute__((section ("trampoline"))) f10a (void) -{ - return &local2; -} - -int __attribute__((section ("trampoline"))) f7b (void) -{ - return a2.b; -} - -int __attribute__((section ("trampoline"))) f8b (void) -{ - return a4.a; -} - -int __attribute__((section ("trampoline"))) f9b (void) -{ - return local1.b; -} - -int __attribute__((section ("trampoline"))) f10b (void) -{ - return local2.c; -} diff --git a/trunk/testsuite/tls4.c b/trunk/testsuite/tls4.c deleted file mode 100644 index 0882f07..0000000 --- a/trunk/testsuite/tls4.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -#define CHECK(N, S) \ - p = &a##N; \ - if (p->a != S || p->b != S + 1 || p->c != S + 2) \ - abort () - -int main() -{ - struct A *p; - check1 (); - CHECK (1, 4); - CHECK (2, 7); - exit (0); -} diff --git a/trunk/testsuite/tls4.sh b/trunk/testsuite/tls4.sh deleted file mode 100755 index 889f0cc..0000000 --- a/trunk/testsuite/tls4.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -. `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; }' \ - | $RUN_HOST $CCLINK -xc - -o tlstest > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77 -fi -rm -f tls4 tls4lib*.so tls4.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o tls4lib1.so $srcdir/tls4lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o tls4lib2.so $srcdir/tls4lib2.c \ - tls4lib1.so 2>/dev/null -BINS="tls4" -LIBS="tls4lib1.so tls4lib2.so" -$RUN_HOST $CCLINK -o tls4 $srcdir/tls4.c -Wl,--rpath-link,. tls4lib2.so -lc tls4lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./tls4 > tls4.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./tls4 >> tls4.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls4.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./tls4 || exit 3 -fi -$RUN_HOST $READELF -a ./tls4 >> tls4.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./tls4 -comparelibs >> tls4.log 2>&1 || exit 5 diff --git a/trunk/testsuite/tls4lib1.c b/trunk/testsuite/tls4lib1.c deleted file mode 100644 index a03af0b..0000000 --- a/trunk/testsuite/tls4lib1.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -__thread struct A a1 = { 4, 5, 6 }; -__thread struct A a2 = { 7, 8, 9 }; diff --git a/trunk/testsuite/tls4lib2.c b/trunk/testsuite/tls4lib2.c deleted file mode 100644 index 309504b..0000000 --- a/trunk/testsuite/tls4lib2.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -extern __thread struct A a2 __attribute__((tls_model("initial-exec"))); - -void check1 (void) -{ - if (a1.a != 4 || a1.b != 5 || a1.c != 6) - abort (); - if (a2.a != 7 || a2.b != 8 || a2.c != 9) - abort (); -} diff --git a/trunk/testsuite/tls5.sh b/trunk/testsuite/tls5.sh deleted file mode 100755 index 8c1fac4..0000000 --- a/trunk/testsuite/tls5.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -. `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; }' \ - | $RUN_HOST $CCLINK -xc - -o tlstest > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77 -fi -rm -f tls5 tls5lib*.so tls5.log -rm -f prelink.cache -echo 'int tls5;' | $RUN_HOST $CC -shared -O2 -fpic -xc - -o tls5lib3.so -$RUN_HOST $CC -shared -O2 -fpic -o tls5lib1.so $srcdir/tls5lib1.c tls5lib3.so -$RUN_HOST $CC -shared -O2 -fpic -o tls5lib2.so $srcdir/tls1lib2.c \ - -Wl,--rpath-link,. tls5lib1.so -BINS="tls5" -LIBS="tls5lib1.so tls5lib2.so tls5lib3.so" -$RUN_HOST $CCLINK -o tls5 $srcdir/tls1.c -Wl,--rpath-link,. tls5lib2.so -lc tls5lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./tls5 > tls5.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./tls5 >> tls5.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls5.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./tls5 || exit 3 -fi -$RUN_HOST $PRELINK -u tls5lib3.so || exit 4 -echo $PRELINK ${PRELINK_OPTS--vm} ./tls5 >> tls5.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./tls5 >> tls5.log 2>&1 || exit 5 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls5.log && exit 6 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./tls5 || exit 7 -fi -$RUN_HOST $READELF -a ./tls5 >> tls5.log 2>&1 || exit 8 -# So that it is not prelinked again -chmod -x ./tls5 -comparelibs >> tls5.log 2>&1 || exit 9 diff --git a/trunk/testsuite/tls5lib1.c b/trunk/testsuite/tls5lib1.c deleted file mode 100644 index 9677848..0000000 --- a/trunk/testsuite/tls5lib1.c +++ /dev/null @@ -1,96 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -static __thread int dummy = 12; -__thread struct A a1 = { 4, 5, 6 }; -__thread struct A a2 = { 7, 8, 9 }; -__thread struct A a3 __attribute__((tls_model("initial-exec"))) - = { 10, 11, 12 }; -__thread struct A a4 __attribute__((tls_model("initial-exec"))) - = { 13, 14, 15 }; -static __thread struct A local1 = { 16, 17, 18 }; -static __thread struct A local2 __attribute__((tls_model("initial-exec"))) - = { 19, 20, 21 }; -struct Z { char a; struct Z *b; int *c; }; -int y[2]; -struct Z z[2] = { { 1, &z[1], &y[0] }, { 2, &z[0], &y[1] } }; - -void check1 (void) -{ - if (a1.a != 4 || a1.b != 5 || a1.c != 6) - abort (); - if (a2.a != 22 || a2.b != 23 || a2.c != 24) - abort (); - if (a3.a != 10 || a3.b != 11 || a3.c != 12) - abort (); - if (a4.a != 25 || a4.b != 26 || a4.c != 27) - abort (); - if (local1.a != 16 || local1.b != 17 || local1.c != 18) - abort (); - if (local2.a != 19 || local2.b != 20 || local2.c != 21) - abort (); - if (z[0].a != 1 || z[0].b != &z[1] || z[0].c != &y[0]) - abort (); - if (z[1].a != 2 || z[1].b != &z[0] || z[1].c != &y[1]) - abort (); -} - -struct A *f1a (void) -{ - return &a1; -} - -struct A *f2a (void) -{ - return &a2; -} - -struct A *f3a (void) -{ - return &a3; -} - -struct A *f4a (void) -{ - return &a4; -} - -struct A *f5a (void) -{ - return &local1; -} - -struct A *f6a (void) -{ - return &local2; -} - -int f1b (void) -{ - return a1.a; -} - -int f2b (void) -{ - return a2.b; -} - -int f3b (void) -{ - return a3.c; -} - -int f4b (void) -{ - return a4.a; -} - -int f5b (void) -{ - return local1.b; -} - -int f6b (void) -{ - return local2.c; -} diff --git a/trunk/testsuite/tls6.sh b/trunk/testsuite/tls6.sh deleted file mode 100755 index 54d4666..0000000 --- a/trunk/testsuite/tls6.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -. `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; }' \ - | $RUN_HOST $CCLINK -xc - -o tlstest > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77 -fi -rm -f tls6 tls6lib*.so tls6.log -rm -f prelink.cache -echo 'int tls6;' | $RUN_HOST $CC -shared -O2 -fpic -xc - -o tls6lib3.so -$RUN_HOST $CC -shared -O2 -fpic -o tls6lib1.so $srcdir/tls6lib1.c tls6lib3.so -$RUN_HOST $CC -shared -O2 -fpic -o tls6lib2.so $srcdir/tls1lib2.c \ - -Wl,--rpath-link,. tls6lib1.so -BINS="tls6" -LIBS="tls6lib1.so tls6lib2.so tls6lib3.so" -$RUN_HOST $CCLINK -o tls6 $srcdir/tls2.c -Wl,--rpath-link,. tls6lib2.so -lc tls6lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./tls6 > tls6.log -$RUN_HOST $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 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./tls6 || exit 3 -fi -$RUN_HOST $PRELINK -u tls6lib3.so || exit 4 -echo $PRELINK ${PRELINK_OPTS--vm} ./tls6 >> tls6.log -$RUN_HOST $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 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./tls6 || exit 7 -fi -$RUN_HOST $READELF -a ./tls6 >> tls6.log 2>&1 || exit 8 -# So that it is not prelinked again -chmod -x ./tls6 -comparelibs >> tls6.log 2>&1 || exit 9 diff --git a/trunk/testsuite/tls6lib1.c b/trunk/testsuite/tls6lib1.c deleted file mode 100644 index 5310c06..0000000 --- a/trunk/testsuite/tls6lib1.c +++ /dev/null @@ -1,94 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -static __thread int dummy = 12; -__thread struct A a1 = { 4, 5, 6 }; -__thread struct A a3 __attribute__((tls_model("initial-exec"))) - = { 10, 11, 12 }; -extern __thread struct A a4 __attribute__((tls_model("initial-exec"))); -static __thread struct A local1 = { 16, 17, 18 }; -static __thread struct A local2 __attribute__((tls_model("initial-exec"))) - = { 19, 20, 21 }; -struct Z { char a; struct Z *b; int *c; }; -int y[2]; -struct Z z[2] = { { 1, &z[1], &y[0] }, { 2, &z[0], &y[1] } }; - -void check1 (void) -{ - if (a1.a != 4 || a1.b != 5 || a1.c != 6) - abort (); - if (a2.a != 22 || a2.b != 23 || a2.c != 24) - abort (); - if (a3.a != 10 || a3.b != 11 || a3.c != 12) - abort (); - if (a4.a != 25 || a4.b != 26 || a4.c != 27) - abort (); - if (local1.a != 16 || local1.b != 17 || local1.c != 18) - abort (); - if (local2.a != 19 || local2.b != 20 || local2.c != 21) - abort (); - if (z[0].a != 1 || z[0].b != &z[1] || z[0].c != &y[0]) - abort (); - if (z[1].a != 2 || z[1].b != &z[0] || z[1].c != &y[1]) - abort (); -} - -struct A *f1a (void) -{ - return &a1; -} - -struct A *f2a (void) -{ - return &a2; -} - -struct A *f3a (void) -{ - return &a3; -} - -struct A *f4a (void) -{ - return &a4; -} - -struct A *f5a (void) -{ - return &local1; -} - -struct A *f6a (void) -{ - return &local2; -} - -int f1b (void) -{ - return a1.a; -} - -int f2b (void) -{ - return a2.b; -} - -int f3b (void) -{ - return a3.c; -} - -int f4b (void) -{ - return a4.a; -} - -int f5b (void) -{ - return local1.b; -} - -int f6b (void) -{ - return local2.c; -} diff --git a/trunk/testsuite/tls7.c b/trunk/testsuite/tls7.c deleted file mode 100644 index 4a3db24..0000000 --- a/trunk/testsuite/tls7.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "tls1.h" -#include <stdlib.h> - -static __thread int dummy; -__thread struct A local; - -int main() -{ - exit (dummy + local.a + local.b + local.c); -} diff --git a/trunk/testsuite/tls7.sh b/trunk/testsuite/tls7.sh deleted file mode 100755 index f7e35ff..0000000 --- a/trunk/testsuite/tls7.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -. `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; }' \ - | $RUN_HOST $CCLINK -xc - -o tlstest > /dev/null 2>&1 || exit 77 -if [ "x$CROSS" = "x" ]; then - ( $RUN LD_LIBRARY_PATH=. ./tlstest || { rm -f tlstest; exit 77; } ) 2>/dev/null || exit 77 -fi -rm -f tls7 tls7.log -rm -f prelink.cache -BINS="tls7" -LIBS="" -$RUN_HOST $CCLINK -o tls7 $srcdir/tls7.c -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./tls7 > tls7.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./tls7 >> tls7.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` tls7.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./tls7 || exit 3 -fi -$RUN_HOST $READELF -a ./tls7 >> tls7.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./tls7 -comparelibs >> tls7.log 2>&1 || exit 5 diff --git a/trunk/testsuite/undo1.sh b/trunk/testsuite/undo1.sh deleted file mode 100755 index c349798..0000000 --- a/trunk/testsuite/undo1.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -rm -f undo1 undo1lib*.so undo1.log -rm -f prelink.cache -$RUN_HOST $CC -shared -O2 -fpic -o undo1lib1.so $srcdir/reloc1lib1.c -$RUN_HOST $CC -shared -O2 -fpic -o undo1lib2.so $srcdir/reloc1lib2.c undo1lib1.so -BINS="undo1" -LIBS="undo1lib1.so undo1lib2.so" -$RUN_HOST $CCLINK -o undo1 $srcdir/reloc1.c -Wl,--rpath-link,. undo1lib2.so -lc undo1lib1.so -savelibs -echo $PRELINK ${PRELINK_OPTS--vm} ./undo1 > undo1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./undo1 >> undo1.log 2>&1 || exit 1 -grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` undo1.log && exit 2 -if [ "x$CROSS" = "x" ]; then - $RUN LD_LIBRARY_PATH=. ./undo1 || exit 3 -fi -$RUN_HOST $READELF -a ./undo1 >> undo1.log 2>&1 || exit 4 -# So that it is not prelinked again -chmod -x ./undo1 -echo $PRELINK -uo undo1.undo undo1 >> undo1.log -$RUN_HOST $PRELINK -uo undo1.undo undo1 >> undo1.log 2>&1 || exit 5 -cmp -s undo1.undo undo1.orig >> undo1.log 2>&1 || exit 6 -rm -f undo1.undo -comparelibs >> undo1.log 2>&1 || exit 7 diff --git a/trunk/testsuite/undosyslibs.sh b/trunk/testsuite/undosyslibs.sh deleted file mode 100755 index 1ce136d..0000000 --- a/trunk/testsuite/undosyslibs.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -LIBS=`cat syslib.list` -comparelibs >> undosyslibs.log 2>&1 || exit 1 diff --git a/trunk/testsuite/unprel1.c b/trunk/testsuite/unprel1.c deleted file mode 100644 index 0c8e9f9..0000000 --- a/trunk/testsuite/unprel1.c +++ /dev/null @@ -1,7 +0,0 @@ -extern int bar (); - -int -main () -{ - return bar () - 42; -} diff --git a/trunk/testsuite/unprel1.sh b/trunk/testsuite/unprel1.sh deleted file mode 100755 index 481db12..0000000 --- a/trunk/testsuite/unprel1.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -. `dirname $0`/functions.sh -PRELINK=`echo $PRELINK \ - | sed -e 's, \./\(prelink\.\(cache\|conf\)\), unprel1.tree/etc/\1,g' \ - -e 's,path=\.,path=unprel1.tree/opt:unprel1.tree/lib,' \ - -e 's,linker=\./,linker=unprel1.tree/lib/,'` -CCLINK=`echo $CCLINK \ - | sed -e 's,linker=\./,linker=unprel1.tree/lib/,'` -rm -rf unprel1.tree -rm -f unprel1.log -mkdir -p unprel1.tree/{lib,etc,opt,bin} -$RUN_HOST $CC -shared -O2 -fpic -o unprel1.tree/lib/lib1.so $srcdir/unprel1lib1.c -cp -a unprel1.tree/{lib,opt}/lib1.so -$RUN_HOST $CC -shared -O2 -fpic -o unprel1.tree/lib/lib2.so $srcdir/unprel1lib2.c \ - -L unprel1.tree/lib -l1 -$RUN_HOST $CCLINK -o unprel1.tree/bin/bin1 $srcdir/unprel1.c \ - -Wl,-rpath,unprel1.tree/lib -L unprel1.tree/lib -l2 -cat > unprel1.tree/etc/prelink.conf <<EOF -unprel1.tree/bin -unprel1.tree/lib -EOF -for lib in `cat syslib.list`; do - cp -p $lib.orig unprel1.tree/lib/$lib - cp -p $lib.orig unprel1.tree/lib/$lib.orig -done -for lib in `cat syslnk.list`; do - cp -dp $lib unprel1.tree/lib -done -LIBS="unprel1.tree/lib/lib1.so unprel1.tree/lib/lib2.so" -LIBS="$LIBS unprel1.tree/opt/lib1.so" -BINS="unprel1.tree/bin/bin1" -savelibs -chmod -x unprel1.tree/bin/bin1.orig -echo $PRELINK ${PRELINK_OPTS--vm} unprel1.tree/{bin,lib} > unprel1.log -$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} unprel1.tree/{bin,lib} >> unprel1.log 2>&1 || exit 1 -grep -v 'opt/lib1.so is not present in any config file directories' unprel1.log \ - | grep -v 'lib/lib2.so because its dependency unprel1.tree/opt/lib1.so could not be prelinked' \ - | grep -v 'bin/bin1 because its dependency unprel1.tree/lib/lib2.so could not be prelinked' \ - | grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` && exit 2 -grep -q 'opt/lib1.so is not present in any config file directories' \ - unprel1.log || exit 3 -grep -q 'lib/lib2.so because its dependency unprel1.tree/opt/lib1.so could not be prelinked' \ - unprel1.log || exit 4 -grep -q 'bin/bin1 because its dependency unprel1.tree/lib/lib2.so could not be prelinked' \ - unprel1.log || exit 5 -unprel1.tree/bin/bin1 || exit 6 -# So that it is not prelinked again -chmod -x unprel1.tree/bin/bin1 -LIBS=unprel1.tree/lib/lib1.so -BINS= -comparelibs >> unprel1.log 2>&1 || exit 7 -for i in unprel1.tree/lib/lib2.so unprel1.tree/opt/lib1.so unprel1.tree/bin/bin1; do - cmp -s $i $i.orig || exit 8 -done -exit 0 diff --git a/trunk/testsuite/unprel1lib1.c b/trunk/testsuite/unprel1lib1.c deleted file mode 100644 index 8f85da3..0000000 --- a/trunk/testsuite/unprel1lib1.c +++ /dev/null @@ -1,5 +0,0 @@ -int -baz () -{ - return 42; -} diff --git a/trunk/testsuite/unprel1lib2.c b/trunk/testsuite/unprel1lib2.c deleted file mode 100644 index 4783123..0000000 --- a/trunk/testsuite/unprel1lib2.c +++ /dev/null @@ -1,7 +0,0 @@ -extern int baz (); - -int -bar () -{ - return baz (); -} |