calculus of PT_NOTE "for GNU/Linux 2.6.32"

Roland McGrath roland at redhat.com
Tue Sep 21 06:35:24 UTC 2010


This note comes from crt1.o, which is linked into every normal program
(both static and dynamic).  Off hand, I'm not sure of anything that
actually checks this note.

What it indicates is the minimum required kernel version that glibc was
built for (its --enable-kernel configure option).  This controls what
system calls and such kernel features the libc code is built to assume
exist and work correctly.  

In a statically-linked executable, there may very well be libc code that
requires that new a kernel.  The startup code in libc actually checks
the kernel version against this, so a static executable won't try to run.

For normal dynamically-linked executables, it is unlikely this note
really means anything that matters.  (I'm not entirely positive about
this.)  The same kernel requirement is built into all the DSOs in the
glibc package, including the dynamic linker itself.  The dynamic
linker's startup code does the same kernel version check that is done by
static libc code in a static link.  But that is based on what those DSOs
need, not what the crt1.o note in your executable says.

For Fedora glibc builds, we have chosen the newest --enable-kernel
version that we can use.  (It is always more optimal to disable the
compatibility code.)  The limiting factor has been the kernels that
the koji build machines run, so that glibc's build can do "make check"
(actually the build itself requires running the just-built libc too).
That's why it was 2.6.18 for so long, because those machines ran RHEL5.
Now, I guess they run RHEL6 or something, so we can rely on getting 2.6.32.

The proper and recommended way to build binaries that will be sure to be
compatible with an older Fedora is to build them against the glibc-devel
(and every other -devel) from that Fedora.  I think most people use mock.


Thanks,
Roland


More information about the devel mailing list