This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to implement a kernel feature check in the crt* files?


On Thu, Jan 07, 2010 at 12:59:40PM +0100, Andreas Krebbel wrote:
> I'm looking for a way to match a kernel capability against a
> requirement of an ELF binary in order to prevent the binary from being
> executed in case the kernel doesn't support it.

I'd prefer e_flags bit.  No idea why you want to implement this in crt1.o,
I'd just do this in elf_machine_matches_host and in kernel's ELF loader.

For some examples see e.g. sparc, which doesn't use e_flags bit, but
has a special EM_ code EM_SPARC32PLUS.
The advantage of e_flags is that it can be easily merged during linking
from multiple input objects (if any of the input objects has the bit set,
set it in the output), and can be cheaply tested by the kernel.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]