aboutsummaryrefslogtreecommitdiff
path: root/linker/ldd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'linker/ldd.sh')
-rwxr-xr-xlinker/ldd.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/linker/ldd.sh b/linker/ldd.sh
new file mode 100755
index 000000000..56810bb1d
--- /dev/null
+++ b/linker/ldd.sh
@@ -0,0 +1,24 @@
+#!/system/bin/sh
+
+# Rather than have ldd and ldd64, this script does the right thing depending
+# on the argument.
+
+function error() {
+ echo "$1"
+ exit 1
+}
+
+[ $# -eq 1 ] || error "usage: ldd FILE"
+
+what=$(LD_LIBRARY_PATH= file -L "$1")
+case "$what" in
+ *32-bit*)
+ linker --list "$1"
+ ;;
+ *64-bit*)
+ linker64 --list "$1"
+ ;;
+ *)
+ error "$what"
+ ;;
+esac