about summary refs log tree commit diff
path: root/elf/ldd.bash.in
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-18 06:46:52 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-18 06:46:52 +0000
commit7a11603dc6bde67066ce6f8d4c5f6b86bebaf3c1 (patch)
tree310fc0913c5e35b0a6e05bfab4423e38012e6ecf /elf/ldd.bash.in
parentf04b1e1f0f86cce932ede5b5a088c0ec4712ce34 (diff)
downloadglibc-7a11603dc6bde67066ce6f8d4c5f6b86bebaf3c1.tar.gz
glibc-7a11603dc6bde67066ce6f8d4c5f6b86bebaf3c1.tar.xz
glibc-7a11603dc6bde67066ce6f8d4c5f6b86bebaf3c1.zip
Update.
2004-09-17  Ulrich Drepper  <drepper@redhat.com>

	* include/link.h (struct link_map): Add l_used element.
	* sysdeps/generic/ldsodefs.h: Define DL_DEBUG_UNUSED.
	* elf/rtld.c (process_dl_debug): Recognize unused.
	(dl_main): When unused debug flag is set check for unused direct
	dependencies.
	When printing dependencies and SONAME starts with /, omit the SONAME =>
	part.
	* elf/dl-lookup.c (_dl_lookup_symbol_x): Mark object in which the
	symbol has been found as used.
	* elf/ldd.bash.in: Add -u option.
Diffstat (limited to 'elf/ldd.bash.in')
-rw-r--r--elf/ldd.bash.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in
index 8867211109..6ee9b60e51 100644
--- a/elf/ldd.bash.in
+++ b/elf/ldd.bash.in
@@ -50,6 +50,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
       --version           print version information and exit
   -d, --data-relocs       process data relocations
   -r, --function-relocs   process data and function relocations
+  -u, --unused            print unused direct dependencies
   -v, --verbose           print all information
 For bug reporting instructions, please see:
 <http://www.gnu.org/software/libc/bugs.html>."
@@ -71,6 +72,9 @@ For bug reporting instructions, please see:
     verbose=yes
     shift
     ;;
+  -u | --u | --un | --unu | --unus | --unuse | --unused)
+    unused=yes
+    shift
   --v | --ve | --ver)
     echo >&2 $"ldd: option \`$1' is ambiguous"
     exit 1
@@ -97,6 +101,9 @@ nonelf ()
 
 add_env="LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now"
 add_env="$add_env LD_VERBOSE=$verbose"
+if test "$unused" = yes; then
+  add_env="$add_env LD_DEBUG="$LD_DEBUG${LD_DEBUG:+,}unused"
+fi
 case $# in
 0)
   echo >&2 'ldd:' $"missing file arguments"