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