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.in12
1 files changed, 10 insertions, 2 deletions
diff --git a/elf/ldd.sh.in b/elf/ldd.sh.in
index ed43789cfa..82946fd535 100644
--- a/elf/ldd.sh.in
+++ b/elf/ldd.sh.in
@@ -17,7 +17,11 @@ case $# in
   /*) file="$1" ;;
   *) file="./$1" ;;
   esac
-  exec ${RTLD} --list "$file" && exit 1
+  if ${RTLD} --verify "$file"; then
+    LD_TRACE_LOADED_OBJECTS=1 exec "$file" && exit 1
+  else
+    echo '	not a dynamic executable'
+  fi
   exit ;;
 *)
   set -e	# Bail out immediately if ${RTLD} loses on any argument.
@@ -27,7 +31,11 @@ case $# in
     /*) file="$file" ;;
     *) file="./$file" ;;
     esac
-    ${RTLD} --list "$file"
+    if ${RTLD} --verify "$file"; then
+      LD_TRACE_LOADED_OBJECTS=1 "$file"
+    else
+      echo '	not a dynamic executable'
+    fi
   done
 esac