The kernel version displayed by file on an executable has nothing to do with the kernel installed on your system. It matches the C library the program was linked with at build time.
Your C compiler targets a specific C library (usually glibc). In turn, the C library targets a kernel API (i.e. the C library is built for a specific kernel). That is the version displayed by file.
You don't have to worry about the mimatch between the kernel version displayed by file and the kernel version installed on your machine.
@REALFREE: you can try the following experiment. Maybe it will
help you get a grasp of what's going on:
$ uname -r
3.10-2-amd64
$ gcc -Wall -Werror hello.c -o hello
$ readelf --notes ./hello
Displaying notes found at file offset 0x0000021c with length 0x00000020:
Owner Data size Description
GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag)
OS: Linux, ABI: 2.6.32
The information about the ABI tag is contained in an elf
segment called NOTE. This information is written by the linker
when the program is compiled. It matches the ABI tag of the C library.
$ ldd ./hello
linux-vdso.so.1 (0x00007fffd31fe000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5f1a465000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5f1a827000)
$ readelf --notes /lib/x86_64-linux-gnu/libc.so.6
Displaying notes found at file offset 0x00000294 with length 0x00000020:
Propriétaire Taille des données Description
GNU 0x00000010 NT_GNU_ABI_TAG (étiquette de version ABI)
OS: Linux, ABI: 2.6.32
In order to build the C library, you have to select a kernel
version. Here, the C library was compiled for a 2.6.32 kernel but
it also works with more recent kernels. However, if the program
is run on a kernel older than 2.6.32, a kernel too old warning
is displayed.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…