summaryrefslogtreecommitdiffstats
path: root/trunk/testsuite/movelibs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/testsuite/movelibs.sh')
-rwxr-xr-xtrunk/testsuite/movelibs.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/trunk/testsuite/movelibs.sh b/trunk/testsuite/movelibs.sh
new file mode 100755
index 0000000..010e0e7
--- /dev/null
+++ b/trunk/testsuite/movelibs.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+. `dirname $0`/functions.sh
+# This script copies needed C and C++ libraries into the test directory
+echo 'int main() { }' > movelibs.C
+$CXX -o movelibs movelibs.C
+> syslib.list
+> syslnk.list
+for i in `RTLD_TRACE_PRELINKING=1 LD_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 readelf -WS $i 2>/dev/null | grep -q .gnu.prelink_undo; then
+ $PRELINK -u $i > /dev/null 2>&1 || exit 1
+ fi
+ cp -p $i $i.orig
+done
+exit 77