Subject: Re: execsw/emul struct: move setregs hook?
To: None <jdolecek@netbsd.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 09/04/2001 14:14:52
On Tue, 4 Sep 2001, Jaromir Dolecek wrote:
> Hi,
> it's my understanding that setregs() is emulation-specific, rather than
> binary format specific. So, it would make sense to move the es_setregs
> hook from struct execsw to struct emul. Primarily, this would make more
> exec LKMs usable (like freebsd_elf). Since FOO_setregs() is typically
> in machdep file with other general emulation code, exec LKM can't access
> it easily.
>
> According to kern/exec_conf.c, most binary formats indeed use
> setregs() hook according to emulation they run under. Notable
> exceptions are:
> * Linux ELF32 and IBCS2 x.out
> * ECOFF - it's using cpu_exec_ecoff_setregs() also for native ECOFF
> binaries. This seems _wrong_ - do really native binaries require
> ECOFF-specific setregs hook?
>
> I took these two as mistakes, and normalized them to use single
> setregs hook for all executable formats supported by that emulation.
> Thus, the behaviour of native ECOFF was CHANGED, to not use the
> cpu_exec_ecoff_setregs() hook, but just use plain setregs(9).
> The behaviour for ECOFF OSF1/Ultrix was retained.
I agree with the premise of this change. I'd ask though that you check and
see what difference changing the native ECOFF behavior has. I also
understand another developer has asked you the same in private
correspondence. The main points are that according to Jason, some ports
still use ecoff, and also that pmax and alpha started out using ecoff. So
changing the native behavior would break backwards compatability, and thus
be wrong.
What functional difference does the change make?
Take care,
Bill