next up previous
Next: Environmental awareness Up: Analyzing dependencies Previous: Analyzing dependencies

How sowhat works

Sowhat is currently written to analyze a Solaris 2.x environment. In this environment, the dynamic linker utilizes hard-coded library paths encoded into the executable program, as well as search requests that tell to scan a library path for a library matching a given name pattern and version. This scan checks all directories listed in the environment variable LD_LIBRARY_PATH. The function of is mimiced by the diagnostic program ldd, which reports the full pathnames of libraries that will satisfy each search request when is invoked prior to program execution.

To function properly, sowhat has to intimately understand the possible responses of the ldd command. The command ldd lists dynamic dependencies of executable files or shared objects. For example, for the executable file /local/bin/g++, ldd lists the path names of all shared objects that will be loaded whenever /local/bin/g++ is loaded, e.g.: =>  /usr/lib/ => /usr/lib/
These records are relative; g++ asks for the first version of the library in the current library path matching the pattern This matches /usr/lib/

The output of ldd can look quite different for vendor-supplied software. Consider the output of ldd for the tnshut command supplied with Sun's TotalNet software: =>    /usr/lib/ =>/usr/lib/ =>   /usr/lib/ =>  /usr/lib/ =>     /usr/lib/ =>    /usr/lib/
The last library has an absolute binding. It must exist in exactly that place in the filesystem or the program will not function. In this case there is a good reason for the absolute binding as the existence of the library in question is dependent upon the sub-architecture of the particular machine. If it is not present, the system in question has the wrong architecture to run the software!

In order to find failures, sowhat must also understand the meaning of the various and sundry error messages provided by ldd. These include:

No match to library pattern: => (file not found)
Correct version not found: (SUNW_1.1) => (version not found)
In both cases, sowhat will record the actual library name as NotHere. If you then ask sowhat to list the programs that use the library NotHere, it will list all programs that cannot run due to missing libraries.

next up previous
Next: Environmental awareness Up: Analyzing dependencies Previous: Analyzing dependencies
Alva L. Couch