Size Is Everything: Making Tiny ELF Binaries
Milk Toast writes "According to this article one can start with a simple program consisting of 3998 bytes and reduce it down to a mere 45 bytes. Now if they could only reduce the size of my Office install." It involves digging into assembly, naturally, but it's interesting to see the extra code generated not only by the compiler, but by the other steps along the way.
In fact, I first heard about it here...
I believe posters are recognized by their sig. So I made one.
Man, I've been reading Slashdot way too long.
(It's still a good article though. Worth rereading if you're at all interested in how ELF binaries work.)
That wastes a byte for a newline! Try:
./tiny; echo $?
cowgod@kraken:~$ echo -n "exit 42" > tiny
cowgod@kraken:~$ chmod a+x tiny
cowgod@kraken:~$
42
cowgod@kraken:~$ wc -c tiny
7 tiny