ELFDUMP(1)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’œ ELFDUMP(1) β€” the elfdump girlies' guide to looking inside ELF files πŸ’œ

okay so bestie, this is the elfdump manual page β€” that's section 1 of the General Commands Manual, and it's genuinely one of my faves. it's short, it's iconic, and it does exactly one thing but does it so well. let me walk you through it 🫢


✨ NAME ✨

elfdump β€” display information about ELF files. that's it. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

elfdump -a | -E | -cdeGhinprs [-w file] file

read that again, carefully, because the structure is kind of the main character here. you either pass -a all by itself, OR you pass -E all by itself, OR you pass some combo of -cdeGhinprs (they stack! they're besties!), and you can also throw -w file in there whenever. then at the end you gotta name your file. no cap. πŸ”₯


✨ DESCRIPTION ✨

so, what does elfdump actually do? the elfdump utility dumps various information about the specified ELF file. cute, mysterious, to the point. like a girl who shows up, spills all the tea about your binary, and leaves 🌸

the options are as follows:

  • -a β€” dump all information. literally everything. the full stan account. the mega-dump. take it all in πŸ”₯
  • -c β€” dump the section headers πŸŽ€
  • -d β€” dump the dynamic symbols ✨
  • -e β€” dump the ELF header πŸ¦‹
  • -E β€” return success if file is an ELF file and failure if it is not. so this one is a lil different, bestie: it's a pure yes/no vibe check. and here's the important bit β€” this option is exclusive with other options. it does NOT play nicely with the others, do not pair it, do not invite it to the group chat πŸ’€
  • -G β€” dump the GOT πŸ‘‘
  • -h β€” dump the hash values πŸ’œ
  • -i β€” dump the dynamic interpreter 🌈
  • -n β€” dump note sections πŸ“
  • -p β€” dump the program header ⭐
  • -r β€” dump relocations 🧚
  • -s β€” dump the symbol table πŸ’–
  • -w file β€” write output to a file instead of the standard output. yes, the option takes an argument, and yes, confusingly, that argument is also called file in the synopsis, and there's a second file too. i know. exe. still iconic πŸ™ˆ
ngl the -E exclusivity is the one thing you truly have to remember. it's not like the other flags, it doesn't share the aux cord. keep it solo.

✨ EXIT STATUS ✨

the elfdump utility exits 0 on success, and >0 if an error occurs. classic. understated. we love a girl who knows how to signal failure 😭


✨ EXAMPLES ✨

the following is an example of a typical usage of the elfdump command:

elfdump -a -w output /bin/ls

see what's happening? dump all the info about /bin/ls, but send it into a file called output instead of flooding your terminal. so thoughtful. so organized. that's her πŸ’…βœ¨


✨ SEE ALSO ✨

also on the reading list, and this is a real source not just a vibe, so go check it out:

AT&T Unix Systems Labs, System V Application Binary Interface, http://www.sco.com/developers/gabi/.

✨ HISTORY ✨

the elfdump utility first appeared in FreeBSD 5.0. a true OG. respect the elders πŸ‘‘


✨ AUTHORS ✨

  • the elfdump utility was written by Jake Burkholder <jake@FreeBSD.org>. πŸ’–
  • this manual page was written by David O'Brien <obrien@FreeBSD.org>. πŸŽ€

both of them? legends. thank you for your service 🫢


✨ BUGS ✨

does not fully implement the ELF gABI. that's the whole bug section. short, honest, a little devastating πŸ˜­πŸ’€ so like β€” set your expectations accordingly, she's great but she's not the entire spec.


and that's the page, bestie!! this one came from Debian, dated November 5, 2018 β€” so if you're citing it, that's your source and your date. now go dump some ELF files, you absolute icon πŸŒŸπŸ’œπŸ¦‹

periodt. πŸ’…

πŸ“¦ where this page comes from