2001-03-03 04:46:04 +03:00
|
|
|
/* $NetBSD: exec_conf.c,v 1.55 2001/03/03 01:46:04 eeh Exp $ */
|
1994-06-29 10:29:24 +04:00
|
|
|
|
1994-01-16 06:09:59 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1993, 1994 Christopher G. Demetriou
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by Christopher G. Demetriou.
|
|
|
|
* 4. The name of the author may not be used to endorse or promote products
|
1994-01-29 02:43:26 +03:00
|
|
|
* derived from this software without specific prior written permission
|
1994-01-16 06:09:59 +03:00
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
1998-01-22 04:32:14 +03:00
|
|
|
#include "opt_execfmt.h"
|
1998-06-26 02:49:18 +04:00
|
|
|
#include "opt_compat_freebsd.h"
|
1998-06-26 03:18:23 +04:00
|
|
|
#include "opt_compat_linux.h"
|
1998-06-26 03:22:37 +04:00
|
|
|
#include "opt_compat_ibcs2.h"
|
1998-06-26 03:40:33 +04:00
|
|
|
#include "opt_compat_sunos.h"
|
1998-06-26 03:56:39 +04:00
|
|
|
#include "opt_compat_hpux.h"
|
1999-03-10 00:02:38 +03:00
|
|
|
#include "opt_compat_m68k4k.h"
|
1998-06-26 04:07:06 +04:00
|
|
|
#include "opt_compat_svr4.h"
|
1999-03-26 07:29:20 +03:00
|
|
|
#include "opt_compat_netbsd32.h"
|
1999-02-11 12:35:21 +03:00
|
|
|
#include "opt_compat_aout.h"
|
2000-12-02 23:44:09 +03:00
|
|
|
#include "opt_compat_aout_m68k.h"
|
2000-01-17 05:59:25 +03:00
|
|
|
#include "opt_compat_vax1k.h"
|
2000-06-04 20:26:11 +04:00
|
|
|
#include "opt_compat_pecoff.h"
|
2000-11-21 03:37:49 +03:00
|
|
|
#include "opt_compat_osf1.h"
|
|
|
|
#include "opt_compat_ultrix.h"
|
1998-01-22 04:32:14 +03:00
|
|
|
|
1994-01-16 06:09:59 +03:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/exec.h>
|
|
|
|
|
|
|
|
#ifdef EXEC_SCRIPT
|
|
|
|
#include <sys/exec_script.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef EXEC_AOUT
|
1994-07-01 06:57:52 +04:00
|
|
|
/*#include <sys/exec_aout.h> -- automatically pulled in */
|
1994-01-16 06:09:59 +03:00
|
|
|
#endif
|
|
|
|
|
1999-09-13 14:30:21 +04:00
|
|
|
#ifdef EXEC_COFF
|
2000-01-02 16:39:49 +03:00
|
|
|
#include <sys/exec_coff.h>
|
1999-09-13 14:30:21 +04:00
|
|
|
#endif
|
2000-01-02 16:39:49 +03:00
|
|
|
|
|
|
|
#ifdef EXEC_ECOFF
|
|
|
|
#include <sys/exec_ecoff.h>
|
1999-09-13 14:30:21 +04:00
|
|
|
#endif
|
|
|
|
|
1996-09-27 00:51:03 +04:00
|
|
|
#if defined(EXEC_ELF32) || defined(EXEC_ELF64)
|
1995-06-23 01:29:47 +04:00
|
|
|
#include <sys/exec_elf.h>
|
2000-11-21 03:37:49 +03:00
|
|
|
#define CONCAT(x,y) __CONCAT(x,y)
|
|
|
|
#define ELF32NAME(x) CONCAT(elf,CONCAT(32,CONCAT(_,x)))
|
|
|
|
#define ELF32NAME2(x,y) CONCAT(x,CONCAT(_elf32_,y))
|
|
|
|
#define ELF64NAME(x) CONCAT(elf,CONCAT(64,CONCAT(_,x)))
|
|
|
|
#define ELF64NAME2(x,y) CONCAT(x,CONCAT(_elf64_,y))
|
|
|
|
#ifdef EXEC_ELF32
|
|
|
|
int ELF32NAME2(netbsd,probe)(struct proc *, struct exec_package *,
|
|
|
|
void *, char *, vaddr_t *);
|
2000-11-27 21:04:32 +03:00
|
|
|
#endif
|
|
|
|
#ifdef EXEC_ELF64
|
2000-11-21 03:37:49 +03:00
|
|
|
int ELF64NAME2(netbsd,probe)(struct proc *, struct exec_package *,
|
|
|
|
void *, char *, vaddr_t *);
|
1995-06-23 01:29:47 +04:00
|
|
|
#endif
|
2000-11-21 03:37:49 +03:00
|
|
|
#endif /* ELF32 || ELF64 */
|
1995-06-23 01:29:47 +04:00
|
|
|
|
1997-12-04 18:33:17 +03:00
|
|
|
#ifdef COMPAT_SUNOS
|
|
|
|
#include <compat/sunos/sunos_exec.h>
|
|
|
|
#endif
|
|
|
|
|
2001-02-11 04:29:43 +03:00
|
|
|
#if defined(COMPAT_SVR4) || defined(COMPAT_SVR4_32)
|
1994-08-16 02:36:40 +04:00
|
|
|
#include <compat/svr4/svr4_exec.h>
|
|
|
|
#endif
|
|
|
|
|
2001-02-11 04:29:43 +03:00
|
|
|
#ifdef COMPAT_SVR4_32
|
|
|
|
#include <compat/svr4_32/svr4_32_exec.h>
|
|
|
|
#endif
|
|
|
|
|
1994-08-16 02:17:16 +04:00
|
|
|
#ifdef COMPAT_IBCS2
|
2000-06-04 20:26:11 +04:00
|
|
|
#include <sys/exec_coff.h>
|
1994-08-16 02:17:16 +04:00
|
|
|
#include <compat/ibcs2/ibcs2_exec.h>
|
2000-11-21 03:37:49 +03:00
|
|
|
#include <machine/ibcs2_machdep.h>
|
1994-08-16 02:17:16 +04:00
|
|
|
#endif
|
|
|
|
|
1995-03-01 02:06:21 +03:00
|
|
|
#ifdef COMPAT_LINUX
|
1998-10-04 00:39:32 +04:00
|
|
|
#include <compat/linux/common/linux_exec.h>
|
1995-03-01 02:06:21 +03:00
|
|
|
#endif
|
|
|
|
|
1995-10-10 04:26:36 +03:00
|
|
|
#ifdef COMPAT_FREEBSD
|
|
|
|
#include <compat/freebsd/freebsd_exec.h>
|
|
|
|
#endif
|
|
|
|
|
1995-11-28 11:07:25 +03:00
|
|
|
#ifdef COMPAT_HPUX
|
|
|
|
#include <compat/hpux/hpux_exec.h>
|
|
|
|
#endif
|
|
|
|
|
1996-09-11 02:05:03 +04:00
|
|
|
#ifdef COMPAT_M68K4K
|
|
|
|
#include <compat/m68k4k/m68k4k_exec.h>
|
|
|
|
#endif
|
|
|
|
|
1999-03-26 07:29:20 +03:00
|
|
|
#ifdef COMPAT_NETBSD32
|
|
|
|
#include <compat/netbsd32/netbsd32_exec.h>
|
2001-02-02 10:30:22 +03:00
|
|
|
#ifdef COMPAT_SUNOS
|
|
|
|
#include <compat/sunos32/sunos32_exec.h>
|
|
|
|
#endif
|
1998-08-31 06:46:22 +04:00
|
|
|
#endif
|
|
|
|
|
1998-08-21 17:41:09 +04:00
|
|
|
#ifdef COMPAT_VAX1K
|
|
|
|
#include <compat/vax1k/vax1k_exec.h>
|
|
|
|
#endif
|
|
|
|
|
2000-06-04 20:26:11 +04:00
|
|
|
#ifdef COMPAT_PECOFF
|
|
|
|
#include <sys/exec_coff.h>
|
|
|
|
#include <compat/pecoff/pecoff_exec.h>
|
|
|
|
#endif
|
|
|
|
|
2000-11-21 03:37:49 +03:00
|
|
|
#ifdef COMPAT_OSF1
|
2000-11-22 06:48:33 +03:00
|
|
|
#include <compat/osf1/osf1.h>
|
2000-11-21 03:37:49 +03:00
|
|
|
#include <compat/osf1/osf1_exec.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef COMPAT_ULTRIX
|
|
|
|
#include <compat/ultrix/ultrix_exec.h>
|
1994-01-16 06:09:59 +03:00
|
|
|
#endif
|
2000-11-21 03:37:49 +03:00
|
|
|
|
|
|
|
extern const struct emul emul_netbsd;
|
2000-11-22 06:48:33 +03:00
|
|
|
#ifdef COMPAT_AOUT
|
2000-11-21 03:37:49 +03:00
|
|
|
extern const struct emul emul_netbsd_aout;
|
|
|
|
#endif
|
2000-12-02 23:44:09 +03:00
|
|
|
#ifdef COMPAT_AOUT_M68K
|
|
|
|
extern const struct emul emul_netbsd_aoutm68k;
|
|
|
|
#endif
|
2000-11-21 03:37:49 +03:00
|
|
|
|
2000-12-08 22:42:11 +03:00
|
|
|
const struct execsw execsw_builtin[] = {
|
1994-01-16 06:09:59 +03:00
|
|
|
#ifdef EXEC_SCRIPT
|
2000-12-01 15:57:55 +03:00
|
|
|
{ MAXINTERP, exec_script_makecmds, { NULL },
|
|
|
|
NULL, EXECSW_PRIO_ANY, }, /* shell scripts */
|
1994-01-16 06:09:59 +03:00
|
|
|
#endif
|
|
|
|
#ifdef EXEC_AOUT
|
1999-12-30 18:57:31 +03:00
|
|
|
#ifdef COMPAT_NETBSD32
|
2000-11-21 03:37:49 +03:00
|
|
|
{ sizeof(struct netbsd32_exec), exec_netbsd32_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd32, EXECSW_PRIO_FIRST,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, netbsd32_copyargs, netbsd32_setregs }, /* sparc 32 bit */
|
1999-12-30 18:57:31 +03:00
|
|
|
#endif
|
2000-11-21 03:37:49 +03:00
|
|
|
{ sizeof(struct exec), exec_aout_makecmds, { NULL },
|
|
|
|
#ifdef COMPAT_AOUT
|
|
|
|
&emul_netbsd_aout,
|
2000-12-02 23:44:09 +03:00
|
|
|
#elif defined(COMPAT_AOUT_M68K)
|
|
|
|
&emul_netbsd_aoutm68k,
|
2000-11-21 03:37:49 +03:00
|
|
|
#else
|
|
|
|
&emul_netbsd,
|
|
|
|
#endif /* COMPAT_AOUT */
|
2000-12-01 15:57:55 +03:00
|
|
|
EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, setregs }, /* a.out binaries */
|
1994-01-16 06:09:59 +03:00
|
|
|
#endif
|
1999-09-13 14:30:21 +04:00
|
|
|
#ifdef EXEC_COFF
|
2000-11-21 03:37:49 +03:00
|
|
|
{ COFF_HDR_SIZE, exec_coff_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, setregs }, /* coff binaries */
|
1999-09-13 14:30:21 +04:00
|
|
|
#endif
|
2000-01-02 16:39:49 +03:00
|
|
|
#ifdef EXEC_ECOFF
|
2000-11-21 03:37:49 +03:00
|
|
|
#ifdef COMPAT_OSF1
|
|
|
|
{ ECOFF_HDR_SIZE, exec_ecoff_makecmds,
|
|
|
|
{ ecoff_probe_func: osf1_exec_ecoff_probe },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_osf1, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
howmany(OSF1_MAX_AUX_ENTRIES * sizeof (struct osf1_auxv) +
|
|
|
|
2 * (MAXPATHLEN + 1), sizeof (char *)), /* exec & loader names */
|
2000-11-22 06:48:33 +03:00
|
|
|
osf1_copyargs, cpu_exec_ecoff_setregs }, /* OSF1 ecoff binaries */
|
2000-11-21 03:37:49 +03:00
|
|
|
#endif /* COMPAT_OSF1 */
|
|
|
|
{ ECOFF_HDR_SIZE, exec_ecoff_makecmds,
|
|
|
|
{ ecoff_probe_func: cpu_exec_ecoff_probe },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, cpu_exec_ecoff_setregs }, /* ecoff binaries */
|
|
|
|
#ifdef COMPAT_ULTRIX
|
|
|
|
{ ECOFF_HDR_SIZE, exec_ecoff_makecmds,
|
|
|
|
{ ecoff_probe_func: ultrix_exec_ecoff_probe },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_ultrix, EXECSW_PRIO_LAST, /* XXX probe func alw. succeeds */
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, cpu_exec_ecoff_setregs }, /* Ultrix ecoff binaries */
|
|
|
|
#endif /* COMPAT_ULTRIX */
|
1999-09-13 14:30:21 +04:00
|
|
|
#endif
|
1996-09-27 00:51:03 +04:00
|
|
|
#ifdef EXEC_ELF32
|
2000-11-21 03:37:49 +03:00
|
|
|
/* 32bit ELF bins */
|
|
|
|
#ifdef COMPAT_NETBSD32
|
|
|
|
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
|
|
|
{ elf_probe_func: ELF32NAME2(netbsd32,probe) },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd32, EXECSW_PRIO_FIRST,
|
2000-11-21 03:37:49 +03:00
|
|
|
howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
|
|
|
|
netbsd32_elf32_copyargs, netbsd32_setregs }, /* NetBSD32 32bit ELF bins */
|
|
|
|
/* This one should go first so it matches instead of netbsd */
|
|
|
|
#endif
|
|
|
|
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
|
|
|
{ elf_probe_func: ELF32NAME2(netbsd,probe) },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
|
|
|
|
elf32_copyargs, setregs }, /* NetBSD 32bit ELF bins */
|
|
|
|
#ifdef COMPAT_FREEBSD
|
|
|
|
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
|
|
|
{ elf_probe_func: ELF32NAME2(freebsd,probe) },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_freebsd, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
FREEBSD_ELF_AUX_ARGSIZ,
|
2000-12-18 00:36:49 +03:00
|
|
|
elf32_copyargs, freebsd_setregs }, /* FreeBSD 32bit ELF bins (not 64bit safe )*/
|
1996-09-27 00:51:03 +04:00
|
|
|
#endif
|
2000-11-21 03:37:49 +03:00
|
|
|
#ifdef COMPAT_LINUX
|
|
|
|
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
|
|
|
{ elf_probe_func: ELF32NAME2(linux,probe) },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_linux, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
LINUX_ELF_AUX_ARGSIZ,
|
|
|
|
LINUX_COPYARGS_FUNCTION, setregs }, /* Linux 32bit ELF bins */
|
1994-08-16 02:36:40 +04:00
|
|
|
#endif
|
2001-02-11 04:29:43 +03:00
|
|
|
#ifdef COMPAT_SVR4_32
|
|
|
|
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
|
|
|
{ elf_probe_func: ELF32NAME2(svr4_32,probe) },
|
|
|
|
&emul_svr4_32, EXECSW_PRIO_ANY,
|
|
|
|
SVR4_32_AUX_ARGSIZ,
|
|
|
|
svr4_32_copyargs, svr4_32_setregs }, /* SVR4 32bit ELF bins (not 64bit safe) */
|
|
|
|
#endif
|
2000-11-21 03:37:49 +03:00
|
|
|
#ifdef COMPAT_SVR4
|
|
|
|
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
|
|
|
{ elf_probe_func: ELF32NAME2(svr4,probe) },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_svr4, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
SVR4_AUX_ARGSIZ,
|
|
|
|
svr4_copyargs, svr4_setregs }, /* SVR4 32bit ELF bins (not 64bit safe) */
|
|
|
|
#endif
|
|
|
|
#ifdef COMPAT_IBCS2
|
|
|
|
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
|
|
|
{ elf_probe_func: ELF32NAME2(ibcs2,probe) },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_ibcs2, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
IBCS2_ELF_AUX_ARGSIZ, elf32_copyargs, setregs },
|
|
|
|
/* SCO 32bit ELF bins (not 64bit safe) */
|
|
|
|
#endif
|
|
|
|
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd, EXECSW_PRIO_LAST, /* catch all entry */
|
2000-11-21 03:37:49 +03:00
|
|
|
howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
|
|
|
|
elf32_copyargs, setregs }, /* NetBSD 32bit ELF bins */
|
|
|
|
#endif /* EXEC_ELF32 */
|
|
|
|
#ifdef EXEC_ELF64
|
|
|
|
/* 64bit ELF bins */
|
|
|
|
{ sizeof (Elf64_Ehdr), exec_elf64_makecmds,
|
|
|
|
{ elf_probe_func: ELF64NAME2(netbsd,probe) },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
|
|
|
|
elf64_copyargs, setregs }, /* NetBSD 64bit ELF bins */
|
|
|
|
#ifdef COMPAT_LINUX
|
|
|
|
{ sizeof (Elf64_Ehdr), exec_elf64_makecmds,
|
|
|
|
{ elf_probe_func: ELF64NAME2(linux,probe) },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_linux, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
LINUX_ELF_AUX_ARGSIZ,
|
2000-11-29 00:58:12 +03:00
|
|
|
linux_elf64_copyargs, setregs }, /* Linux 64bit ELF bins */
|
2001-03-03 04:46:04 +03:00
|
|
|
#endif
|
|
|
|
#ifdef COMPAT_SVR4
|
|
|
|
{ sizeof (Elf64_Ehdr), exec_elf64_makecmds,
|
|
|
|
{ elf_probe_func: ELF64NAME2(svr4,probe) },
|
|
|
|
&emul_svr4, EXECSW_PRIO_ANY,
|
|
|
|
SVR4_AUX_ARGSIZ64,
|
|
|
|
svr4_copyargs64, svr4_setregs }, /* SVR4 64bit ELF bins (not 64bit safe) */
|
2000-11-21 03:37:49 +03:00
|
|
|
#endif
|
|
|
|
{ sizeof (Elf64_Ehdr), exec_elf64_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
|
|
|
|
elf64_copyargs, setregs }, /* NetBSD 64bit ELF bins */
|
|
|
|
#endif /* EXEC_ELF64 */
|
1997-12-04 18:33:17 +03:00
|
|
|
#ifdef COMPAT_SUNOS
|
2001-02-02 10:30:22 +03:00
|
|
|
#ifdef COMPAT_NETBSD32
|
|
|
|
{ SUNOS32_AOUT_HDR_SIZE, exec_sunos32_aout_makecmds, { NULL },
|
|
|
|
&emul_sunos, EXECSW_PRIO_ANY,
|
|
|
|
0, netbsd32_copyargs, netbsd32_setregs }, /* SunOS a.out, 64-bit kernel */
|
|
|
|
#else
|
2000-11-21 03:37:49 +03:00
|
|
|
{ SUNOS_AOUT_HDR_SIZE, exec_sunos_aout_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_sunos, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, setregs }, /* SunOS a.out */
|
1997-12-04 18:33:17 +03:00
|
|
|
#endif
|
2001-02-02 10:30:22 +03:00
|
|
|
#endif
|
1998-10-01 19:55:34 +04:00
|
|
|
#if defined(COMPAT_LINUX) && defined(EXEC_AOUT)
|
2000-11-21 03:37:49 +03:00
|
|
|
{ LINUX_AOUT_HDR_SIZE, exec_linux_aout_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_linux, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
LINUX_AOUT_AUX_ARGSIZ, linux_aout_copyargs, linux_setregs }, /* linux a.out */
|
1995-03-01 02:06:21 +03:00
|
|
|
#endif
|
1994-08-16 02:17:16 +04:00
|
|
|
#ifdef COMPAT_IBCS2
|
2000-11-21 03:37:49 +03:00
|
|
|
{ COFF_HDR_SIZE, exec_ibcs2_coff_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_ibcs2, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, ibcs2_setregs }, /* coff binaries */
|
|
|
|
{ XOUT_HDR_SIZE, exec_ibcs2_xout_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_ibcs2, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, ibcs2_setregs }, /* x.out binaries */
|
1994-08-16 02:17:16 +04:00
|
|
|
#endif
|
1999-02-23 21:19:29 +03:00
|
|
|
#if defined(COMPAT_FREEBSD) && defined(EXEC_AOUT)
|
2000-11-21 03:37:49 +03:00
|
|
|
{ FREEBSD_AOUT_HDR_SIZE, exec_freebsd_aout_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_freebsd, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, freebsd_setregs }, /* a.out */
|
1995-10-10 04:26:36 +03:00
|
|
|
#endif
|
1995-11-28 11:07:25 +03:00
|
|
|
#ifdef COMPAT_HPUX
|
2000-11-21 03:37:49 +03:00
|
|
|
{ HPUX_EXEC_HDR_SIZE, exec_hpux_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_hpux, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, hpux_setregs }, /* HP-UX a.out */
|
1995-11-28 11:07:25 +03:00
|
|
|
#endif
|
1996-09-11 02:05:03 +04:00
|
|
|
#ifdef COMPAT_M68K4K
|
2000-11-21 03:37:49 +03:00
|
|
|
{ sizeof(struct exec), exec_m68k4k_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, setregs }, /* m68k4k a.out */
|
1996-09-11 02:05:03 +04:00
|
|
|
#endif
|
1998-08-21 17:41:09 +04:00
|
|
|
#ifdef COMPAT_VAX1K
|
2000-11-21 03:37:49 +03:00
|
|
|
{ sizeof(struct exec), exec_vax1k_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd, EXECSW_PRIO_ANY,
|
2000-11-21 03:37:49 +03:00
|
|
|
0, copyargs, setregs }, /* vax1k a.out */
|
1998-08-21 17:41:09 +04:00
|
|
|
#endif
|
2000-06-04 20:26:11 +04:00
|
|
|
#ifdef COMPAT_PECOFF
|
2000-11-21 03:37:49 +03:00
|
|
|
{ sizeof(struct exec), exec_pecoff_makecmds, { NULL },
|
2000-12-01 15:57:55 +03:00
|
|
|
&emul_netbsd, EXECSW_PRIO_ANY, /* XXX emul_pecoff once it's different */
|
2000-11-21 03:37:49 +03:00
|
|
|
howmany(sizeof(struct pecoff_args), sizeof(char *)),
|
|
|
|
pecoff_copyargs, setregs }, /* Win32/CE PE/COFF */
|
2000-06-04 20:26:11 +04:00
|
|
|
#endif
|
1994-01-16 06:09:59 +03:00
|
|
|
};
|
2000-12-08 22:42:11 +03:00
|
|
|
int nexecs_builtin = (sizeof(execsw_builtin) / sizeof(struct execsw));
|