summaryrefslogtreecommitdiff
path: root/core/musl/ldd
diff options
context:
space:
mode:
Diffstat (limited to 'core/musl/ldd')
-rw-r--r--core/musl/ldd19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/musl/ldd b/core/musl/ldd
new file mode 100644
index 0000000..f522968
--- /dev/null
+++ b/core/musl/ldd
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+if [ $# -gt 1 ] && [ "$1" = "--" ]; then
+ shift
+elif [ $# -eq 0 ] || [ "${1#-}" != "$1" ]; then
+ echo "Usage: ${0##*/} [--] FILE..." >&2
+ exit 64
+fi
+
+ERRORS=0
+for PROGRAM in "$@"; do
+ LIBRARIES=$(/lib/ld-musl-x86_64.so.1 --list "$PROGRAM")
+ if [ -n "$LIBRARIES" ]; then
+ printf '%s:\n%s\n' "$PROGRAM" "$LIBRARIES"
+ else
+ ERRORS=1
+ fi
+done
+exit $ERRORS