FreeBSD/Linux Kernel Cross Reference
sys/kern/exec_conf.c
1 /* $NetBSD: exec_conf.c,v 1.93 2006/08/30 14:41:06 cube 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.93 2006/08/30 14:41:06 cube 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_linux32.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 #include "opt_coredump.h"
56
57 #include <sys/param.h>
58 #include <sys/exec.h>
59 #include <sys/signalvar.h>
60
61 #ifdef EXEC_SCRIPT
62 #include <sys/exec_script.h>
63 #endif
64
65 #ifdef EXEC_AOUT
66 /*#include <sys/exec_aout.h> -- automatically pulled in */
67 #endif
68
69 #ifdef EXEC_COFF
70 #include <sys/exec_coff.h>
71 #endif
72
73 #ifdef EXEC_ECOFF
74 #include <sys/exec_ecoff.h>
75 #endif
76
77 #if defined(EXEC_ELF32) || defined(EXEC_ELF64)
78 #include <sys/exec_elf.h>
79 #define CONCAT(x,y) __CONCAT(x,y)
80 #define ELF32NAME(x) CONCAT(elf,CONCAT(32,CONCAT(_,x)))
81 #define ELF32NAME2(x,y) CONCAT(x,CONCAT(_elf32_,y))
82 #define ELF64NAME(x) CONCAT(elf,CONCAT(64,CONCAT(_,x)))
83 #define ELF64NAME2(x,y) CONCAT(x,CONCAT(_elf64_,y))
84 #ifdef EXEC_ELF32
85 int ELF32NAME2(netbsd,probe)(struct lwp *, struct exec_package *,
86 void *, char *, vaddr_t *);
87 #endif
88 #ifdef EXEC_ELF64
89 int ELF64NAME2(netbsd,probe)(struct lwp *, struct exec_package *,
90 void *, char *, vaddr_t *);
91 #endif
92
93 /*
94 * Compatibility with old ELF binaries without NetBSD note.
95 * Generic ELF executable kernel support was added in NetBSD 1.1.
96 * The NetBSD note was introduced in NetBSD 1.3 together with initial
97 * ELF shared library support.
98 */
99 #ifndef EXEC_ELF_NOTELESS
100 # if defined(COMPAT_11) || defined(COMPAT_12)
101 # define EXEC_ELF_NOTELESS 1
102 # endif
103 #endif /* !EXEC_ELF_NOTELESS */
104
105 #endif /* ELF32 || ELF64 */
106
107 #ifdef EXEC_MACHO
108 #include <sys/exec_macho.h>
109 #endif
110
111 #ifdef COMPAT_SUNOS
112 #include <compat/sunos/sunos_exec.h>
113 #endif
114
115 #if defined(COMPAT_SVR4) || defined(COMPAT_SVR4_32)
116 #include <compat/svr4/svr4_exec.h>
117 #endif
118
119 #ifdef COMPAT_SVR4_32
120 #include <compat/svr4_32/svr4_32_exec.h>
121 #endif
122
123 #ifdef COMPAT_IBCS2
124 #include <sys/exec_coff.h>
125 #include <compat/ibcs2/ibcs2_exec.h>
126 #include <machine/ibcs2_machdep.h>
127 #endif
128
129 #ifdef COMPAT_LINUX
130 #include <compat/linux/common/linux_exec.h>
131 #endif
132
133 #ifdef COMPAT_DARWIN
134 #include <compat/darwin/darwin_exec.h>
135 #endif
136
137 #ifdef COMPAT_FREEBSD
138 #include <compat/freebsd/freebsd_exec.h>
139 #endif
140
141 #ifdef COMPAT_HPUX
142 #include <compat/hpux/hpux_exec.h>
143 #endif
144
145 #ifdef COMPAT_M68K4K
146 #include <compat/m68k4k/m68k4k_exec.h>
147 #endif
148
149 #ifdef COMPAT_MACH
150 #include <compat/mach/mach_exec.h>
151 #endif
152
153 #ifdef COMPAT_IRIX
154 #include <compat/irix/irix_exec.h>
155 #endif
156
157 #ifdef COMPAT_NETBSD32
158 #include <compat/netbsd32/netbsd32_exec.h>
159 #ifdef COMPAT_SUNOS
160 #include <compat/sunos32/sunos32_exec.h>
161 #endif
162 #ifdef COMPAT_LINUX32
163 #include <compat/linux32/common/linux32_exec.h>
164 #endif
165 #endif
166
167 #ifdef COMPAT_VAX1K
168 #include <compat/vax1k/vax1k_exec.h>
169 #endif
170
171 #ifdef COMPAT_PECOFF
172 #include <sys/exec_coff.h>
173 #include <compat/pecoff/pecoff_exec.h>
174 #endif
175
176 #ifdef COMPAT_OSF1
177 #include <compat/osf1/osf1.h>
178 #include <compat/osf1/osf1_exec.h>
179 #endif
180
181 #ifdef COMPAT_ULTRIX
182 #include <compat/ultrix/ultrix_exec.h>
183 #endif
184
185 extern const struct emul emul_netbsd;
186 #ifdef COMPAT_AOUT_M68K
187 extern const struct emul emul_netbsd_aoutm68k;
188 #endif
189
190 const struct execsw execsw_builtin[] = {
191 #ifdef EXEC_SCRIPT
192 /* Shell scripts */
193 { SCRIPT_HDR_SIZE,
194 exec_script_makecmds,
195 { NULL },
196 NULL,
197 EXECSW_PRIO_ANY,
198 0,
199 NULL,
200 NULL,
201 NULL,
202 exec_setup_stack },
203 #endif /* EXEC_SCRIPT */
204
205 #ifdef EXEC_AOUT
206 #ifdef COMPAT_NETBSD32
207 /* 32-bit NetBSD a.out on 64-bit */
208 { sizeof(struct netbsd32_exec),
209 exec_netbsd32_makecmds,
210 { NULL },
211 &emul_netbsd32,
212 EXECSW_PRIO_FIRST,
213 0,
214 netbsd32_copyargs,
215 NULL,
216 #ifdef COREDUMP
217 coredump_netbsd32,
218 #else
219 NULL,
220 #endif
221 exec_setup_stack },
222 #else /* !COMPAT_NETBSD32 */
223
224 /* Native a.out */
225 { sizeof(struct exec),
226 exec_aout_makecmds,
227 { NULL },
228 #if defined(COMPAT_AOUT_M68K)
229 &emul_netbsd_aoutm68k,
230 #else
231 &emul_netbsd,
232 #endif
233 EXECSW_PRIO_ANY,
234 0,
235 copyargs,
236 NULL,
237 #ifdef COREDUMP
238 coredump_netbsd,
239 #else
240 NULL,
241 #endif
242 exec_setup_stack },
243 #endif /* !COMPAT_NETBSD32 */
244 #endif /* EXEC_AOUT */
245
246 #ifdef EXEC_COFF
247 /* Native COFF */
248 { COFF_HDR_SIZE,
249 exec_coff_makecmds,
250 { NULL },
251 &emul_netbsd,
252 EXECSW_PRIO_ANY,
253 0,
254 copyargs,
255 NULL,
256 #ifdef COREDUMP
257 coredump_netbsd,
258 #else
259 NULL,
260 #endif
261 exec_setup_stack },
262 #endif /* EXEC_COFF */
263
264 #ifdef EXEC_ECOFF
265 #ifdef COMPAT_OSF1
266 /* OSF/1 (Digital Unix) ECOFF */
267 { ECOFF_HDR_SIZE,
268 exec_ecoff_makecmds,
269 { .ecoff_probe_func = osf1_exec_ecoff_probe },
270 &emul_osf1,
271 EXECSW_PRIO_ANY,
272 howmany(OSF1_MAX_AUX_ENTRIES * sizeof (struct osf1_auxv) +
273 2 * (MAXPATHLEN + 1), sizeof (char *)), /* exec & loader names */
274 osf1_copyargs,
275 cpu_exec_ecoff_setregs,
276 #ifdef COREDUMP
277 coredump_netbsd,
278 #else
279 NULL,
280 #endif
281 exec_setup_stack },
282 #endif
283
284 /* Native ECOFF */
285 { ECOFF_HDR_SIZE,
286 exec_ecoff_makecmds,
287 { .ecoff_probe_func = cpu_exec_ecoff_probe },
288 &emul_netbsd,
289 EXECSW_PRIO_ANY,
290 0,
291 copyargs,
292 cpu_exec_ecoff_setregs,
293 #ifdef COREDUMP
294 coredump_netbsd,
295 #else
296 NULL,
297 #endif
298 exec_setup_stack },
299
300 #ifdef COMPAT_ULTRIX
301 /* Ultrix ECOFF */
302 { ECOFF_HDR_SIZE,
303 exec_ecoff_makecmds,
304 { .ecoff_probe_func = ultrix_exec_ecoff_probe },
305 &emul_ultrix,
306 EXECSW_PRIO_LAST, /* XXX probe func alw. succeeds */
307 0,
308 copyargs,
309 cpu_exec_ecoff_setregs,
310 #ifdef COREDUMP
311 coredump_netbsd,
312 #else
313 NULL,
314 #endif
315 exec_setup_stack },
316 #endif
317 #endif /* EXEC_ECOFF */
318
319 #ifdef EXEC_ELF32
320 #ifdef COMPAT_NETBSD32
321 /* Elf32 NetBSD on 64-bit */
322 { sizeof (Elf32_Ehdr),
323 exec_elf32_makecmds,
324 { ELF32NAME2(netbsd32,probe) },
325 &emul_netbsd32,
326 EXECSW_PRIO_FIRST,
327 howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
328 netbsd32_elf32_copyargs,
329 NULL,
330 #ifdef COREDUMP
331 coredump_elf32,
332 #else
333 NULL,
334 #endif
335 exec_setup_stack }, /* XXX XXX XXX */
336 /* This one should go first so it matches instead of native */
337
338 #ifdef COMPAT_LINUX32
339 /* Linux Elf32 on 64-bit */
340 { sizeof (Elf32_Ehdr),
341 exec_elf32_makecmds,
342 { ELF32NAME2(linux32,probe) },
343 &emul_linux32,
344 EXECSW_PRIO_FIRST,
345 LINUX32_ELF_AUX_ARGSIZ,
346 linux32_elf32_copyargs,
347 NULL,
348 #ifdef COREDUMP
349 coredump_elf32,
350 #else
351 NULL,
352 #endif
353 exec_setup_stack }, /* XXX XXX XXX */
354 /* This one should go first so it matches instead of native */
355 #endif
356
357 #ifdef COMPAT_SVR4_32
358 /* SVR4 Elf32 on 64-bit */
359 { sizeof (Elf32_Ehdr),
360 exec_elf32_makecmds,
361 { ELF32NAME2(svr4_32,probe) },
362 &emul_svr4_32,
363 EXECSW_PRIO_ANY,
364 SVR4_32_AUX_ARGSIZ,
365 svr4_32_copyargs,
366 NULL,
367 #ifdef COREDUMP
368 coredump_elf32,
369 #else
370 NULL,
371 #endif
372 exec_setup_stack }, /* XXX XXX XXX */
373 /* This one should go first so it matches instead of native */
374 #endif
375
376 #if 0
377 #if EXEC_ELF_NOTELESS
378 /* Generic compat Elf32 -- run as compat NetBSD Elf32 */
379 { sizeof (Elf32_Ehdr),
380 exec_elf32_makecmds,
381 { ELF32NAME2(netbsd32,probe_noteless) },
382 &emul_netbsd32,
383 EXECSW_PRIO_FIRST,
384 howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
385 netbsd32_elf32_copyargs,
386 NULL,
387 coredump_elf32,
388 exec_setup_stack }, /* XXX XXX XXX */
389 #endif
390 #endif
391 #else /* !COMPAT_NETBSD32 */
392
393 /* Native Elf32 */
394 { sizeof (Elf32_Ehdr),
395 exec_elf32_makecmds,
396 { ELF32NAME2(netbsd,probe) },
397 &emul_netbsd,
398 EXECSW_PRIO_ANY,
399 howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
400 elf32_copyargs,
401 NULL,
402 #ifdef COREDUMP
403 coredump_elf32,
404 #else
405 NULL,
406 #endif
407 exec_setup_stack },
408
409 #ifdef COMPAT_FREEBSD
410 /* FreeBSD Elf32 (probe not 64-bit safe) */
411 { sizeof (Elf32_Ehdr),
412 exec_elf32_makecmds,
413 { ELF32NAME2(freebsd,probe) },
414 &emul_freebsd,
415 EXECSW_PRIO_ANY,
416 howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof(Elf32_Addr)),
417 elf32_copyargs,
418 NULL,
419 #ifdef COREDUMP
420 coredump_elf32,
421 #else
422 NULL,
423 #endif
424 exec_setup_stack },
425 #endif
426
427 #ifdef COMPAT_LINUX
428 /* Linux Elf32 */
429 { sizeof (Elf32_Ehdr),
430 exec_elf32_makecmds,
431 { ELF32NAME2(linux,probe) },
432 &emul_linux,
433 EXECSW_PRIO_ANY,
434 LINUX_ELF_AUX_ARGSIZ,
435 linux_elf32_copyargs,
436 NULL,
437 #ifdef COREDUMP
438 coredump_elf32,
439 #else
440 NULL,
441 #endif
442 linux_exec_setup_stack },
443 #endif
444
445 #ifdef COMPAT_IRIX
446 /* IRIX Elf32 n32 ABI */
447 { sizeof (Elf32_Ehdr),
448 exec_elf32_makecmds,
449 { ELF32NAME2(irix,probe_n32) },
450 &emul_irix,
451 EXECSW_PRIO_ANY,
452 IRIX_AUX_ARGSIZ,
453 irix_elf32_copyargs,
454 irix_n32_setregs,
455 #ifdef COREDUMP
456 coredump_elf32,
457 #else
458 NULL,
459 #endif
460 exec_setup_stack },
461
462 /* IRIX Elf32 o32 ABI */
463 { sizeof (Elf32_Ehdr),
464 exec_elf32_makecmds,
465 { ELF32NAME2(irix,probe_o32) },
466 &emul_irix,
467 EXECSW_PRIO_ANY,
468 IRIX_AUX_ARGSIZ,
469 irix_elf32_copyargs,
470 NULL,
471 #ifdef COREDUMP
472 coredump_elf32,
473 #else
474 NULL,
475 #endif
476 exec_setup_stack },
477 #endif
478
479 #ifdef COMPAT_SVR4
480 /* SVR4 Elf32 */
481 { sizeof (Elf32_Ehdr),
482 exec_elf32_makecmds,
483 { ELF32NAME2(svr4,probe) },
484 &emul_svr4,
485 EXECSW_PRIO_ANY,
486 howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
487 elf32_copyargs,
488 NULL,
489 #ifdef COREDUMP
490 coredump_elf32,
491 #else
492 NULL,
493 #endif
494 exec_setup_stack },
495 #endif
496
497 #ifdef COMPAT_IBCS2
498 /* SCO Elf32 */
499 { sizeof (Elf32_Ehdr),
500 exec_elf32_makecmds,
501 { ELF32NAME2(ibcs2,probe) },
502 &emul_ibcs2,
503 EXECSW_PRIO_ANY,
504 howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
505 elf32_copyargs,
506 NULL,
507 #ifdef COREDUMP
508 coredump_elf32,
509 #else
510 NULL,
511 #endif
512 exec_setup_stack },
513 #endif
514
515 #if EXEC_ELF_NOTELESS
516 /* Generic Elf32 -- run at NetBSD Elf32 */
517 { sizeof (Elf32_Ehdr),
518 exec_elf32_makecmds,
519 { NULL },
520 &emul_netbsd,
521 EXECSW_PRIO_LAST,
522 howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
523 elf32_copyargs,
524 NULL,
525 #ifdef COREDUMP
526 coredump_elf32,
527 #else
528 NULL,
529 #endif
530 exec_setup_stack },
531 #endif
532 #endif /* !COMPAT_NETBSD32 */
533 #endif /* EXEC_ELF32 */
534
535 #ifdef EXEC_ELF64
536 /* Native Elf64 */
537 { sizeof (Elf64_Ehdr),
538 exec_elf64_makecmds,
539 { ELF64NAME2(netbsd,probe) },
540 &emul_netbsd,
541 EXECSW_PRIO_ANY,
542 howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
543 elf64_copyargs,
544 NULL,
545 #ifdef COREDUMP
546 coredump_elf64,
547 #else
548 NULL,
549 #endif
550 exec_setup_stack },
551
552 #ifdef COMPAT_LINUX
553 /* Linux Elf64 */
554 { sizeof (Elf64_Ehdr),
555 exec_elf64_makecmds,
556 { ELF64NAME2(linux,probe) },
557 &emul_linux,
558 EXECSW_PRIO_ANY,
559 LINUX_ELF_AUX_ARGSIZ,
560 linux_elf64_copyargs,
561 NULL,
562 #ifdef COREDUMP
563 coredump_elf64,
564 #else
565 NULL,
566 #endif
567 linux_exec_setup_stack },
568 #endif
569
570 #ifdef COMPAT_SVR4
571 /* SVR4 Elf64 */
572 { sizeof (Elf64_Ehdr),
573 exec_elf64_makecmds,
574 { ELF64NAME2(svr4,probe) },
575 &emul_svr4,
576 EXECSW_PRIO_ANY,
577 howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
578 elf64_copyargs,
579 NULL,
580 #ifdef COREDUMP
581 coredump_elf64,
582 #else
583 NULL,
584 #endif
585 exec_setup_stack },
586 #endif
587
588 #if EXEC_ELF_NOTELESS
589 /* Generic Elf64 -- run at NetBSD Elf64 */
590 { sizeof (Elf64_Ehdr),
591 exec_elf64_makecmds,
592 { NULL },
593 &emul_netbsd,
594 EXECSW_PRIO_ANY,
595 howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
596 elf64_copyargs,
597 NULL,
598 #ifdef COREDUMP
599 coredump_elf64,
600 #else
601 NULL,
602 #endif
603 exec_setup_stack },
604 #endif
605 #endif /* EXEC_ELF64 */
606
607 #if defined(EXEC_MACHO)
608 #ifdef COMPAT_DARWIN
609 /* Darwin Mach-O (native word size) */
610 { sizeof (struct exec_macho_fat_header),
611 exec_macho_makecmds,
612 { .mach_probe_func = exec_darwin_probe },
613 &emul_darwin,
614 EXECSW_PRIO_ANY,
615 MAXPATHLEN + 1,
616 exec_darwin_copyargs,
617 NULL,
618 #ifdef COREDUMP
619 coredump_netbsd,
620 #else
621 NULL,
622 #endif
623 darwin_exec_setup_stack },
624 #endif
625
626 #ifdef COMPAT_MACH
627 /* Mach MACH-O (native word size) */
628 { sizeof (struct exec_macho_fat_header),
629 exec_macho_makecmds,
630 { .mach_probe_func = exec_mach_probe },
631 &emul_mach,
632 EXECSW_PRIO_ANY,
633 MAXPATHLEN + 1,
634 exec_mach_copyargs,
635 NULL,
636 #ifdef COREDUMP
637 coredump_netbsd,
638 #else
639 NULL,
640 #endif
641 exec_setup_stack },
642 #endif
643 #endif /* EXEC_MACHO */
644
645 #ifdef COMPAT_SUNOS
646 #ifdef COMPAT_NETBSD32
647 /* 32-bit SunOS a.out on 64-bit */
648 { SUNOS32_AOUT_HDR_SIZE,
649 exec_sunos32_aout_makecmds,
650 { NULL },
651 &emul_sunos,
652 EXECSW_PRIO_ANY,
653 0,
654 netbsd32_copyargs,
655 NULL,
656 #ifdef COREDUMP
657 coredump_netbsd,
658 #else
659 NULL,
660 #endif
661 exec_setup_stack },
662 #else
663 /* SunOS a.out (native word size) */
664 { SUNOS_AOUT_HDR_SIZE,
665 exec_sunos_aout_makecmds,
666 { NULL },
667 &emul_sunos,
668 EXECSW_PRIO_ANY,
669 0,
670 copyargs,
671 NULL,
672 #ifdef COREDUMP
673 coredump_netbsd,
674 #else
675 NULL,
676 #endif
677 exec_setup_stack },
678 #endif
679 #endif /* COMPAT_SUNOS */
680
681 #if defined(COMPAT_LINUX) && defined(EXEC_AOUT)
682 /* Linux a.out (native word size) */
683 { LINUX_AOUT_HDR_SIZE,
684 exec_linux_aout_makecmds,
685 { NULL },
686 &emul_linux,
687 EXECSW_PRIO_ANY,
688 LINUX_AOUT_AUX_ARGSIZ,
689 linux_aout_copyargs,
690 NULL,
691 #ifdef COREDUMP
692 coredump_netbsd,
693 #else
694 NULL,
695 #endif
696 linux_exec_setup_stack },
697 #endif
698
699 #ifdef COMPAT_IBCS2
700 /* iBCS2 COFF (native word size) */
701 { COFF_HDR_SIZE,
702 exec_ibcs2_coff_makecmds,
703 { NULL },
704 &emul_ibcs2,
705 EXECSW_PRIO_ANY,
706 0,
707 copyargs,
708 NULL,
709 #ifdef COREDUMP
710 coredump_netbsd,
711 #else
712 NULL,
713 #endif
714 ibcs2_exec_setup_stack },
715
716 /* iBCS2 x.out (native word size) */
717 { XOUT_HDR_SIZE,
718 exec_ibcs2_xout_makecmds,
719 { NULL },
720 &emul_ibcs2,
721 EXECSW_PRIO_ANY,
722 0,
723 copyargs,
724 NULL,
725 #ifdef COREDUMP
726 coredump_netbsd,
727 #else
728 NULL,
729 #endif
730 ibcs2_exec_setup_stack },
731 #endif
732
733 #if defined(COMPAT_FREEBSD) && defined(EXEC_AOUT)
734 /* FreeBSD a.out (native word size) */
735 { FREEBSD_AOUT_HDR_SIZE,
736 exec_freebsd_aout_makecmds,
737 { NULL },
738 &emul_freebsd,
739 EXECSW_PRIO_ANY,
740 0,
741 copyargs,
742 NULL,
743 #ifdef COREDUMP
744 coredump_netbsd,
745 #else
746 NULL,
747 #endif
748 exec_setup_stack },
749 #endif
750
751 #ifdef COMPAT_HPUX
752 /* HP-UX a.out for m68k (native word size) */
753 { HPUX_EXEC_HDR_SIZE,
754 exec_hpux_makecmds,
755 { NULL },
756 &emul_hpux,
757 EXECSW_PRIO_ANY,
758 0,
759 copyargs,
760 NULL,
761 #ifdef COREDUMP
762 coredump_netbsd,
763 #else
764 NULL,
765 #endif
766 exec_setup_stack },
767 #endif
768
769 #ifdef COMPAT_M68K4K
770 /* NetBSD a.out for m68k4k */
771 { sizeof(struct exec),
772 exec_m68k4k_makecmds,
773 { NULL },
774 &emul_netbsd,
775 EXECSW_PRIO_ANY,
776 0,
777 copyargs,
778 NULL,
779 #ifdef COREDUMP
780 coredump_netbsd,
781 #else
782 NULL,
783 #endif
784 exec_setup_stack },
785 #endif
786
787 #ifdef COMPAT_VAX1K
788 /* NetBSD vax1k a.out */
789 { sizeof(struct exec),
790 exec_vax1k_makecmds,
791 { NULL },
792 &emul_netbsd,
793 EXECSW_PRIO_ANY,
794 0,
795 copyargs,
796 NULL,
797 #ifdef COREDUMP
798 coredump_netbsd,
799 #else
800 NULL,
801 #endif
802 exec_setup_stack },
803 #endif
804
805 #ifdef COMPAT_PECOFF
806 /* Win32/WinCE PE/COFF (native word size) */
807 { PECOFF_HDR_SIZE,
808 exec_pecoff_makecmds,
809 { NULL },
810 &emul_pecoff,
811 EXECSW_PRIO_ANY,
812 howmany(sizeof(struct pecoff_args), sizeof(char *)),
813 pecoff_copyargs,
814 NULL,
815 #ifdef COREDUMP
816 coredump_netbsd,
817 #else
818 NULL,
819 #endif
820 exec_setup_stack },
821 #endif
822 };
823 int nexecs_builtin = (sizeof(execsw_builtin) / sizeof(struct execsw));
Cache object: 7a8aea15ff0ac3c5dd5b9afc0838cb1a
|