InFeeo
Language

The Smallest C++ Binary(youtube.com)

×
Link preview CppCon 2018: Matt Godbolt “The Bits Between the Bits: How We Get to main()” http://CppCon.org—Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2018—When you run yo... YouTube · youtube.com
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.

Comments

Log in Log in to comment.

No comments yet.