otool
otool
is a command line utility that can dump an object.
It’s often useful to know if a dynamic library has a particular function or functions related to some feature.
On MacOS
Display names and versions of shared libraries that the object file uses. The object can be a dynamic library or executable.
$ otool -L /usr/lib/libcrypto.44.dylib
/usr/lib/libcrypto.44.dylib:
/usr/lib/libcrypto.44.dylib (compatibility version 45.0.0, current version 45.1.0)
/System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent (compatibility version 1.0.0, current version 33.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
$ otool -L /usr/local/bin/hugo
/usr/local/bin/hugo:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 59306.101.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0)
You can also check if a (dynamic) library provides a symbol.
-- Display symbols
otool -tv /usr/lib/libcrypto.44.dylib
-- Check if EVP_DigestSign is included in the library
otool -tv /usr/lib/libcrypto.44.dylib | grep EVP_DigestSign