Subject: Re: linux emulation questions
To: None <Robert.Baron@ERNST.MACH.CS.CMU.EDU>
From: Brad Spencer <brad@anduin.eldar.org>
List: port-i386
Date: 09/26/1996 20:31:34
I am running some emulated linux code, in a 1.2'ish kernel from
August 5.
---------------------------------------------------------------------
1. Is there still no way to distinguish between svr4 elf and linux elf.
If so, I'd like to suggest that the kernel issue a warning iff
the kernel has both compat_svr4 and compat_linux on.
[snip]
I don't exactly have an answer to this, but if you are having problems
running both types of binaries.....
I found that if one reverses the order in which the binary is probed,
things seem to work much better. In particular, in exec_elf.c make
the elf_probe_funcs stucture look like the following:
int (*elf_probe_funcs[]) __P((struct proc *, struct exec_package *,
char *, u_long *)) = {
#ifdef COMPAT_LINUX
linux_elf_probe,
#endif
#ifdef COMPAT_SVR4
svr4_elf_probe
#endif
};
Perhaps this emulation function could use used in a more effective
manor???
/*
* Set the 'personality' (emulation mode) for the current process. Only
* accept the Linux personality here (0). This call is needed because
* the Linux ELF crt0 issues it in an ugly kludge to make sure that
* ELF binaries run in Linux mode, not SVR4 mode.
*/
int
linux_sys_personality(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_personality_args /* {
syscallarg(int) per;
} */ *uap = v;
if (SCARG(uap, per) != 0)
return EINVAL;
retval[0] = 0;
return 0;
}
Brad Spencer - brad@anduin.eldar.org http://anduin.eldar.org