Subject: Re: COMPAT_LINUX: a problem with dup2()
To: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
From: Eric Haszlakiewicz <erh@nimenees.com>
List: tech-kern
Date: 12/31/2000 18:19:04
On Sun, Dec 31, 2000 at 04:31:05PM +0100, Emmanuel Dreyfus wrote:
> Happy new year everybody
> 
>    325 ktrace   EMUL  "netbsd"
>    325 ktrace   RET   ktrace 0
>    325 ktrace   CALL  execve(0x7fffeac3,0x7fffea18,0x7fffea20)
>    325 ktrace   NAMI  "./mmap"
>    325 mmap     EMUL  "netbsd"
With a statically linked binary the "/lib/ld-linux" string is probably
not present.  Also, it seems that the elf note section that explicitly
identifies the OS the binary is for is either not present or we're not
checking it correctly.  You might want to try adding an
"options LINUX_GCC_SIGNATURE" to your kernel config file and see if
it works then.  This might backfire however, since native netbsd 
binaries might then match as linux binaries. (i.e. make sure to keep
a backup kernel around)
For more details look in sys/compat/linux/common/linux_exec_elf32.c

Does anyone know if all (or any) netbsd binaries contains the ELF note
sections that would identify them?  If so, it would be a simple change
to the probe routines to check this first, before any other methods.

eric