This source file includes following definitions.
- init_exec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 #include <sys/param.h>
35 #include <sys/exec.h>
36 #include <sys/exec_script.h>
37
38 #if defined(_KERN_DO_ECOFF)
39 #include <sys/exec_ecoff.h>
40 #endif
41
42 #if defined(_KERN_DO_ELF) || defined(_KERN_DO_ELF64)
43 #include <sys/exec_elf.h>
44 #endif
45
46 #ifdef COMPAT_SVR4
47 #include <compat/svr4/svr4_exec.h>
48 #endif
49
50 #ifdef COMPAT_IBCS2
51 #include <compat/ibcs2/ibcs2_exec.h>
52 #endif
53
54 #ifdef COMPAT_LINUX
55 #include <compat/linux/linux_exec.h>
56 #endif
57
58 #ifdef COMPAT_BSDOS
59 #include <compat/bsdos/bsdos_exec.h>
60 #endif
61
62 #ifdef COMPAT_FREEBSD
63 #include <compat/freebsd/freebsd_exec.h>
64 #endif
65
66 #ifdef COMPAT_HPUX
67 #include <compat/hpux/hpux_exec.h>
68 #endif
69
70 #ifdef COMPAT_M68K4K
71 #include <compat/m68k4k/m68k4k_exec.h>
72 #endif
73
74 #ifdef COMPAT_VAX1K
75 #include <compat/vax1k/vax1k_exec.h>
76 #endif
77
78 extern struct emul emul_native, emul_elf32, emul_elf64, emul_aout,
79 emul_bsdos, emul_freebsd_aout, emul_freebsd_elf, emul_hpux,
80 emul_ibcs2, emul_linux_elf, emul_linux_aout, emul_netbsd_elf64,
81 emul_osf1, emul_sunos, emul_svr4, emul_ultrix;
82
83 struct execsw execsw[] = {
84 { MAXINTERP, exec_script_makecmds, &emul_native, },
85 #ifdef _KERN_DO_AOUT
86 #ifdef COMPAT_AOUT
87 { sizeof(struct exec), exec_aout_makecmds, &emul_aout },
88 #else
89 { sizeof(struct exec), exec_aout_makecmds, &emul_native },
90 #endif
91 #endif
92 #ifdef _KERN_DO_ECOFF
93 { ECOFF_HDR_SIZE, exec_ecoff_makecmds, &emul_native },
94 #endif
95 #ifdef _KERN_DO_ELF
96 { sizeof(Elf32_Ehdr), exec_elf32_makecmds, &emul_native },
97 #endif
98 #ifdef _KERN_DO_ELF64
99 { sizeof(Elf64_Ehdr), exec_elf64_makecmds, &emul_native },
100 #ifdef COMPAT_OSF1
101 { sizeof(Elf64_Ehdr), exec_elf64_makecmds, &emul_osf1 },
102 #endif
103 #endif
104 #ifdef COMPAT_LINUX
105 { LINUX_AOUT_HDR_SIZE, exec_linux_aout_makecmds, &emul_linux_aout },
106 { sizeof(Elf32_Ehdr), exec_linux_elf32_makecmds, &emul_linux_elf },
107 #endif
108 #ifdef COMPAT_IBCS2
109 { COFF_HDR_SIZE, exec_ibcs2_coff_makecmds, &emul_ibcs2 },
110 { XOUT_HDR_SIZE, exec_ibcs2_xout_makecmds, &emul_ibcs2 },
111 #endif
112 #ifdef COMPAT_BSDOS
113 { BSDOS_AOUT_HDR_SIZE, exec_bsdos_aout_makecmds, &emul_bsdos },
114 #endif
115 #ifdef COMPAT_FREEBSD
116 { FREEBSD_AOUT_HDR_SIZE, exec_freebsd_aout_makecmds, &emul_freebsd_aout },
117 { sizeof(Elf32_Ehdr), exec_freebsd_elf32_makecmds, &emul_freebsd_elf },
118 #endif
119 #ifdef COMPAT_HPUX
120 { HPUX_EXEC_HDR_SIZE, exec_hpux_makecmds, &emul_hpux },
121 #endif
122 #ifdef COMPAT_M68K4K
123 { sizeof(struct exec), exec_m68k4k_makecmds, &emul_native },
124 #endif
125 #ifdef COMPAT_VAX1K
126 { sizeof(struct exec), exec_vax1k_makecmds, &emul_native },
127 #endif
128 #ifdef COMPAT_ULTRIX
129 { ECOFF_HDR_SIZE, exec_ecoff_makecmds, &emul_ultrix },
130 #endif
131 #ifdef COMPAT_SVR4
132 { sizeof(Elf32_Ehdr), exec_elf32_makecmds, &emul_svr4 },
133 #endif
134 #ifdef COMPAT_SUNOS
135 { sizeof(struct exec), exec_aout_makecmds, &emul_sunos },
136 #endif
137 #ifdef LKM
138 { 0, NULL, NULL },
139 { 0, NULL, NULL },
140 { 0, NULL, NULL },
141 { 0, NULL, NULL },
142 { 0, NULL, NULL },
143 #endif
144 };
145 int nexecs = (sizeof execsw / sizeof(*execsw));
146 int exec_maxhdrsz;
147
148 void init_exec(void);
149
150 void
151 init_exec(void)
152 {
153 int i;
154
155
156
157
158
159
160 for (i = 0; i < nexecs; i++)
161 if (execsw[i].es_check != NULL &&
162 execsw[i].es_hdrsz > exec_maxhdrsz)
163 exec_maxhdrsz = execsw[i].es_hdrsz;
164 }