summaryrefslogtreecommitdiff
path: root/verify-so.sh
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-12-27 16:46:08 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2016-12-27 16:46:08 +0900
commitdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch)
treee5435159cd1bf0519276363a6fe1663d1721bed3 /verify-so.sh
parent4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff)
downloadcoreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'verify-so.sh')
-rwxr-xr-xverify-so.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/verify-so.sh b/verify-so.sh
new file mode 100755
index 0000000000..3907cf1db0
--- /dev/null
+++ b/verify-so.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# $1 contains full path to the .so to verify
+# $2 contains message to print when the verification fails
+
+OSName=$(uname -s)
+case $OSName in
+ Linux)
+ source /etc/os-release
+ # TODO: add support for verification on Alpine Linux
+ if [ "$ID" != "alpine" ]; then
+ ldd -r $1 | awk 'BEGIN {count=0} /undefined symbol:/ { if (count==0) {print "Undefined symbol(s) found:"} print " " $3; count++ } END {if (count>0) exit(1)}'
+ if [ $? != 0 ]; then
+ echo "$2"
+ exit 1
+ fi
+ fi
+ ;;
+esac
+
+# TODO: add support for verification on non-Linux Unixes (except of OSX)