Subject: Re: kern/13615: NetBSD current requires a .note.netbsd.ident section
To: matthew green <mrg@eterna.com.au>
From: Jaromír <jdolecek@netbsd.org>
List: netbsd-bugs
Date: 08/03/2001 08:38:02
>    	maybe we should:
>    	- keep emulation binary detection part even if we don't have
>    	  COMPAT_xxx,
>    	- on program invocation, exclude every obviously-non-netbsd binaries,
>    	- execute as netbsd binary if none matches.

Well, this would not be too nice nor particularily maintainable :(

> PR#12253 is
> certainly fairly compelling, though of course on needs to be root to do this
> and therefore can be put down to "user error" (but the failure mode is damn
> spectacular.)

It may not be just reboot, but other system calls as well (like,
writev(2) or pwrite(2) or such). Yeah, it could be put down to user
error. Arguably, the kernel did wrong thing by executing random
binary as if it would be NetBSD one, and caused the problem.

> but certainly the solution that simply refuses to run correct programs 
> because they don't have a tag is no good.  it makes it impossible (sans a
> kernel rebuild) to run programs that are otherwise completely useful.

The point is that NetBSD binaries should be marked as such and recognizable
as such, without costly heuristics. The fact that e.g. Linux binaries
are not clearly marked as such is annoying, and I don't want to have
same annoying facts about NetBSD binaries.

Compilers which don't use our own crt* for linking are IMHO broken.
How do they assume they know what the OS binaries need to have in?
 
> the thing is that while one generally should use our crt* when linking, it
> isn't always necessary or applicable.  in a pure-assembly program why
> should i have to create a special .note section?  espcially one that isn't
> well documented outside of the NetBSD source code.

Are there any pure assembly programs out there ?

> the current situation seems "anti-embedded" to me.

It may be if there would be no kernel option EXEC_ELF_CATCHALL.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
NetBSD - just plain best OS! -=*=- Got spare MCA cards or docs? Hand me them!