The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/kern/exec_conf.c

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: exec_conf.c,v 1.84 2003/10/19 07:52:22 manu Exp $      */
    2 
    3 /*
    4  * Copyright (c) 1993, 1994 Christopher G. Demetriou
    5  * All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. Redistributions in binary form must reproduce the above copyright
   13  *    notice, this list of conditions and the following disclaimer in the
   14  *    documentation and/or other materials provided with the distribution.
   15  * 3. All advertising materials mentioning features or use of this software
   16  *    must display the following acknowledgement:
   17  *      This product includes software developed by Christopher G. Demetriou.
   18  * 4. The name of the author may not be used to endorse or promote products
   19  *    derived from this software without specific prior written permission
   20  *
   21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   31  */
   32 
   33 #include <sys/cdefs.h>
   34 __KERNEL_RCSID(0, "$NetBSD: exec_conf.c,v 1.84 2003/10/19 07:52:22 manu Exp $");
   35 
   36 #include "opt_execfmt.h"
   37 #include "opt_compat_freebsd.h"
   38 #include "opt_compat_linux.h"
   39 #include "opt_compat_ibcs2.h"
   40 #include "opt_compat_irix.h"
   41 #include "opt_compat_sunos.h"
   42 #include "opt_compat_hpux.h"
   43 #include "opt_compat_m68k4k.h"
   44 #include "opt_compat_mach.h"
   45 #include "opt_compat_darwin.h"
   46 #include "opt_compat_svr4.h"
   47 #include "opt_compat_netbsd32.h"
   48 #include "opt_compat_aout.h"
   49 #include "opt_compat_aout_m68k.h"
   50 #include "opt_compat_vax1k.h"
   51 #include "opt_compat_pecoff.h"
   52 #include "opt_compat_osf1.h"
   53 #include "opt_compat_ultrix.h"
   54 #include "opt_compat_netbsd.h"
   55 
   56 #include <sys/param.h>
   57 #include <sys/exec.h>
   58 #include <sys/signalvar.h>
   59 
   60 #ifdef EXEC_SCRIPT
   61 #include <sys/exec_script.h>
   62 #endif
   63 
   64 #ifdef EXEC_AOUT
   65 /*#include <sys/exec_aout.h> -- automatically pulled in */
   66 #endif
   67 
   68 #ifdef EXEC_COFF
   69 #include <sys/exec_coff.h>
   70 #endif
   71 
   72 #ifdef EXEC_ECOFF
   73 #include <sys/exec_ecoff.h>
   74 #endif
   75 
   76 #if defined(EXEC_ELF32) || defined(EXEC_ELF64)
   77 #include <sys/exec_elf.h>
   78 #define CONCAT(x,y)     __CONCAT(x,y)
   79 #define ELF32NAME(x)    CONCAT(elf,CONCAT(32,CONCAT(_,x)))
   80 #define ELF32NAME2(x,y) CONCAT(x,CONCAT(_elf32_,y))
   81 #define ELF64NAME(x)    CONCAT(elf,CONCAT(64,CONCAT(_,x)))
   82 #define ELF64NAME2(x,y) CONCAT(x,CONCAT(_elf64_,y))
   83 #ifdef EXEC_ELF32
   84 int ELF32NAME2(netbsd,probe)(struct proc *, struct exec_package *,
   85     void *, char *, vaddr_t *);
   86 #endif
   87 #ifdef EXEC_ELF64
   88 int ELF64NAME2(netbsd,probe)(struct proc *, struct exec_package *,
   89     void *, char *, vaddr_t *);
   90 #endif
   91 
   92 /*
   93  * Compatibility with old ELF binaries without NetBSD note.
   94  * Generic ELF executable kernel support was added in NetBSD 1.1.
   95  * The NetBSD note was introduced in NetBSD 1.3 together with initial
   96  * ELF shared library support.
   97  */
   98 #ifndef EXEC_ELF_NOTELESS
   99 #  if defined(COMPAT_11) || defined(COMPAT_12)
  100 #    define EXEC_ELF_NOTELESS           1
  101 #  endif
  102 #endif /* !EXEC_ELF_NOTELESS */
  103 
  104 #endif /* ELF32 || ELF64 */
  105 
  106 #ifdef EXEC_MACHO
  107 #include <sys/exec_macho.h>
  108 #endif
  109 
  110 #ifdef COMPAT_SUNOS
  111 #include <compat/sunos/sunos_exec.h>
  112 #endif
  113 
  114 #if defined(COMPAT_SVR4) || defined(COMPAT_SVR4_32)
  115 #include <compat/svr4/svr4_exec.h>
  116 #endif
  117 
  118 #ifdef COMPAT_SVR4_32
  119 #include <compat/svr4_32/svr4_32_exec.h>
  120 #endif
  121 
  122 #ifdef COMPAT_IBCS2
  123 #include <sys/exec_coff.h>
  124 #include <compat/ibcs2/ibcs2_exec.h>
  125 #include <machine/ibcs2_machdep.h>
  126 #endif
  127 
  128 #ifdef COMPAT_LINUX
  129 #include <compat/linux/common/linux_exec.h>
  130 #endif
  131 
  132 #ifdef COMPAT_DARWIN
  133 #include <compat/darwin/darwin_exec.h>
  134 #endif
  135 
  136 #ifdef COMPAT_FREEBSD
  137 #include <compat/freebsd/freebsd_exec.h>
  138 #endif
  139 
  140 #ifdef COMPAT_HPUX
  141 #include <compat/hpux/hpux_exec.h>
  142 #endif
  143 
  144 #ifdef COMPAT_M68K4K
  145 #include <compat/m68k4k/m68k4k_exec.h>
  146 #endif
  147 
  148 #ifdef COMPAT_MACH
  149 #include <compat/mach/mach_exec.h>
  150 #endif
  151 
  152 #ifdef COMPAT_IRIX
  153 #include <compat/irix/irix_exec.h>
  154 #endif
  155 
  156 #ifdef COMPAT_NETBSD32
  157 #include <compat/netbsd32/netbsd32_exec.h>
  158 #ifdef COMPAT_SUNOS
  159 #include <compat/sunos32/sunos32_exec.h>
  160 #endif
  161 #endif
  162 
  163 #ifdef COMPAT_VAX1K
  164 #include <compat/vax1k/vax1k_exec.h>
  165 #endif
  166 
  167 #ifdef COMPAT_PECOFF
  168 #include <sys/exec_coff.h>
  169 #include <compat/pecoff/pecoff_exec.h>
  170 #endif
  171 
  172 #ifdef COMPAT_OSF1
  173 #include <compat/osf1/osf1.h>
  174 #include <compat/osf1/osf1_exec.h>
  175 #endif
  176 
  177 #ifdef COMPAT_ULTRIX
  178 #include <compat/ultrix/ultrix_exec.h>
  179 #endif
  180 
  181 extern const struct emul emul_netbsd;
  182 #ifdef COMPAT_AOUT
  183 extern const struct emul emul_netbsd_aout;
  184 #endif
  185 #ifdef COMPAT_AOUT_M68K
  186 extern const struct emul emul_netbsd_aoutm68k;
  187 #endif
  188 
  189 const struct execsw execsw_builtin[] = {
  190 #ifdef EXEC_SCRIPT
  191         /* Shell scripts */
  192         { SCRIPT_HDR_SIZE,
  193           exec_script_makecmds,
  194           { NULL },
  195           NULL,
  196           EXECSW_PRIO_ANY,
  197           0,
  198           NULL,
  199           NULL,
  200           NULL,
  201           exec_setup_stack },
  202 #endif /* EXEC_SCRIPT */
  203 
  204 #ifdef EXEC_AOUT
  205 #ifdef COMPAT_NETBSD32
  206         /* 32-bit NetBSD a.out on 64-bit */
  207         { sizeof(struct netbsd32_exec),
  208           exec_netbsd32_makecmds,
  209           { NULL },
  210           &emul_netbsd32,
  211           EXECSW_PRIO_FIRST,
  212           0,
  213           netbsd32_copyargs,
  214           NULL,
  215           coredump_netbsd32,
  216           exec_setup_stack },
  217 #else /* !COMPAT_NETBSD32 */
  218 
  219         /* Native a.out */
  220         { sizeof(struct exec),
  221           exec_aout_makecmds,
  222           { NULL },
  223 #ifdef COMPAT_AOUT
  224           &emul_netbsd_aout,
  225 #elif defined(COMPAT_AOUT_M68K)
  226           &emul_netbsd_aoutm68k,
  227 #else
  228           &emul_netbsd,
  229 #endif
  230           EXECSW_PRIO_ANY,
  231           0,
  232           copyargs,
  233           NULL,
  234           coredump_netbsd,
  235           exec_setup_stack },
  236 #endif /* !COMPAT_NETBSD32 */
  237 #endif /* EXEC_AOUT */
  238 
  239 #ifdef EXEC_COFF
  240         /* Native COFF */
  241         { COFF_HDR_SIZE,
  242           exec_coff_makecmds,
  243           { NULL },
  244           &emul_netbsd,
  245           EXECSW_PRIO_ANY,
  246           0,
  247           copyargs,
  248           NULL,
  249           coredump_netbsd,
  250           exec_setup_stack },
  251 #endif /* EXEC_COFF */
  252 
  253 #ifdef EXEC_ECOFF
  254 #ifdef COMPAT_OSF1
  255         /* OSF/1 (Digital Unix) ECOFF */
  256         { ECOFF_HDR_SIZE,
  257           exec_ecoff_makecmds,
  258           { .ecoff_probe_func = osf1_exec_ecoff_probe },
  259           &emul_osf1,
  260           EXECSW_PRIO_ANY,
  261           howmany(OSF1_MAX_AUX_ENTRIES * sizeof (struct osf1_auxv) +
  262             2 * (MAXPATHLEN + 1), sizeof (char *)), /* exec & loader names */
  263           osf1_copyargs,
  264           cpu_exec_ecoff_setregs,
  265           coredump_netbsd,
  266           exec_setup_stack },
  267 #endif
  268 
  269         /* Native ECOFF */
  270         { ECOFF_HDR_SIZE,
  271           exec_ecoff_makecmds,
  272           { .ecoff_probe_func = cpu_exec_ecoff_probe },
  273           &emul_netbsd,
  274           EXECSW_PRIO_ANY,
  275           0,
  276           copyargs,
  277           cpu_exec_ecoff_setregs,
  278           coredump_netbsd,
  279           exec_setup_stack },
  280 
  281 #ifdef COMPAT_ULTRIX
  282         /* Ultrix ECOFF */
  283         { ECOFF_HDR_SIZE,
  284           exec_ecoff_makecmds,
  285           { .ecoff_probe_func = ultrix_exec_ecoff_probe },
  286           &emul_ultrix,
  287           EXECSW_PRIO_LAST, /* XXX probe func alw. succeeds */
  288           0,
  289           copyargs,
  290           cpu_exec_ecoff_setregs,
  291           coredump_netbsd,
  292           exec_setup_stack },
  293 #endif
  294 #endif /* EXEC_ECOFF */
  295 
  296 #ifdef EXEC_ELF32
  297 #ifdef COMPAT_NETBSD32
  298         /* Elf32 NetBSD on 64-bit */
  299         { sizeof (Elf32_Ehdr),
  300           exec_elf32_makecmds,
  301           { ELF32NAME2(netbsd32,probe) },
  302           &emul_netbsd32,
  303           EXECSW_PRIO_FIRST,
  304           howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
  305           netbsd32_elf32_copyargs,
  306           NULL,
  307           coredump_elf32,
  308           exec_setup_stack },           /* XXX XXX XXX */
  309           /* This one should go first so it matches instead of native */
  310 
  311 #ifdef COMPAT_SVR4_32
  312         /* SVR4 Elf32 on 64-bit */
  313         { sizeof (Elf32_Ehdr),
  314           exec_elf32_makecmds,
  315           { ELF32NAME2(svr4_32,probe) },
  316           &emul_svr4_32,
  317           EXECSW_PRIO_ANY,
  318           SVR4_32_AUX_ARGSIZ,
  319           svr4_32_copyargs,
  320           NULL,
  321           coredump_elf32,
  322           exec_setup_stack },   /* XXX XXX XXX */
  323           /* This one should go first so it matches instead of native */
  324 #endif
  325 
  326 #if 0
  327 #if EXEC_ELF_NOTELESS
  328         /* Generic compat Elf32 -- run as compat NetBSD Elf32 */
  329         { sizeof (Elf32_Ehdr),
  330           exec_elf32_makecmds,
  331           { ELF32NAME2(netbsd32,probe_noteless) },
  332           &emul_netbsd32,
  333           EXECSW_PRIO_FIRST,
  334           howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
  335           netbsd32_elf32_copyargs,
  336           NULL,
  337           coredump_elf32,
  338           exec_setup_stack },           /* XXX XXX XXX */
  339 #endif
  340 #endif
  341 #else /* !COMPAT_NETBSD32 */
  342 
  343         /* Native Elf32 */
  344         { sizeof (Elf32_Ehdr),
  345           exec_elf32_makecmds,
  346           { ELF32NAME2(netbsd,probe) },
  347           &emul_netbsd,
  348           EXECSW_PRIO_ANY,
  349           howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
  350           elf32_copyargs,
  351           NULL,
  352           coredump_elf32,
  353           exec_setup_stack },
  354 
  355 #ifdef COMPAT_FREEBSD
  356         /* FreeBSD Elf32 (probe not 64-bit safe) */
  357         { sizeof (Elf32_Ehdr),
  358           exec_elf32_makecmds,
  359           { ELF32NAME2(freebsd,probe) },
  360           &emul_freebsd,
  361           EXECSW_PRIO_ANY,
  362           howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof(Elf32_Addr)),
  363           elf32_copyargs,
  364           NULL,
  365           coredump_elf32,
  366           exec_setup_stack },
  367 #endif
  368 
  369 #ifdef COMPAT_LINUX
  370         /* Linux Elf32 */
  371         { sizeof (Elf32_Ehdr),
  372           exec_elf32_makecmds,
  373           { ELF32NAME2(linux,probe) },
  374           &emul_linux,
  375           EXECSW_PRIO_ANY,
  376           LINUX_ELF_AUX_ARGSIZ,
  377           linux_elf32_copyargs,
  378           NULL,
  379           coredump_elf32,
  380           linux_exec_setup_stack },
  381 #endif
  382 
  383 #ifdef COMPAT_IRIX 
  384         /* IRIX Elf32 n32 ABI */
  385         { sizeof (Elf32_Ehdr),
  386           exec_elf32_makecmds,
  387           { ELF32NAME2(irix,probe_n32) },
  388           &emul_irix,
  389           EXECSW_PRIO_ANY,
  390           IRIX_AUX_ARGSIZ,
  391           irix_elf32_copyargs,
  392           irix_n32_setregs,
  393           coredump_elf32,
  394           exec_setup_stack },
  395 
  396         /* IRIX Elf32 o32 ABI */
  397         { sizeof (Elf32_Ehdr),
  398           exec_elf32_makecmds,
  399           { ELF32NAME2(irix,probe_o32) },
  400           &emul_irix,
  401           EXECSW_PRIO_ANY,
  402           IRIX_AUX_ARGSIZ,
  403           irix_elf32_copyargs,
  404           NULL,
  405           coredump_elf32,
  406           exec_setup_stack },
  407 #endif
  408 
  409 #ifdef COMPAT_SVR4
  410         /* SVR4 Elf32 */
  411         { sizeof (Elf32_Ehdr),
  412           exec_elf32_makecmds,
  413           { ELF32NAME2(svr4,probe) },
  414           &emul_svr4,
  415           EXECSW_PRIO_ANY,
  416           howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
  417           elf32_copyargs,
  418           NULL,
  419           coredump_elf32,
  420           exec_setup_stack },
  421 #endif
  422 
  423 #ifdef COMPAT_IBCS2
  424         /* SCO Elf32 */
  425         { sizeof (Elf32_Ehdr),
  426           exec_elf32_makecmds,
  427           { ELF32NAME2(ibcs2,probe) },
  428           &emul_ibcs2,
  429           EXECSW_PRIO_ANY,
  430           howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
  431           elf32_copyargs,
  432           NULL,
  433           coredump_elf32,
  434           exec_setup_stack },
  435 #endif
  436 
  437 #if EXEC_ELF_NOTELESS
  438         /* Generic Elf32 -- run at NetBSD Elf32 */
  439         { sizeof (Elf32_Ehdr),
  440           exec_elf32_makecmds,
  441           { NULL },
  442           &emul_netbsd,
  443           EXECSW_PRIO_LAST,
  444           howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
  445           elf32_copyargs,
  446           NULL,
  447           coredump_elf32,
  448           exec_setup_stack },
  449 #endif
  450 #endif /* !COMPAT_NETBSD32 */
  451 #endif /* EXEC_ELF32 */
  452 
  453 #ifdef EXEC_ELF64
  454         /* Native Elf64 */
  455         { sizeof (Elf64_Ehdr),
  456           exec_elf64_makecmds,
  457           { ELF64NAME2(netbsd,probe) },
  458           &emul_netbsd,
  459           EXECSW_PRIO_ANY,
  460           howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
  461           elf64_copyargs,
  462           NULL,
  463           coredump_elf64,
  464           exec_setup_stack },
  465 
  466 #ifdef COMPAT_LINUX
  467         /* Linux Elf64 */
  468         { sizeof (Elf64_Ehdr),
  469           exec_elf64_makecmds,
  470           { ELF64NAME2(linux,probe) },
  471           &emul_linux,
  472           EXECSW_PRIO_ANY,
  473           LINUX_ELF_AUX_ARGSIZ,
  474           linux_elf64_copyargs,
  475           NULL,
  476           coredump_elf64,
  477           exec_setup_stack },
  478 #endif
  479 
  480 #ifdef COMPAT_SVR4
  481         /* SVR4 Elf64 */
  482         { sizeof (Elf64_Ehdr),
  483           exec_elf64_makecmds,
  484           { ELF64NAME2(svr4,probe) },
  485           &emul_svr4,
  486           EXECSW_PRIO_ANY,
  487           howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
  488           elf64_copyargs,
  489           NULL,
  490           coredump_elf64,
  491           exec_setup_stack },
  492 #endif
  493 
  494 #if EXEC_ELF_NOTELESS
  495         /* Generic Elf64 -- run at NetBSD Elf64 */
  496         { sizeof (Elf64_Ehdr),
  497           exec_elf64_makecmds,
  498           { NULL },
  499           &emul_netbsd,
  500           EXECSW_PRIO_ANY,
  501           howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
  502           elf64_copyargs,
  503           NULL,
  504           coredump_elf64,
  505           exec_setup_stack },
  506 #endif
  507 #endif /* EXEC_ELF64 */
  508 
  509 #if defined(EXEC_MACHO)
  510 #ifdef COMPAT_DARWIN
  511         /* Darwin Mach-O (native word size) */
  512         { sizeof (struct exec_macho_fat_header),
  513           exec_macho_makecmds,
  514           { .mach_probe_func = exec_darwin_probe },
  515           &emul_darwin,
  516           EXECSW_PRIO_ANY,
  517           MAXPATHLEN + 1,
  518           exec_darwin_copyargs,
  519           NULL,
  520           coredump_netbsd,
  521           exec_setup_stack },
  522 #endif
  523 
  524 #ifdef COMPAT_MACH
  525         /* Mach MACH-O (native word size) */
  526         { sizeof (struct exec_macho_fat_header),
  527           exec_macho_makecmds,
  528           { .mach_probe_func = exec_mach_probe },
  529           &emul_mach,
  530           EXECSW_PRIO_ANY,
  531           MAXPATHLEN + 1,
  532           exec_mach_copyargs,
  533           NULL,
  534           coredump_netbsd,
  535           exec_setup_stack },
  536 #endif
  537 #endif /* EXEC_MACHO */
  538 
  539 #ifdef COMPAT_SUNOS
  540 #ifdef COMPAT_NETBSD32
  541         /* 32-bit SunOS a.out on 64-bit */
  542         { SUNOS32_AOUT_HDR_SIZE,
  543           exec_sunos32_aout_makecmds,
  544           { NULL },
  545           &emul_sunos,
  546           EXECSW_PRIO_ANY,
  547           0,
  548           netbsd32_copyargs,
  549           NULL,
  550           coredump_netbsd,
  551           exec_setup_stack },
  552 #else
  553         /* SunOS a.out (native word size) */
  554         { SUNOS_AOUT_HDR_SIZE,
  555           exec_sunos_aout_makecmds,
  556           { NULL },
  557           &emul_sunos,
  558           EXECSW_PRIO_ANY,
  559           0,
  560           copyargs,
  561           NULL,
  562           coredump_netbsd,
  563           exec_setup_stack },
  564 #endif
  565 #endif /* COMPAT_SUNOS */
  566 
  567 #if defined(COMPAT_LINUX) && defined(EXEC_AOUT)
  568         /* Linux a.out (native word size) */
  569         { LINUX_AOUT_HDR_SIZE,
  570           exec_linux_aout_makecmds,
  571           { NULL },
  572           &emul_linux,
  573           EXECSW_PRIO_ANY,
  574           LINUX_AOUT_AUX_ARGSIZ,
  575           linux_aout_copyargs,
  576           NULL,
  577           coredump_netbsd,
  578           linux_exec_setup_stack },
  579 #endif
  580 
  581 #ifdef COMPAT_IBCS2
  582         /* iBCS2 COFF (native word size) */
  583         { COFF_HDR_SIZE,
  584           exec_ibcs2_coff_makecmds,
  585           { NULL },
  586           &emul_ibcs2,
  587           EXECSW_PRIO_ANY,
  588           0,
  589           copyargs,
  590           NULL,
  591           coredump_netbsd,
  592           exec_setup_stack },
  593 
  594         /* iBCS2 x.out (native word size) */
  595         { XOUT_HDR_SIZE,
  596           exec_ibcs2_xout_makecmds,
  597           { NULL },
  598           &emul_ibcs2,
  599           EXECSW_PRIO_ANY,
  600           0,
  601           copyargs,
  602           NULL,
  603           coredump_netbsd,
  604           exec_setup_stack },
  605 #endif
  606 
  607 #if defined(COMPAT_FREEBSD) && defined(EXEC_AOUT)
  608         /* FreeBSD a.out (native word size) */
  609         { FREEBSD_AOUT_HDR_SIZE,
  610           exec_freebsd_aout_makecmds,
  611           { NULL },
  612           &emul_freebsd,
  613           EXECSW_PRIO_ANY,
  614           0,
  615           copyargs,
  616           NULL,
  617           coredump_netbsd,
  618           exec_setup_stack },
  619 #endif
  620 
  621 #ifdef COMPAT_HPUX
  622         /* HP-UX a.out for m68k (native word size) */
  623         { HPUX_EXEC_HDR_SIZE,
  624           exec_hpux_makecmds,
  625           { NULL },
  626           &emul_hpux,
  627           EXECSW_PRIO_ANY,
  628           0,
  629           copyargs,
  630           NULL,
  631           coredump_netbsd,
  632           exec_setup_stack },
  633 #endif
  634 
  635 #ifdef COMPAT_M68K4K
  636         /* NetBSD a.out for m68k4k */
  637         { sizeof(struct exec),
  638           exec_m68k4k_makecmds,
  639           { NULL },
  640           &emul_netbsd,
  641           EXECSW_PRIO_ANY,
  642           0,
  643           copyargs,
  644           NULL,
  645           coredump_netbsd,
  646           exec_setup_stack },
  647 #endif
  648 
  649 #ifdef COMPAT_VAX1K
  650         /* NetBSD vax1k a.out */
  651         { sizeof(struct exec),
  652           exec_vax1k_makecmds,
  653           { NULL },
  654           &emul_netbsd,
  655           EXECSW_PRIO_ANY,
  656           0,
  657           copyargs,
  658           NULL,
  659           coredump_netbsd,
  660           exec_setup_stack },
  661 #endif
  662 
  663 #ifdef COMPAT_PECOFF
  664         /* Win32/WinCE PE/COFF (native word size) */
  665         { PECOFF_HDR_SIZE,
  666           exec_pecoff_makecmds,
  667           { NULL },
  668           &emul_pecoff,
  669           EXECSW_PRIO_ANY,
  670           howmany(sizeof(struct pecoff_args), sizeof(char *)),
  671           pecoff_copyargs,
  672           NULL,
  673           coredump_netbsd,
  674           exec_setup_stack },
  675 #endif
  676 };
  677 int nexecs_builtin = (sizeof(execsw_builtin) / sizeof(struct execsw));

Cache object: ff244021fb440ee70c4a22f3c6eb2aa2


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.