Shared libraries

The first thing you'll need to do is to ensure that the shared objects required by the various drivers you'll be running are present.

All drivers require at least the standard C library shared object ( Since the shared object search order looks in /proc/boot, you don't have to do anything special, except include the shared library into the image. This is done by simply specifying the name of the shared library on a line by itself, meaning "include this file."

Note: The runtime linker is expected to be found in a file called, but the runtime linker is currently contained within the file, so we would make a process manager symbolic link to it.

The following buildfile snippet applies:

# include the C shared library
# create a symlink called to it
[type=link] /usr/lib/

There are several ways to determine the shared objects to include in your system image.

On the target system, you can use the ldd ("list dynamic dependencies") utility or the DL_DEBUG environment variable.

The ldd ("list dynamic dependencies") utility lists the shared objects that the program you specify requires. For example:
# ldd `which ping`
/usr/bin/ping: => /lib/ (0xb8200000) => /usr/lib/ (0xb0300000)

The DL_DEBUG environment variable causes the shared library loader to display debugging information about the libraries as they're opened. For example:

# export DL_DEBUG=libs
# ping
load_object: attempt load of
load_elf32: loaded lib at addr b8200000(text) b822bccc(data)
load_object: attempt load of
dlopen: Library cannot be found
load_object: attempt load of
dlopen: Library cannot be found

For more information about the values for DL_DEBUG, see dlopen() in the QNX Neutrino C Library Reference.

On the host, you can use the objdump utility, which displays information about the executables you're including in the image; look for the objects marked as NEEDED. For example:

# ntox86_64-objdump -x x86_64/usr/bin/ping | grep NEEDED

The ping executable needs and You then need to use objdump recursively to see what these shared objects need:

# ntox86_64-objdump -x x86_64/lib/ | grep NEEDED
$ ntox86_64-objdump -x x86_64/lib/ | grep NEEDED

The shared object needs only and needs nothing.