Subject: Re: Linux ELF --> NetBSD a.out?
To: Sean Berry <spberry@image1.ansci.iastate.edu>
From: Frank van der Linden <frank@fwi.uva.nl>
List: port-i386
Date: 10/13/1996 00:02:02
Quoting Sean Berry,

> Nice package, only problem being, it's in ELF format.  I've heard people
> talking about various things that can be done with gcc and the associated
> tools to end up with something that will run under BSD.  

> Any ideas on this one?  Is it as simple as taking all the other SysV support
> out of my kernel than Linux?  The package is an X app that doesn't do any
> weird hardware things, so I think I'm ok there.

I assume you're talking about running this Linux ELF binary under NetBSD,
using the Linux emulation? That should work just fine. Set up the shared
libs, etc, as described in the compat_linux(8) manpage, and run it..

The only problem there might be the well-known problem that ELF
binaries for the same CPU type do not contain information that makes
it 100% sure which OS they were meant for. So this means that a
Solaris x86 ELF binary can not be clearly distinguished from a Linux
one. With dynamic binaries, you can get away with checking if the
loader pathname stored in the binary is valid, but with static binaries,
there's no way to tell.

What this means in practice: dynamic binaries should work fine. If you
have static binaries, you should disable COMPAT_SVR4 in your kernel
to prevent the exec code from trying to execute the binary as an Svr4
program, and you're in the clear.

- Frank