blob: 6bc49b4b1a0ec8948717d09f2ee39da6bb4c5bba [file] [log] [blame]
Elliott Hughes90f96b92019-05-09 15:56:39 -07001#!/system/bin/sh
2
3# Rather than have ldd and ldd64, this script does the right thing depending
4# on the argument.
5
6function error() {
7 echo "$1"
8 exit 1
9}
10
11[ $# -eq 1 ] || error "usage: ldd FILE"
12
Elliott Hughes3a1936c2019-06-27 13:50:31 -070013what=$(file -L "$1")
14case "$what" in
Elliott Hughes90f96b92019-05-09 15:56:39 -070015 *32-bit*)
16 linker --list "$1"
17 ;;
18 *64-bit*)
19 linker64 --list "$1"
20 ;;
21 *)
Elliott Hughes3a1936c2019-06-27 13:50:31 -070022 error "$what"
Elliott Hughes90f96b92019-05-09 15:56:39 -070023 ;;
24esac