4 ms·
ELF Binaries on Linux: Executable and Linkable Format
- legulere 10y agoI kind of wonder why there's no plain text executable format (for the header stuff). Performance hardly should be a problem.
- slezyr 10y ago> Performance hardly should be a problem. Now. Try to open any exe file and first thing you will see is MZ and "This program cannot be run in DOS mode" executable formats are as old as PCs
- AnonymousPlanet 10y agoThe history of computing goes back well beyond PCs. And at their introduction, they were just amateur playgrounds. And yes, executable formats were made for slower machines with less resources.
- XorNot 10y agoIsn't this almost what !# syntax is? It gets pretty close to it.
- dikei 10y agoThere's no such things as plain text, everything is just a series of bytes. The ELF header just happens to be encode in a special schema, instead of plain ASCII :D
- nwmcsween 10y agoThis is exactly what #! does, see Linux binfmt_script.c. ld.so is an interpreter for a specific format just like #!. There is also binfmt_misc to register other interpreters.
- rurban 10y agoHe is just missing the new witchcraft compiler wcc, which can unlink exes into shared libs, load those libs into your exe and inspect any function or variable. And then link it back into an exe. https://github.com/endrazine/wcc https://github.com/endrazine/wcc
- cvs268 10y agoI wrote an ELF parser in 100lines of C a few years ago. I was especially interested in ELF extensions for ARM. http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IH... The exercise helped me more than what i could have achieved by reading any number of docs. (Thanks to my Team Lead for suggesting i try this.) The annotated version(~500lines with inline comments now) is up on github at https://github.com/TheCodeArtist/elf-parser https://github.com/TheCodeArtist/elf-parser IIRC, its a few minutes away from becoming a disassembler if anyone wants to try...