]> sourceware.org Git - glibc.git/blame - elf/ldd.sh.in
* elf/Makefile (install-others): Add missing slash.
[glibc.git] / elf / ldd.sh.in
CommitLineData
b122c703
RM
1#! /bin/sh
2
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 giving it the special `--list'
6# switch.
7
8RTLD=@RTLD@
9
10case $# in
110)
12 echo >&2 "Usage: $0 FILE..."
13 exit 1 ;;
141)
15 # We don't list the file name when there is only one.
d17e960c
RM
16 case "$1" in
17 /*) file="$1" ;;
18 *) file="./$1" ;;
19 esac
20 exec ${RTLD} --list "$file" && exit 1
b122c703
RM
21 exit ;;
22*)
23 set -e # Bail out immediately if ${RTLD} loses on any argument.
24 for file; do
25 echo "${file}:"
d17e960c
RM
26 case "$file" in
27 /*) file="$file" ;;
28 *) file="./$file" ;;
29 esac
b122c703
RM
30 ${RTLD} --list "$file"
31 done
32esac
33
34exit 0
This page took 0.032427 seconds and 5 git commands to generate.