5 ms·
Creating Really Teensy ELF Executables for Linux
- jcr 12y agoThis article is surprisingly better (and longer ;) than I expected, but it skipped over explaining one important distinction; "ELF" is an executable file format, but "a.out" is more than just a default file name; it's also the name of a totally different executable file format. Originally, the "a.out" executable format, and hence, the "a.out" file name were due to being the "assembler output" of Ken Thompson's assembler in 1968. Most all UNIX-based systems have moved to using newer ELF format, but there are a few hold-outs still using the older a.out format. As for why ELF formatted executable files are still given the file name "a.out" by default, even when they are not in the "a.out" executable format, it's just a historic artifact (or annoyance) due to compilers and linkers. http://en.wikipedia.org/wiki/A.out http://en.wikipedia.org/wiki/A.out
- pkrumins 12y agoThis is the original article that all the other "tiny elf" or "tiny executable" articles are based on. It was written 15 years ago.
- listic 12y agoCare to update for 64 bits?
- caust1c 12y agoHere are the uncommented changes I made to each stage: https://github.com/abraithwaite/teensy https://github.com/abraithwaite/teensy
- qwerta 12y agoNice. Perhaps have a look at uclibc and busybox... :-)
- gfto 12y agoThese are not really small anymore. Look for musl libc [1] and toybox [2] instead. [1]: http://www.musl-libc.org/ http://www.musl-libc.org/ [2]: http://www.landley.net/toybox/ http://www.landley.net/toybox/
- cache87 12y agoThat's what I loved about DOS com executables. Possibly the smallest program was: int 20; which got translated into CDh 20h (4 bytes!)
- mistaken 12y agoI was hoping that the final size would be 42 :)
- whitten 12y agoI'm impressed. The author did a lot of mangling to allow the code to be as small as possible. Other than ELF and a.out format, (which is discused by @jcr) I wonder if there are other formats understood by Linux ?
- sctb 12y agohttps://news.ycombinator.com/item?id=8642734 https://news.ycombinator.com/item?id=8642734