[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OSABI on Linux Distros



> What is the reason why we emit OSABI value as "UNIX - System V" 
> (ELFOSABI_SYSV) even on GNU/Linux systems? Shouldn't it be just "GNU" 
> (ELFOSABI_GNU)?

In GNU systems the use of this field is specifically to indicate that
certain GNU extensions to ELF are used in the particular object.  In
particular, if any .dynsym entries use STT_GNU_IFUNC o STB_GNU_UNIQUE,
then e_ident[EI_OSABI] must be ELFOSABI_GNU.  Otherwise, it can be
ELFOSABI_NONE (aka ELFOSABI_SYSV).  In fact, it should be, and the
tools (linkers) implement that distinction.  This makes it possible
for current tools (without special switches or whatnot) to produce
binaries that are compatible with older dynamic linker implementations
that did not support these GNU extensions to ELF.

This is arguably a bad overloading of the original instead of
EI_OSABI, but it's what's been done for GNU systems and so now it's an
unchangeable part of the GNU ELF gABI.