Hacker News new | ask | show | jobs
by p1necone 1399 days ago
I thought "statically linked" just meant that all of the dependency binaries were rolled into the main executable at build time - how could macOS even stop you doing that?

I assume my understanding of static linking is too simplistic though.

2 comments

On some OSes (Linux and macOS for example) a dynamically linked executable specifies the runtime linker as its “interpreter”, and the runtime linker contains the initial entry point that the kernel starts the process’s execution from. A statically linked executable is then one that doesn’t specify any interpreter at all, and which directly receives control from the kernel.

This distinction is related to but not the same as statically or dynamically linking an individual dependency; only if all dependencies are statically linked can an executable then be statically linked.

One dependency would be libc, which is typically how you would call into the OS using system calls. macOS has not typically supported a stable interface for these.