summaryrefslogtreecommitdiff
path: root/linker/ldd.sh
blob: 56810bb1de1b8415c5c2bfa791df24413ef77733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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