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 (libc.so). 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."
The following buildfile snippet applies:
# include the C shared library libc.so # create a symlink called ldqnx.so.2 to it [type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
How do you determine which shared objects you need in the image? There are several ways:
# ldd `which ping` /usr/bin/ping: libsocket.so.3 => /lib/libsocket.so.3 (0xb8200000) libc.so.3 => /usr/lib/ldqnx.so.2 (0xb0300000)
# objdump -x `which ping` | grep NEEDED NEEDED libsocket.so.3 NEEDED libc.so.3
The ping executable needs libsocket.so.3 and libc.so.3. You need to use objdump recursively to see what these shared objects need:
# objdump -x /lib/libsocket.so.3 | grep NEEDED NEEDED libc.so.3 # objdump -x /lib/libc.so.3 | grep NEEDED
The libsocket.so.3 shared object needs only libc.so.3, which, in turn, needs nothing.
# export DL_DEBUG=libs # ping 10.42.110.235 load_object: attempt load of libsocket.so.3 load_elf32: loaded lib at addr b8200000(text) b822bccc(data) dlopen("nss_files.so.0",513) load_object: attempt load of nss_files.so.0 dlopen: Library cannot be found dlopen("nss_dns.so.0",513) load_object: attempt load of nss_dns.so.0 dlopen: Library cannot be found
For more information about the values for DL_DEBUG, see the entry for dlopen() in the QNX Neutrino C Library Reference.