4 ms·
I've hand-written a couple elf binaries just for kicks. The wikipedia page on ELF has a list of current conventions on the 7th byte in the elf header (e_ident[E
by xelxebar 9y ago
I've hand-written a couple elf binaries just for kicks. The wikipedia page on ELF has a list of current conventions on the 7th byte in the elf header (e_ident[EI_OSABI] in the spec) [1]:
0x00 System V
0x01 HP-UX
0x02 NetBSD
0x03 Linux
0x04 GNU Hurd
0x06 Solaris
0x07 AIX
0x08 IRIX
0x09 FreeBSD
0x0A Tru64
0x0B Novell Modesto
0x0C OpenBSD
0x0D OpenVMS
0x0E NonStop Kernel
0x0F AROS
0x10 Fenix OS
0x11 CloudABI
0x53 Sortix
I don't know enough about linker/loader details, though, to tell you how different ones actually make use of this information. IIRC, the glibc loader just checks that it's 0x0 or 0x3 and leaves it at that.
[1] https://en.wikipedia.org/wiki/Executable_and_Linkable_Format https://en.wikipedia.org/wiki/Executable_and_Linkable_Format