summaryrefslogtreecommitdiff
path: root/elf/ldd.bash.in
diff options
context:
space:
mode:
Diffstat (limited to 'elf/ldd.bash.in')
-rw-r--r--elf/ldd.bash.in15
1 files changed, 13 insertions, 2 deletions
diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in
index 54dc837d3e..5d4bb3cccc 100644
--- a/elf/ldd.bash.in
+++ b/elf/ldd.bash.in
@@ -87,6 +87,12 @@ Report bugs using the \`glibcbug' script to <bugs@gnu.org>."
esac
done
+nonelf ()
+{
+ # Maybe extra code for non-ELF binaries.
+ return 1;
+}
+
add_env="LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now"
add_env="$add_env LD_VERBOSE=$verbose"
case $# in
@@ -115,6 +121,8 @@ case $# in
eval $add_env exec '"$file"' || exit 1
;;
1)
+ # This can be a non-ELF binary or no binary at all.
+ nonelf $file ||
echo $" not a dynamic executable"
exit 1
;;
@@ -154,8 +162,11 @@ warning: you do not have execution permission for" "\`$file'"
eval $add_env '"$file"' || result=1
;;
1)
- echo $" not a dynamic executable"
- result=1
+ # This can be a non-ELF binary or no binary at all.
+ nonelf $file || {
+ echo $" not a dynamic executable"
+ result=1
+ }
;;
2)
eval $add_env ${RTLD} '"$file"' || result=1