6

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 Answers1

3

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:

0 _
  • 9,294
  • 10
  • 71
  • 105