blob: 483825bfdd5ab2a09af2eee4d695afb19caf6cc8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
.\" $FreeBSD$
.\"
.Dd May 15, 2008
.Dt LDD 1
.Os
.Sh NAME
.Nm ldd
.Nd list dynamic object dependencies
.Sh SYNOPSIS
.Nm
.Op Fl a
.Op Fl v
.Op Fl f Ar format
.Ar program ...
.Sh DESCRIPTION
The
.Nm
utility displays all shared objects that are needed to run the given program or
to load the given shared object.
Contrary to
.Xr nm 1 ,
the list includes
.Dq indirect
dependencies that are the result of needed shared objects which themselves
depend on yet other shared objects.
.Pp
Zero, one or two
.Fl f
options may be given.
The argument is a format string passed to
.Xr rtld 1
and allows customization of
.Nm Ns 's
output.
If one is given, it sets
.Ev LD_TRACE_LOADED_OBJECTS_FMT1 .
If two are given, they set
.Ev LD_TRACE_LOADED_OBJECTS_FMT1
and
.Ev LD_TRACE_LOADED_OBJECTS_FMT2 ,
respectively.
See
.Xr rtld 1
for details, including a list of recognized conversion characters.
.Pp
The
.Fl a
option displays the list of all objects that are needed by each loaded
object.
This option does not work with
.Xr a.out 5
binaries.
.Pp
The
.Fl v
option displays a verbose listing of the dynamic linking headers
encoded in the executable.
See the source code and include
files for the definitive meaning of all the fields.
.Sh EXAMPLES
The following is an example of a shell pipeline which uses the
.Fl f
option.
It will print a report of all ELF binaries in the current directory,
which link against libc.so.6:
.Dl "find . -type f | xargs -n1 file -F ' ' | grep ELF | cut -f1 -d' ' | xargs ldd -f '%A %o\en' | grep libc.so.6"
.Sh SEE ALSO
.Xr ld 1 ,
.Xr nm 1 ,
.Xr rtld 1
.Sh HISTORY
A
.Nm
utility first appeared in SunOS 4.0, it appeared in its current form in
.Fx 1.1 .
.Pp
The
.Fl v
support is based on code written by
.An John Polstra Aq Mt jdp@polstra.com
|