Whereas Linux uses the ELF as the format for applications, dynamic libraries and so on, macOS uses Mach-O.

mldr is responsible for loading Mach-O binaries by loading the application's binary and then loading dyld and handing over control to it.

An additional trick is then needed to load ELF libraries into such processes.


Dyld is Apple's dynamic linker. It examines what libraries are needed by the macOS application, loads them and performs other necessary tasks. After it is done, it jumps to application's entry point.

Dyld is special in the sense that as the only "executable" on macOS, it does not (cannot) link to any libraries. As a consequence of this, it has to be statically linked to a subset of libSystem (counterpart of glibc on Linux).