From 7a11603dc6bde67066ce6f8d4c5f6b86bebaf3c1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 18 Sep 2004 06:46:52 +0000 Subject: Update. 2004-09-17 Ulrich Drepper * 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. --- elf/ldd.bash.in | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'elf/ldd.bash.in') 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: ." @@ -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" -- cgit v1.2.3