The smallest C binary
I thought of a cute problem: what is the smallest (size) ./a.out binary I can create? Here are some rules the program should follow: ./a.out must run successfully. $? must deterministically be 0. The binary must be produced by GCC only; no post-processing with objcopy, hex editors, or manual patching. We begin with the simplest program possible: // compiled with gcc empty.c int main() { return 0; } This gives us a file size of 15816 bytes (from stat). Not too shabby, but we will need four of the RAM used in the Apollo guidance computer to fit our binary that does nothing.
weineng ยท weineng