Linux¶
Find a library on the system¶
There seems to be multiple ways to do this, and sometimes one command works over another, not sure why.
$ ldconfig -p | grep "name-of-lib"
$ dpkg -L "name-of-lib"
Requires installing apt-file
$ apt-file search "name-of-lib
ldd - print shared object dependencies. Very useful for debugging missing shared libraries.
$ ldd $(which curl)
Can also try grep with ls -R
$ ls -R | grep file
Then there is find
$ find . -name "*sql*"
Building on linux¶
Inspecting broken builds¶
List all the shared object libraries that libx depends on
ldd libx.so
List the symbols in a library, along with their status (found, undefined etc.)
nm libx.so
Use the -D option to inspect dynamic symbols only
nm libx.so
Pipe output of nm into grep to search for specific function
nm libx.so | grep somefunction
You can examine the Rpath on Linux thus:
readelf -d libsemsim.so