ldd: slightly improve error message.
Before:
$ ldd toybox
toybox: not an ELF file
After
$ ldd toybox
toybox: cannot open
I've also sent a toybox patch upstream to make that:
$ ldd toybox
toybox: cannot open: No such file or directory
Test: manual
Change-Id: If961cdf6f2f2f8d4f6cdfcade9061e49a09d1f01
diff --git a/linker/ldd b/linker/ldd
index 3a0aff9..6bc49b4 100644
--- a/linker/ldd
+++ b/linker/ldd
@@ -10,7 +10,8 @@
[ $# -eq 1 ] || error "usage: ldd FILE"
-case `file -L "$1"` in
+what=$(file -L "$1")
+case "$what" in
*32-bit*)
linker --list "$1"
;;
@@ -18,6 +19,6 @@
linker64 --list "$1"
;;
*)
- error "$1: not an ELF file"
+ error "$what"
;;
esac