blob: 56810bb1de1b8415c5c2bfa791df24413ef77733 [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
Pete Bentley557308c2021-03-02 16:56:39 +000013what=$(LD_LIBRARY_PATH= file -L "$1")
Elliott Hughes3a1936c2019-06-27 13:50:31 -070014case "$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