| 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 | |||||
| 13 | case `file -L "$1"` in | ||||
| 14 | *32-bit*) | ||||
| 15 | linker --list "$1" | ||||
| 16 | ;; | ||||
| 17 | *64-bit*) | ||||
| 18 | linker64 --list "$1" | ||||
| 19 | ;; | ||||
| 20 | *) | ||||
| 21 | error "$1: not an ELF file" | ||||
| 22 | ;; | ||||
| 23 | esac | ||||