Linux – Why does the file command say that ELF binaries are for Linux 2.6.9

elfexecutablelinux

Whenever I run file on an ELF binary I get this output:

[jonescb@localhost ~]$ file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, 
not stripped

I'm just wondering what changed in Linux 2.6.9 that this binary couldn't run on 2.6.8?
Wasn't ELF support added in Linux 2.0?

Best Answer

glibc has a configure option called --enable-kernel that lets you specify the minimum supported kernel version. When object files are linked with that glibc build, the linker adds a SHT_NOTE section to the resulting executable named .note.ABI-tag that includes that minimum kernel version. The exact format is defined in the LSB, and file knows to look for that section and how to interpret it.

The reason your particular glibc was built to require 2.6.9 depends on who built it. It's the same on my system (Gentoo); a comment in the glibc ebuild says that it specifies 2.6.9 because it's the minimum required for the NPTL, so that's likely a common choice. Another one that seems to come up is 2.4.1, because it was the minimum required for LinuxThreads, the package used before NPTL

Related Question