Subject: Re: Linux ELF binaries on current
To: Christos Zoulas <christos@deshaw.com>
From: Missing - presumed fed. <greywolf@defender.VAS.viewlogic.com>
List: port-i386
Date: 10/23/1995 09:57:55
Perhaps, since neither Linux nor SVR4 really "use" the note field (from
what I have gathered by the discussion thus far), maybe if NetBSD stuffs a
NetBSD recognizable value into an ELF note field (if and when NetBSD switches
to ELF headers from a.out headers), that would solve the problem.  The
flow would then (apparently) look like this:

	if (note_field_is_set to NetBSD_marker)
	    execute(prog, EXEC_NATIVE);
	else
#ifdef COMPAT_LINUX
	if (looks_like_Linux) 
	    execute(prog, EXEC_LINUX);
	else
#endif	/* COMPAT_LINUX */
#ifdef COMPAT_SVR4
	if (looks_like_SVR4)
	    execute(prog, EXEC_SVR4);
	else
#endif	/* COMPAT_SVR4 */
	    return ENOEXEC;

...or did I miss something?

Ugly?  Not really.  Kludgy?  Certainly.  Drawn out?  Yes.

But what do you expect?  We're trying to run everything in the known universe
when nothing else agrees.  We're trying to be a potential melting pot
(I say potential, because although we can disable all the various compati-
bility modes, we're still prepared to deal with just about anything, almost
to the inclusion of
	compat	AUNT_BERTHAS_FAVOURITE_EXEC_FORMAT_DU_JOUR
), and this is bound to cause some problems.

Thankfully the compatibility is a kernel compile option and not forcibly
loaded.

		my (unaligned) (unpadded) struct foo { u_char bits:2; },


				--*greywolf;
--
Rule #1 of Role Playing Gaming:
	Never give the Gamemaster ideas.