Elliott Hughes | 90f96b9 | 2019-05-09 15:56:39 -0700 | [diff] [blame] | 1 | #!/system/bin/sh |
| 2 | |
| 3 | # Rather than have ldd and ldd64, this script does the right thing depending |
| 4 | # on the argument. |
| 5 | |
| 6 | function error() { |
| 7 | echo "$1" |
| 8 | exit 1 |
| 9 | } |
| 10 | |
| 11 | [ $# -eq 1 ] || error "usage: ldd FILE" |
| 12 | |
Pete Bentley | 557308c | 2021-03-02 16:56:39 +0000 | [diff] [blame^] | 13 | what=$(LD_LIBRARY_PATH= file -L "$1") |
Elliott Hughes | 3a1936c | 2019-06-27 13:50:31 -0700 | [diff] [blame] | 14 | case "$what" in |
Elliott Hughes | 90f96b9 | 2019-05-09 15:56:39 -0700 | [diff] [blame] | 15 | *32-bit*) |
| 16 | linker --list "$1" |
| 17 | ;; |
| 18 | *64-bit*) |
| 19 | linker64 --list "$1" |
| 20 | ;; |
| 21 | *) |
Elliott Hughes | 3a1936c | 2019-06-27 13:50:31 -0700 | [diff] [blame] | 22 | error "$what" |
Elliott Hughes | 90f96b9 | 2019-05-09 15:56:39 -0700 | [diff] [blame] | 23 | ;; |
| 24 | esac |