List the shared objects that a program requires (Unix)


ldd program ...

Runs on:

QNX Neutrino




The ldd ("list dynamic dependencies") command lists the shared objects that the specified programs require. If you don't specify the full path for a program, ldd looks for it in your current directory.

You can use this utility to determine which shared objects to include in an OS image; see the Sample Buildfiles appendix in Building Embedded Systems.

Note: It's worth noting that ldd is also the name of the runtime linker. In the .interp section, it's called ldqnx.so, and it's in libc, which is why you need to create a symbolic link like this:
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so

in your mkifs buildfiles.


$ ldd `which ksh`
        libc.so.3 => /usr/lib/ldqnx.so.2 (0xb0300000)
$ ldd `which gdb`
        libsocket.so.2 => /lib/libsocket.so.2 (0xb8200000)
        libm.so.2 => /lib/libm.so.2 (0xb822f000)
        libc.so.3 => /usr/lib/ldqnx.so.2 (0xb0300000)

Environment variables:

If this environment variable is set, the shared library loader displays debugging information about the libraries as they're opened.