Under Linux, when I compile the following program:
int main() {}
With gcc 4.7:
$ gcc test.c
And inspect the resulting executable with readelf
:
$ readelf -h a.out
...
OS/ABI: UNIX - System V
...
It has the EI_OSABI
byte in the ELF header set to ELFOSABI_SYSV
, and not ELFOSABI_LINUX
.
Does anyone know the history or reasoning behind this? Naively, one might expect it to be set to Linux.
Further, what are the consequences of setting it to Linux?