elf-arch(1)
elf-arch π β¨
okay bestie, welcome to elf-arch, a page from the General Commands Manual and honestly? she's little but she knows things. π§
β¨ NAME β¨
elf-arch β recognize architecture of an ELF executable/shlib π¦
β¨ SYNOPSIS β¨
elf-arch <file>
says the arch of given binary π
elf-arch -a <arch> <file>
checks if <file> matches ABI <arch> π₯
β¨ DESCRIPTION β¨
so like, elf-arch detects the kernel ABI needed to run a given binary, and prints its Debian arch name. that's the whole main character move. π
β οΈ but bestie, listen β that does not necessarily mean the arch can actually run that program/library. the markings available in the ELF header are pretty much restricted to just word width, endianness and instruction set family. that's it. that's all she got.
architectures can also differ by the set of syscalls they use (although these can usually be mixed) or by required CPU instructions β and you can't generally distinguish between those other than trying to run the program. no shortcut, no vibes-based guess, you just gotta run it. π
the difference usually shows in the kernel refusing to run a binary vs executing it and crashing at runtime. two very different flavors of pain, iykyk. π
thus, as far as ELF markings are concerned, there's often a set of Debian architectures which are aliases for the same kernel arch. like a group chat where everyone has the same energy but different names. π«Ά
-a <arch> π
with this option, elf-arch instead of printing the detected architecture will check if <arch> matches one of aliases for the file, and return an exit code:
0β if there's a plausible match β- non-zero β if the given arch won't even try executing that file β
and that's the whole page, bestie π β signed off from the General Commands Manual, filed under elf-arch(1), no date stamp in sight, just vibes and ABI detection. go check your binaries, you ate. ππΈ
π¦ where this page comes from
- debian bookworm: arch-test 0.20-1 Β· MIT
- debian trixie: arch-test 0.22-1 Β· MIT
- fedora 43: arch-test 0.22-2.fc43 Β· MIT
- fedora 43: arch-test 0.22-5.fc43 Β· MIT
- fedora 44: arch-test 0.22-5.fc44 Β· MIT
- ubuntu jammy: arch-test 0.17-2 Β· MIT
- ubuntu noble: arch-test 0.21-1 Β· MIT
- ubuntu questing: arch-test 0.22-1
- ubuntu resolute: arch-test 0.22-1.1 Β· MIT
- ubuntu stonking: arch-test 0.22-1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms