Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

ldd -r equivalent on macOS

Writer Matthew Martinez

I am trying to make my software available on macOS and in my toolchain I use ldd -r MyModel.so to verify is everything went well but I can't really find anything conclusive on macOS that would have the same behaviour.

otool or nm seems the two directions to go but I am not sure how to be sure what options would behave the same. Or is there another tool ?

1 Answer

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.

Assuming that the question is about analyzing Mach-O files on macOS, I do not know of any tool that works for Mach-O files as ldd does for ELF files. Both otool and nm perform a static analysis.

A possibility is:

otool -L /usr/bin/true

Relevant:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy