3 ms·
It probably has to do with heritage, but coming from a DOS/Windows background it feels like many things on *nix systems, including executable formats, are rathe
by userbinator 12y ago
It probably has to do with heritage, but coming from a DOS/Windows background it feels like many things on *nix systems, including executable formats, are rather more complex than they really need to be; ELF is no exception to this, and the linker/compiler defaults tend to create far more sections than necessary.
But interestingly enough, the smallest (known) Win32 executable is actually still more than double the size of that Linux one:
http://www.phreedom.org/research/tinype/ http://www.phreedom.org/research/tinype/
...and both of them don't do much more than exit with a defined value. I think for simplicity, nothing beats the DOS COM format - pure code, up to 64k, loaded in a single segment at offset 100h, entry point is right at the beginning. A "Hello world" is on the order of 20 bytes. (Of which 7 bytes are actual code and the rest is the message.)
The sub-1k categories at Pouet (http://www.pouet.net/prodlist.php?type%5B0%5D=32b&type%5B1%5D=64b&type%5B2%5D=128b&type%5B3%5D=256b&page=2 http://www.pouet.net/prodlist.php?type%5B0%5D=32b&type%5B1%5... ) are some of the more amusing things possible in a tiny executable.