about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/ldd.sh.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/elf/ldd.sh.in b/elf/ldd.sh.in
index 78fda69d22..ede1b9790b 100644
--- a/elf/ldd.sh.in
+++ b/elf/ldd.sh.in
@@ -17,7 +17,9 @@ case $# in
   /*) file="$1" ;;
   *) file="./$1" ;;
   esac
-  if ${RTLD} --verify "$file"; then
+  if test ! -f "$file"; then
+    echo "$file: no such file"
+  elif ${RTLD} --verify "$file"; then
     LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} "$file" && exit 1
   else
     echo '	not a dynamic executable'
@@ -31,7 +33,9 @@ case $# in
     /*) file="$file" ;;
     *) file="./$file" ;;
     esac
-    if ${RTLD} --verify "$file"; then
+    if test ! -f "$file"; then
+      echo "$file: no such file"
+    elif ${RTLD} --verify "$file"; then
       LD_TRACE_LOADED_OBJECTS=1 ${RTLD} "$file"
     else
       echo '	not a dynamic executable'