Subject: Re: kern/13615: NetBSD current requires a .note.netbsd.ident section
To: Jarom r Dolecek <>
From: None <>
List: netbsd-bugs
Date: 08/03/2001 16:10:03
>>    	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 :(

	i don't think i know enough about the emulation part of the kernel
	code (i need to do more), but the approach should be the best route.

>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 problem comes from the darn good emulation support netbsd has.
	normally other operating systems do not run binaries of any other
	operating systems, hence the a.out magic number is enough to detect the
	binary type.

>> 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 ?

	I expect it to be yes, and it's too much for us to ask people to
	put signatures onto their binary.

>> the current situation seems "anti-embedded" to me.
>It may be if there would be no kernel option EXEC_ELF_CATCHALL.

	i think the option has to be backwards - the default behavior has to be
	with EXEC_ELF_CATCHALL (and tweak something if you want to run netbsd
	binary only).