9 ms·
Anatomy of an ELF executable
- dietrichepp 7y agoStrongly recommend reading "How To Write Shared Libraries" by Ulrich Drepper https://software.intel.com/sites/default/files/m/a/1/e/dsohowto.pdf https://software.intel.com/sites/default/files/m/a/1/e/dsoho... I recently dove into ELF files so I could convert ELF binaries to DOS EXE, for a little bit of retro programming with modern compilers. Not that I couldn't have used DJGPP.
- kishu18 7y agoThanks for the suggestion @dietrichepp. Will definitely read.
- unqueued 7y ago> I recently dove into ELF files so I could convert ELF binaries to DOS EXE, for a little bit of retro programming with modern compilers. Not that I couldn't have used DJGPP. That sounds pretty cool, did you make anything you could share?
- dietrichepp 7y agoGoing to post it to GitHub when I have a moment. I literally wrote the code a couple weeks ago. Edit: https://github.com/depp/elf2dos https://github.com/depp/elf2dos
- tantalor 7y agoMods fix title: "Life of a binary"
- kishu18 7y agoI don't see any option to edit the title now. Anyways, I don't see it would change any meaning of the article.
- js2 7y agoI would suggest "Anatomy of a Linux ELF executable" for the title. A binary file could be anything.
- paulddraper 7y agoShould be "Life of a Linux executable (2017)"
- hk__2 7y agoTitle should have (2017).
- deleted 7y ago[deleted]
- adrianh_589 7y agoI agree with that.
- sk0g 7y agoA lot has changed in the world of ELF executables, this information is just soo misleading.
- saagarjha 7y ago> You can ignore the directives starting with cfi. They are used for call stack unwinding in case of exceptions. It might be worth compiling with -fno-asynchronous-unwind-tables, which will get rid of those.
- kishu18 7y agoThanks for the suggestion. Do you have any good reference for reading about this feature?
- saagarjha 7y agoGCC's option page lists what it does: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html. However, it's not all that obvious that this is the flag that controls whether the "cfi" labels are emitted. Here's a more general Stack Overflow question about creating nice assembly output: https://stackoverflow.com/questions/38552116/how-to-remove-noise-from-gcc-clang-assembly-output https://stackoverflow.com/questions/38552116/how-to-remove-n...
- kishu18 7y agoNice. Thanks for sharing the stackoverflow link. Will check that.
- ncmncm 7y agoELF may find new life as a format for data structures in persistent RAM, given a few extensions.
- zonovar 7y agoInteresting article. When I was studying the elf format myself in the past I've also found very useful this poster. https://github.com/corkami/pics/blob/master/binary/elf101/elf101.pdf https://github.com/corkami/pics/blob/master/binary/elf101/el... The author has made many more for similar binary formats.
- russellbeattie 7y agoCOM files are great... no headers, you just sort of start. Data, code... whatever.
- sara12386 7y agoEven you can't believe there is a hen in world's biggest animals See the video how they looks and what they do https://cutt.ly/1rOU7Q https://cutt.ly/1rOU7Q Fish walking with legs like humans See the video on link below http://bit.ly/2XRGyYD http://bit.ly/2XRGyYD This couple is different Girls are both twins and boys are also twin brothers see how they look in video http://bit.ly/2VwoZQd http://bit.ly/2VwoZQd A cute dog is dancing in video Just watch this video and try to control your laugh http://bit.ly/2ZK1XVs http://bit.ly/2ZK1XVs
- ddcc7 7y agoAre you the author? Great job for the detailed writeup. Small nit, I noticed you misspelled the interpreter section, it should be .interp instead of .intrep
- kishu18 7y agoThanks @ddcc7. Yes, I am the author. Fixed the spelling mistake.