xref: /netbsd-src/usr.bin/ldd/ldd.1 (revision 50728e7823a76d5bd1a7bfa3a4eac400269b1339)
1.\"	$NetBSD: ldd.1,v 1.14 2008/04/30 13:11:01 martin Exp $
2.\"
3.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Paul Kranenburg.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd May 23, 2004
31.Dt LDD 1
32.Os
33.Sh NAME
34.Nm ldd
35.Nd list dynamic object dependencies
36.Sh SYNOPSIS
37.Nm
38.Op Fl f Ar format
39.Ar program ...
40.Sh DESCRIPTION
41.Nm
42displays all shared objects that are needed to run the given program.
43Contrary to
44.Xr nm 1 ,
45the list includes
46.Dq indirect
47dependencies that are the result of needed shared objects which themselves
48depend on yet other shared objects.
49Zero, one or two
50.Fl f
51options may be given. The argument is a format string passed to
52.Xr rtld 1
53and allows customization of
54.Nm ldd Ns 's
55output.
56The first format argument is used for library objects and is equivalent
57to the
58.Xr ld.aout_so 1
59environment variable
60.Ev LD_TRACE_LOADED_OBJECTS_FMT1 .
61It defaults to
62.Qq "\et-l%o.%m =\*[Gt] %p\en"
63for elf and
64.Qq "\et-l%o.%m =\*[Gt] %p (%x)\en"
65for a.out.
66The second format argument is used for non-library objects and it is equivalent
67to the
68.Xr ld.aout_so 1
69environment variable
70.Ev LD_TRACE_LOADED_OBJECTS_FMT2 .
71It defaults to
72.Qq "\et%o =\*[Gt] %p\en"
73for elf and
74.Qq "\et%o (%x)\en"
75for a.out.
76.Pp
77These arguments are interpreted as format strings a la
78.Xr printf 3
79to customize the trace output and allow
80.Nm
81to be operated as a filter more conveniently.
82The following conversions can be used:
83.Bl -tag -width xxxx
84.It \&%a
85The main program's name
86.Po also known as
87.Dq __progname
88.Pc .
89.It \&%A
90The value of the environment variable
91.Ev LD_TRACE_LOADED_OBJECTS_PROGNAME
92in a.out and the program name from the argument vector from elf.
93.It \&%o
94The library name.
95.It \&%m
96The library's major version number.
97.It \&%n
98The library's minor version number (a.out only, ignored in elf).
99.It \&%p
100The full pathname as determined by
101.Nm rtld Ns 's
102library search rules.
103.It \&%x
104The library's load address
105.El
106.Pp
107Additionally,
108.Sy \en
109and
110.Sy \et
111are recognized and have their usual meaning.
112.Sh SEE ALSO
113.Xr ld 1 ,
114.Xr ld.aout_so 1 ,
115.Xr ld.elf_so 1 ,
116.Xr nm 1 ,
117.Xr rtld 1
118.Sh HISTORY
119A
120.Nm
121utility first appeared in SunOS 4.0, it appeared in its current form
122in
123.Nx 0.9a .
124.Sh BUGS
125The
126a.out
127.Nm
128actually runs the program it has been requested to analyze which in specially
129constructed environments can have security implications.
130