19

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?

1 Answer 1

24

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

2
  • 1
    Do you gain performance improvements when increasing the minimum required kernel version? What are the benefits to doing so? Commented Feb 5, 2019 at 14:56
  • Here (Fedora 31, x86_64) /lib/libc-2.30.so requires kernel 3.20 (current kernel version is 5.3.12-300)
    – vonbrand
    Commented Nov 29, 2019 at 12:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .