How do I find out what DLLs an executable depends on?
On systems with the GNU development toolchain (gcc
&c) I use ldd
for that, but what about the clang
systems, like, e.g., Mac OS X (which does not have ldd
)?
ldd uses ld to load executable files, and recursively loads dynamically-linked libraries. So using ldd requires being on the target system (e.g., Linux). Thus, ldd cannot be used for ELF files on macOS.
On Mac OS there is no ldd and people recommend using otool -L , but that shows which shared libraries are expected, not weather or not they are there.
llvm-readelf ---needed-libs
is the clang analogue of ldd. Here's is the official documentation
~/weechat $ llvm-readelf --needed-libs bin/weechat
NeededLibraries [
libc.so
libcurl.so
libdl.so
libgcrypt.so
libgnutls.so
libgpg-error.so
libiconv.so
libm.so
libncursesw.so.6
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With