about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile2
-rw-r--r--elf/ldd.sh.in10
2 files changed, 10 insertions, 2 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 45c2cfe854..21d2fc5fd5 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -37,7 +37,7 @@ include ../Makeconfig
 
 ifeq (yes,$(build-shared))
 extra-objs	= $(rtld-routines:=.so) soinit.so sofini.so
-install-others	= $(libdir)$(rtld-installed-name)
+install-others	= $(libdir)/$(rtld-installed-name)
 install-bin	= ldd
 endif
 
diff --git a/elf/ldd.sh.in b/elf/ldd.sh.in
index 58ae501e53..ed43789cfa 100644
--- a/elf/ldd.sh.in
+++ b/elf/ldd.sh.in
@@ -13,12 +13,20 @@ case $# in
   exit 1 ;;
 1)
   # We don't list the file name when there is only one.
-  exec ${RTLD} --list "$1" && exit 1
+  case "$1" in
+  /*) file="$1" ;;
+  *) file="./$1" ;;
+  esac
+  exec ${RTLD} --list "$file" && exit 1
   exit ;;
 *)
   set -e	# Bail out immediately if ${RTLD} loses on any argument.
   for file; do
     echo "${file}:"
+    case "$file" in
+    /*) file="$file" ;;
+    *) file="./$file" ;;
+    esac
     ${RTLD} --list "$file"
   done
 esac