Subject: Re: COMPAT_LINUX: Linux/ppc support
To: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
From: Jaromír Dolecek <dolecek@ics.muni.cz>
List: tech-kern
Date: 01/01/2001 21:56:06
Emmanuel Dreyfus wrote:
> > > What's that interpreter name thing?
> > itp[] :) This is read from the executable, ELF section named '.interp'.
> 
> Ummm... let me rephrase:
> What does this interpreter name does, and why do we need it?

Interpreter name is the things which actually sets the dynamic
program up to map all needed libraries etc. It's /usr/libexec/ld.so
or /usr/libexec/ld.elf_so on NetBSD, /lib/ld-linux.so on Linux.

> Well, I was not speaking about the same thing.
> linux_signature is able to match dynamic executables, but not static
> executables. That's why I said that it works for dynamic and not for
> static.

Note it does not really work. If you remove the signature test,
the probe routine becomes kitchen sink routine, i.e. everything
if previous probe routines don't claim the executable as 'theirs',
your probe routine would claim it's linux. It just happens
to work in your particular setup, since NetBSD ELF probe routine
runs first and claims NetBSD executables.

So you really need to find out why linux_signature() is failing for you
and fix it so that it recognizes Linux/PPC ELF executables (I assume
that Linux/PPC does use ELF and not a.out), to avoid false matches.

> Speaking about the dynamic executable crashes, have you got an idea of
> why I get this? Here is my program:

You might want to check stack and other memory limits. This is probably
why it SIGSEGVs for user and not root.

You might probably check if you need to implement linux copyargs specially
for ppc (i386 does not need anything special, alpha does need). I probably
can't help you much, since I'm no expert in neither ELF, nor Linux ELF
nor PPC.

Jaromir

> #include <stdio.h>
> 
> int main (int argc, char** argv) {
>   printf("Hello world!\n");
>   return 0;
> }
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
@@@@  Wanna a real operating system ? Go and get NetBSD, dammit!  @@@@