HP-UX Reference (11i v1 05/09) - 1 User Commands A-M (vol 1)

l
ldd(1) ldd(1)
NLSPATH
Determines the location of message catalogs for the processing of
LC_MESSAGES .
If any internationalization variable contains an invalid setting,
ldd behaves as if all internationalization
variables are set to
C. See environ(5).
RETURN VALUES
ldd returns the following values:
0 Successful completion.
!=0 Failure. A non-zero error code indicates an error has occurred.
DIAGNOSTICS
ldd prints the record of shared library path names to
stdout. The optional list of symbol resolution
problems are printed to
stderr.
EXAMPLES
By default ldd prints a simple dynamic path information. This consists of the dependencies recorded in
the executable (or the shared library) followed by the physical location where these libraries are found.
$ ldd a.out
./libx.sl => ./libx.sl
libc.2 => /lib/pa20_64/libc.2
libdl.1 => /lib/pa20_64/libdl.1
The -v option causes ldd to print dependency relationship along with the dynamic path information.
$ ldd -v a.out
find library=./libx.sl; required by a.out
./libx.sl => ./libx.sl
find library=libc.2; required by a.out
libc.2 => /lib/pa20_64/libc.2
find library=libdl.1; required by /lib/pa20_64/libc.2
libdl.1 => /lib/pa20_64/libdl.1
The -r option causes ldd to analyze all symbol references and print information about unsatisfied code
and data symbols.
$ ldd -r a.out
./libx.sl => ./libx.sl
libc.2 => /lib/pa20_64/libc.2
libdl.1 => /lib/pa20_64/libdl.1
symbol not found: val1 (./libx.sl)
symbol not found: count (./libx.sl)
symbol not found: func1 (./libx.sl)
The -s option causes ldd to print the dynamic search path lists used to load the libraries in the order that
the path lists are referenced:
$ export SHLIB_PATH=/tmp
$ export LD_LIBRARY_PATH=/var/tmp:/var/adm
$ ldd -s a.out
find library=./libx.sl; required by a.out
./libx.sl => ./libx.sl
find library=libc.2; required by a.out
search path=/var/tmp:/var/adm (LD_LIBRARY_PATH)
trying path=/var/tmp/libc.2
trying path=/var/adm/libc.2
search path=/tmp (SHLIB_PATH)
trying path=/tmp/libc.2
search path=/usr/lib/pa20_64:/opt/langtools/lib/pa20_64: (RPATH)
trying path=/usr/lib/pa20_64/libc.2
libc.2 => /usr/lib/pa20_64/libc.2
find library=libdl.1; required by /usr/lib/pa20_64/libc.2
Section 1460 Hewlett-Packard Company 2 HP-UX 11i Version 1: September 2005