static binary
also: statically-linked binary, static executable
An executable file that contains all its required library code compiled directly into the binary, rather than depending on external shared libraries at runtime.
A static binary is self-contained—it includes copies of all the functions it needs from system libraries baked into the executable file itself during compilation. This contrasts with dynamic binaries, which link to shared libraries (.so files) loaded when the program runs.
Static binaries are larger in file size because they duplicate library code, but they offer key advantages: they run on any Linux system with the same architecture regardless of which libraries are installed, and they don't break if system libraries are updated or removed.
You can create a static binary by compiling with the -static flag: gcc -static myprogram.c -o myprogram. Static binaries are common in containerized environments (Docker) and embedded systems where portability and isolation matter more than disk space.