]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Import ldd patch from Ubuntu sources to allow ldd to work with non-executable files.
authorBrooks Moses <bmoses@google.com>
Fri, 12 Sep 2014 17:34:21 +0000 (10:34 -0700)
committerBrooks Moses <bmoses@google.com>
Fri, 12 Sep 2014 17:34:21 +0000 (10:34 -0700)
README.google
elf/ldd.bash.in

index c9c9f962da050f0438db723092a5e485f536b33e..f8224bb4445b2975f3975ebe326fcff412b3100c 100644 (file)
@@ -118,7 +118,7 @@ include/alloca.h
   large stack with only 64kb of remaining space, which the upstream alloca
   heuristic is ill-equipped to deal with.
   Forward-ported from cl/51331379 (from cl/38559-p2).
-  (ppluzhnikov, google-local) 
+  (ppluzhnikov, google-local)
 
 locale/programs/locarchive.c
   Reduce starting table sizes for locale-archive file, since we use only a
@@ -379,3 +379,8 @@ elf/dl-support.c
   For b/15780211, revert local change to csu/elf-init.c and move
   initialization of __google_auxv earlier (in the fully-static link).
   (ppluzhnikov, google-local)
+
+elf/ldd.bash.in
+  Import ldd patches from Ubuntu source package.  This fixes the ability
+  of ldd to trace dependencies in non-executable dynamic libraries.
+  (bmoses, google-local)
index 4ff140d30283b099ec461f0dd3ce6728b121cfbd..5137346640cee855743200d2d1ded91aee20e811 100644 (file)
@@ -150,31 +150,23 @@ for file do
     echo "ldd: ${file}:" $"not regular file" >&2
     result=1
   elif test -r "$file"; then
-    test -x "$file" || echo 'ldd:' $"\
-warning: you do not have execution permission for" "\`$file'" >&2
     RTLD=
     ret=1
     for rtld in ${RTLDLIST}; do
       if test -x $rtld; then
-       verify_out=`${rtld} --verify "$file"`
-       ret=$?
-       case $ret in
-       [02]) RTLD=${rtld}; break;;
-       esac
+       dummy=`$rtld 2>&1` 
+       if test $? = 127; then
+         verify_out=`${rtld} --verify "$file"`
+         ret=$?
+         case $ret in
+         [02]) RTLD=${rtld}; break;;
+         esac
+       fi
       fi
     done
     case $ret in
-    0)
-      # If the program exits with exit code 5, it means the process has been
-      # invoked with __libc_enable_secure.  Fall back to running it through
-      # the dynamic linker.
-      try_trace "$file"
-      rc=$?
-      if [ $rc = 5 ]; then
-       try_trace "$RTLD" "$file"
-       rc=$?
-      fi
-      [ $rc = 0 ] || result=1
+    0|2)
+      try_trace "$RTLD" "$file" || result=1
       ;;
     1)
       # This can be a non-ELF binary or no binary at all.
@@ -183,9 +175,6 @@ warning: you do not have execution permission for" "\`$file'" >&2
        result=1
       }
       ;;
-    2)
-      try_trace "$RTLD" "$file" || result=1
-      ;;
     *)
       echo 'ldd:' ${RTLD} $"exited with unknown exit code" "($ret)" >&2
       exit 1