Question Details

No question body available.

Tags

c macos dynamic-linking dlopen

Answers (1)

Accepted Answer Available
Accepted Answer
June 22, 2026 Score: 6 Rep: 204,843 Quality: High Completeness: 40%

Even though the files don't actually exist, the runtime linker still seems to be able to handle them. The following works as expected on macOS Tahoe 26.5.1:

#include 

int main() { void handle = dlopen("/usr/lib/libSystem.B.dylib", RTLD_NOW);

void
(printf_)(); (void)(&printf) = dlsym(handle, "printf");

printf
("hello world\n"); return 0; }