]>
git.ipfire.org Git - thirdparty/glibc.git/blob - elf/ldd.sh.in
16d3fd8b7948ced4bc245c22e26fbfa74f68cefc
3 # This is the `ldd' command, which lists what shared libraries are
4 # used by given dynamically-linked executables. It works by invoking the
5 # run-time dynamic linker as a command and setting the environment
6 # variable LD_TRACE_LOADED_OBJECTS to a non-empty value.
10 ldd [OPTION]... FILE...
11 --help print this help and exit
12 --version print version information and exit
13 Report bugs to <bug-glibc@prep.ai.mit.edu>."
15 while test $# -gt 0; do
18 echo 'ldd (GNU libc) @VERSION@'; exit 0 ;;
20 echo "$usage"; exit 0 ;;
21 --) # Stop option prcessing
31 ldd: missing file arguments
32 Try \`ldd --help' for more information."
35 # We don't list the file name when there is only one.
40 if test ! -f "$file"; then
41 echo "${file}: no such file"
42 elif ${RTLD} --verify "$file"; then
43 LD_TRACE_LOADED_OBJECTS
=1 exec ${RTLD} "$file" && exit 1
45 echo ' not a dynamic executable'
49 set -e # Bail out immediately if ${RTLD} loses on any argument.
56 if test ! -f "$file"; then
57 echo "$file: no such file"
58 elif ${RTLD} --verify "$file"; then
59 LD_TRACE_LOADED_OBJECTS
=1 ${RTLD} "$file"
61 echo ' not a dynamic executable'