summary refs log tree commit diff
path: root/elf/ldd.bash.in
diff options
context:
space:
mode:
Diffstat (limited to 'elf/ldd.bash.in')
-rw-r--r--elf/ldd.bash.in14
1 files changed, 9 insertions, 5 deletions
diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in
index d4ea3310fd..dd4fc6ab96 100644
--- a/elf/ldd.bash.in
+++ b/elf/ldd.bash.in
@@ -29,7 +29,8 @@ TEXTDOMAIN=libc
 TEXTDOMAINDIR=@TEXTDOMAINDIR@
 
 RTLD=@RTLD@
-RELOCS=
+warn=
+bind_now=
 
 while test $# -gt 0; do
   case "$1" in
@@ -49,12 +50,13 @@ Report bugs using the \`glibcbug' script to <bugs@gnu.ai.mit.edu>."
     exit 0 ;;
   -d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
   --data-rel | --data-relo | --data-reloc | --data-relocs)
-    RELOCS='--data-relocs'
+    warn=yes
     shift ;;
   -r | --f | --fu | --fun | --func | --funct | --functi | --functio | \
   --function | --function- | --function-r | --function-re | --function-rel | \
   --function-relo | --function-reloc | --function-relocs)
-    RELOCS='--function-relocs'
+    warn=yes
+    bind_now=yes
     shift ;;
   --)		# Stop option processing.
     shift; break ;;
@@ -85,7 +87,8 @@ case $# in
     test -x "$file" ||
     echo $"ldd: warning: you do not have execution permission for" "\`$file'"
       if ${RTLD} --verify "$file"; then
-	LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} ${RELOCS} "$file" || exit 1
+	LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now \
+	 exec ${RTLD} ${RELOCS} "$file" || exit 1
       else
 	echo $"	not a dynamic executable"
 	exit 1
@@ -111,7 +114,8 @@ case $# in
       test -x "$file" || echo $"\
 ldd: warning: you do not have execution permission for" "\`$file'"
       if ${RTLD} --verify "$file"; then
-	LD_TRACE_LOADED_OBJECTS=1 ${RTLD} ${RELOCS} "$file" || result=1
+	LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now \
+	 ${RTLD} ${RELOCS} "$file" || result=1
       else
 	echo $"	not a dynamic executable"
 	result=1