2011 Update to checklibs Script for dynamic library dependencies
Developer — 5 Mar 2011 09:34 — 439 days ago

Here’s another update of my checklibs script for analyzing dynamic library dependencies of Mach-O binaries. See earlier articles for an introduction.

It’s in fact not an update but a complete rewrite that was needed to handle the complex load path relationships that can be expressed with some of dyld’s newer features such as @rpath. The script should be able to properly display every possible linking combination. If it doesn’t, let me know so I can try to make it smarter.

The main use case is still to catch the unintentional linking against nonstandard frameworks and libraries. Here’s how to use it:

checklibs.py /path/to/Foo.app/Contents/MacOS/Foo

There are some command line options, use the --help option to get a list of them.

Referenced non-embedded frameworks in nonstandard locations are highlighted in blue. Frameworks that are not found on the file system are marked with a red (missing).

checklibs.png

If a framework is embedded and referenced with one of the @ placeholders @executable_path, @loader_path or @rpath, the script shows both the original and the resolved path so you can see how a particular binary was found.

In the case of @rpath, the script also shows which binary supplied the rpath value that was used.

The new version, called checklibs.py, is on github. Feel free to enhance it and send pull requests.


Powered By blojsom