summaryrefslogtreecommitdiffstats
path: root/tests/force-rpath.sh
diff options
context:
space:
mode:
authorThomas Holder <thomas.holder@schrodinger.com>2020-06-03 11:15:33 (GMT)
committerThomas Holder <thomas.holder@schrodinger.com>2020-06-03 11:37:13 (GMT)
commit6e5e98ce774e728290680c46b44da86246f1d167 (patch)
tree0c5caad15b09bc310b0610654927b54f8754e8c3 /tests/force-rpath.sh
parentf3411a986e0d4869786cacc1e018f13d951d22bd (diff)
downloadpatchelf-6e5e98ce774e728290680c46b44da86246f1d167.zip
patchelf-6e5e98ce774e728290680c46b44da86246f1d167.tar.gz
patchelf-6e5e98ce774e728290680c46b44da86246f1d167.tar.bz2
Consistently use --force-rpath (fixes #94)
Diffstat (limited to 'tests/force-rpath.sh')
-rwxr-xr-xtests/force-rpath.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/force-rpath.sh b/tests/force-rpath.sh
new file mode 100755
index 0000000..9256905
--- /dev/null
+++ b/tests/force-rpath.sh
@@ -0,0 +1,39 @@
+#! /bin/sh -e
+SCRATCH=scratch/$(basename $0 .sh)
+
+rm -rf ${SCRATCH}
+mkdir -p ${SCRATCH}
+
+SCRATCHFILE=${SCRATCH}/libfoo.so
+cp libfoo.so $SCRATCHFILE
+
+doit() {
+ echo patchelf $*
+ ../src/patchelf $* $SCRATCHFILE
+}
+
+expect() {
+ out=$(echo $(objdump -x $SCRATCHFILE | grep PATH))
+
+ if [ "$out" != "$*" ]; then
+ echo "Expected '$*' but got '$out'"
+ exit 1
+ fi
+}
+
+doit --remove-rpath
+expect
+doit --set-rpath foo
+expect RUNPATH foo
+doit --force-rpath --set-rpath foo
+expect RPATH foo
+doit --force-rpath --set-rpath bar
+expect RPATH bar
+doit --remove-rpath
+expect
+doit --force-rpath --set-rpath foo
+expect RPATH foo
+doit --set-rpath foo
+expect RUNPATH foo
+doit --set-rpath bar
+expect RUNPATH bar