]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/ldd/ldd.1
pfsync: Correctly check if bpf peers are present
[FreeBSD/FreeBSD.git] / usr.bin / ldd / ldd.1
1 .\"
2 .Dd March 21, 2023
3 .Dt LDD 1
4 .Os
5 .Sh NAME
6 .Nm ldd
7 .Nd list dynamic object dependencies
8 .Sh SYNOPSIS
9 .Nm
10 .Op Fl a
11 .Op Fl f Ar format Op Fl f Ar format
12 .Ar program ...
13 .Sh DESCRIPTION
14 The
15 .Nm
16 utility displays all shared objects that are needed to run the given program or
17 to load the given shared object.
18 Contrary to
19 .Xr nm 1 ,
20 the list includes
21 .Dq indirect
22 dependencies that are the result of needed shared objects which themselves
23 depend on yet other shared objects.
24 .Pp
25 Zero, one or two
26 .Fl f
27 options may be given.
28 The argument is a format string passed to
29 .Xr rtld 1
30 and allows customization of
31 .Nm Ns 's
32 output.
33 If one is given, it sets
34 .Ev LD_TRACE_LOADED_OBJECTS_FMT1 .
35 If two are given, they set
36 .Ev LD_TRACE_LOADED_OBJECTS_FMT1
37 and
38 .Ev LD_TRACE_LOADED_OBJECTS_FMT2 ,
39 respectively.
40 See
41 .Xr rtld 1
42 for details, including a list of recognized conversion characters.
43 .Pp
44 The
45 .Fl a
46 option displays the list of all objects that are needed by each loaded
47 object.
48 .Sh IMPLEMENTATION NOTES
49 .Nm
50 lists the dependencies of an executable by setting
51 .Xr rtld 1
52 environment variables and running the executable in a child process.
53 If the executable is corrupt or invalid,
54 .Nm
55 may therefore fail without providing any diagnostic error messages.
56 .Sh EXAMPLES
57 The following is an example of a shell pipeline which uses the
58 .Fl f
59 option.
60 It will print a report of all ELF binaries in the current directory,
61 which link against the old libc.so.6:
62 .Dl "find . -type f | xargs file -F ' ' | grep 'ELF.*dynamically' | cut -f1 -d' ' | xargs ldd -f '%A %o\en' | grep -F libc.so.6"
63 .Sh SEE ALSO
64 .Xr ld 1 ,
65 .Xr nm 1 ,
66 .Xr readelf 1 ,
67 .Xr rtld 1
68 .Sh HISTORY
69 A
70 .Nm
71 utility first appeared in SunOS 4.0, it appeared in its current form in
72 .Fx 1.1 .