about summary refs log tree commit diff
path: root/elf/ldd.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'elf/ldd.sh.in')
-rw-r--r--elf/ldd.sh.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/elf/ldd.sh.in b/elf/ldd.sh.in
index 884472f654..a82deb5cb7 100644
--- a/elf/ldd.sh.in
+++ b/elf/ldd.sh.in
@@ -83,6 +83,12 @@ Try \`ldd --help' for more information."
   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
@@ -113,6 +119,7 @@ Try \`ldd --help' for more information."
 	eval $add_env exec '"$file"' || exit 1
 	;;
       1)
+        nonelf $file ||
 	echo '	not a dynamic executable'
 	exit 1
 	;;
@@ -155,6 +162,7 @@ ldd: warning: you do not have execution permission for \`$file'"
 	  eval $add_env '"$file"' || result=1
 	  ;;
 	1)
+          nonelf $file ||
 	  echo '	not a dynamic executable'
 	  result=1
 	  ;;