26 comments

[ 4.4 ms ] story [ 55.0 ms ] thread
Strongly recommend reading "How To Write Shared Libraries" by Ulrich Drepper 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.

Thanks for the suggestion @dietrichepp. Will definitely read.
> 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?

Mods fix title: "Life of a binary"
I don't see any option to edit the title now. Anyways, I don't see it would change any meaning of the article.
I would suggest "Anatomy of a Linux ELF executable" for the title. A binary file could be anything.
I agree. You know of any way to edit now? Edit option is disabled now.
OK, we've done that now!
Looks like a mod has taken care of it.
Should be "Life of a Linux executable (2017)"
Title should have (2017).
(comment deleted)
A lot has changed in the world of ELF executables, this information is just soo misleading.
> 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.

Thanks for the suggestion. Do you have any good reference for reading about this feature?
ELF may find new life as a format for data structures in persistent RAM, given a few extensions.
Are 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
Thanks @ddcc7. Yes, I am the author. Fixed the spelling mistake.