generic-2.4: refresh patches
[openwrt/openwrt.git] / target / linux / generic-2.4 / patches / 108-optional_aout_support.patch
1 --- a/Documentation/Configure.help
2 +++ b/Documentation/Configure.help
3 @@ -4690,6 +4690,12 @@ CONFIG_BINFMT_ELF
4 ld.so (check the file <file:Documentation/Changes> for location and
5 latest version).
6
7 +ELF binaries with a.out format interpreters or a.out libraries
8 +CONFIG_BINFMT_ELF_AOUT
9 + The kernel may support ELF executables which use an a.out format
10 + interpreter (dynamic linker) and/or a.out shared libraries, in
11 + addition to the usual ELF-ELF setups. You shouldn't need this.
12 +
13 Kernel support for a.out binaries
14 CONFIG_BINFMT_AOUT
15 A.out (Assembler.OUTput) is a set of formats for libraries and
16 @@ -4703,13 +4709,11 @@ CONFIG_BINFMT_AOUT
17 warrant removing support. However its removal is a good idea if you
18 wish to ensure that absolutely none of your programs will use this
19 older executable format. If you don't know what to answer at this
20 - point then answer Y. If someone told you "You need a kernel with
21 + point then answer N. If someone told you "You need a kernel with
22 QMAGIC support" then you'll have to say Y here. You may answer M to
23 compile a.out support as a module and later load the module when you
24 want to use a program or library in a.out format. The module will be
25 - called binfmt_aout.o. Saying M or N here is dangerous though,
26 - because some crucial programs on your system might still be in A.OUT
27 - format.
28 + called binfmt_aout.o.
29
30 OSF/1 v4 readv/writev compatibility
31 CONFIG_OSF4_COMPAT
32 --- a/arch/alpha/config.in
33 +++ b/arch/alpha/config.in
34 @@ -315,6 +315,9 @@ if [ "$CONFIG_BINFMT_AOUT" != "n" ]; the
35 fi
36
37 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
38 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
39 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
40 +fi
41 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
42 tristate 'Kernel support for Linux/Intel ELF binaries' CONFIG_BINFMT_EM86
43 source drivers/parport/Config.in
44 --- a/arch/alpha/defconfig
45 +++ b/arch/alpha/defconfig
46 @@ -72,6 +72,7 @@ CONFIG_KCORE_ELF=y
47 # CONFIG_KCORE_AOUT is not set
48 # CONFIG_BINFMT_AOUT is not set
49 CONFIG_BINFMT_ELF=y
50 +# CONFIG_BINFMT_ELF_AOUT is not set
51 # CONFIG_BINFMT_MISC is not set
52 # CONFIG_BINFMT_EM86 is not set
53
54 --- a/arch/arm/config.in
55 +++ b/arch/arm/config.in
56 @@ -499,6 +499,9 @@ choice 'Kernel core (/proc/kcore) format
57 A.OUT CONFIG_KCORE_AOUT" ELF
58 tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
59 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
60 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
61 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
62 +fi
63 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
64 dep_bool 'Power Management support (experimental)' CONFIG_PM $CONFIG_EXPERIMENTAL
65 dep_tristate 'RISC OS personality' CONFIG_ARTHUR $CONFIG_CPU_32
66 --- a/arch/arm/defconfig
67 +++ b/arch/arm/defconfig
68 @@ -83,8 +83,9 @@ CONFIG_SYSCTL=y
69 CONFIG_NWFPE=y
70 CONFIG_KCORE_ELF=y
71 # CONFIG_KCORE_AOUT is not set
72 -CONFIG_BINFMT_AOUT=y
73 +# CONFIG_BINFMT_AOUT is not set
74 CONFIG_BINFMT_ELF=y
75 +# CONFIG_BINFMT_ELF_AOUT is not set
76 # CONFIG_BINFMT_MISC is not set
77 # CONFIG_PM is not set
78 # CONFIG_ARTHUR is not set
79 --- a/arch/cris/config.in
80 +++ b/arch/cris/config.in
81 @@ -31,6 +31,9 @@ bool 'BSD Process Accounting' CONFIG_BSD
82 bool 'Sysctl support' CONFIG_SYSCTL
83
84 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
85 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
86 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
87 +fi
88
89 string 'Kernel command line' CONFIG_ETRAX_CMDLINE "root=/dev/mtdblock3"
90
91 --- a/arch/cris/defconfig
92 +++ b/arch/cris/defconfig
93 @@ -18,6 +18,7 @@ CONFIG_SYSVIPC=y
94 # CONFIG_BSD_PROCESS_ACCT is not set
95 # CONFIG_SYSCTL is not set
96 CONFIG_BINFMT_ELF=y
97 +# CONFIG_BINFMT_ELF_AOUT is not set
98 # CONFIG_ETRAX_KGDB is not set
99 # CONFIG_ETRAX_WATCHDOG is not set
100
101 --- a/arch/i386/config.in
102 +++ b/arch/i386/config.in
103 @@ -329,6 +329,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
104 fi
105 tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
106 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
107 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
108 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
109 +fi
110 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
111 bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
112
113 --- a/arch/i386/defconfig
114 +++ b/arch/i386/defconfig
115 @@ -115,9 +115,10 @@ CONFIG_SYSVIPC=y
116 CONFIG_SYSCTL=y
117 CONFIG_KCORE_ELF=y
118 # CONFIG_KCORE_AOUT is not set
119 -CONFIG_BINFMT_AOUT=y
120 +# CONFIG_BINFMT_AOUT is not set
121 CONFIG_BINFMT_ELF=y
122 -CONFIG_BINFMT_MISC=y
123 +# CONFIG_BINFMT_ELF_AOUT is not set
124 +# CONFIG_BINFMT_MISC is not set
125 # CONFIG_OOM_KILLER is not set
126 CONFIG_PM=y
127 # CONFIG_APM is not set
128 --- a/arch/ia64/config.in
129 +++ b/arch/ia64/config.in
130 @@ -124,6 +124,9 @@ bool 'System V IPC' CONFIG_SYSVIPC
131 bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
132 bool 'Sysctl support' CONFIG_SYSCTL
133 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
134 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
135 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
136 +fi
137 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
138
139 if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
140 --- a/arch/ia64/defconfig
141 +++ b/arch/ia64/defconfig
142 @@ -60,6 +60,7 @@ CONFIG_SYSVIPC=y
143 # CONFIG_BSD_PROCESS_ACCT is not set
144 CONFIG_SYSCTL=y
145 CONFIG_BINFMT_ELF=y
146 +# CONFIG_BINFMT_ELF_AOUT is not set
147 # CONFIG_BINFMT_MISC is not set
148 CONFIG_ACPI=y
149 CONFIG_ACPI_EFI=y
150 --- a/arch/m68k/config.in
151 +++ b/arch/m68k/config.in
152 @@ -99,6 +99,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
153 fi
154 tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
155 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
156 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
157 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
158 +fi
159 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
160
161 if [ "$CONFIG_AMIGA" = "y" ]; then
162 --- a/arch/m68k/defconfig
163 +++ b/arch/m68k/defconfig
164 @@ -44,8 +44,9 @@ CONFIG_SYSVIPC=y
165 CONFIG_SYSCTL=y
166 CONFIG_KCORE_ELF=y
167 # CONFIG_KCORE_AOUT is not set
168 -CONFIG_BINFMT_AOUT=y
169 +# CONFIG_BINFMT_AOUT is not set
170 CONFIG_BINFMT_ELF=y
171 +# CONFIG_BINFMT_ELF_AOUT is not set
172 # CONFIG_BINFMT_MISC is not set
173 CONFIG_ZORRO=y
174 # CONFIG_AMIGA_PCMCIA is not set
175 --- a/arch/mips/config-shared.in
176 +++ b/arch/mips/config-shared.in
177 @@ -873,6 +873,9 @@ define_bool CONFIG_KCORE_ELF y
178 define_bool CONFIG_KCORE_AOUT n
179 define_bool CONFIG_BINFMT_AOUT n
180 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
181 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
182 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
183 +fi
184 dep_bool 'Kernel support for Linux/MIPS 32-bit binary compatibility' CONFIG_MIPS32_COMPAT $CONFIG_MIPS64
185 dep_bool 'Kernel support for o32 binaries' CONFIG_MIPS32_O32 $CONFIG_MIPS32_COMPAT
186 dep_bool 'Kernel support for n32 binaries' CONFIG_MIPS32_N32 $CONFIG_MIPS32_COMPAT
187 --- a/arch/mips/defconfig
188 +++ b/arch/mips/defconfig
189 @@ -143,6 +143,7 @@ CONFIG_KCORE_ELF=y
190 # CONFIG_KCORE_AOUT is not set
191 # CONFIG_BINFMT_AOUT is not set
192 CONFIG_BINFMT_ELF=y
193 +# CONFIG_BINFMT_ELF_AOUT is not set
194 # CONFIG_MIPS32_COMPAT is not set
195 # CONFIG_MIPS32_O32 is not set
196 # CONFIG_MIPS32_N32 is not set
197 --- a/arch/mips/kernel/irixelf.c
198 +++ b/arch/mips/kernel/irixelf.c
199 @@ -8,6 +8,7 @@
200 * Copyright 1993, 1994: Eric Youngdale (ericy@cais.com).
201 */
202
203 +#include <linux/config.h>
204 #include <linux/module.h>
205
206 #include <linux/fs.h>
207 @@ -48,7 +49,12 @@ static int irix_core_dump(long signr, st
208 extern int dump_fpu (elf_fpregset_t *);
209
210 static struct linux_binfmt irix_format = {
211 - NULL, THIS_MODULE, load_irix_binary, load_irix_library,
212 + NULL, THIS_MODULE, load_irix_binary,
213 +#ifdef CONFIG_BINFMT_ELF_AOUT
214 + load_irix_library,
215 +#else
216 + NULL,
217 +#endif
218 irix_core_dump, PAGE_SIZE
219 };
220
221 @@ -794,6 +800,7 @@ out_free_ph:
222 goto out;
223 }
224
225 +#ifdef CONFIG_BINFMT_ELF_AOUT
226 /* This is really simpleminded and specialized - we are loading an
227 * a.out library that is given an ELF header.
228 */
229 @@ -873,6 +880,7 @@ static int load_irix_library(struct file
230 kfree(elf_phdata);
231 return 0;
232 }
233 +#endif
234
235 /* Called through irix_syssgi() to map an elf image given an FD,
236 * a phdr ptr USER_PHDRP in userspace, and a count CNT telling how many
237 --- a/arch/mips64/defconfig
238 +++ b/arch/mips64/defconfig
239 @@ -147,6 +147,7 @@ CONFIG_KCORE_ELF=y
240 # CONFIG_KCORE_AOUT is not set
241 # CONFIG_BINFMT_AOUT is not set
242 CONFIG_BINFMT_ELF=y
243 +# CONFIG_BINFMT_ELF_AOUT is not set
244 CONFIG_MIPS32_COMPAT=y
245 CONFIG_MIPS32_O32=y
246 # CONFIG_MIPS32_N32 is not set
247 --- a/arch/parisc/config.in
248 +++ b/arch/parisc/config.in
249 @@ -89,6 +89,9 @@ bool 'BSD Process Accounting' CONFIG_BSD
250 bool 'Sysctl support' CONFIG_SYSCTL
251 define_bool CONFIG_KCORE_ELF y
252 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
253 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
254 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
255 +fi
256 tristate 'Kernel support for SOM binaries' CONFIG_BINFMT_SOM
257 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
258
259 --- a/arch/parisc/defconfig
260 +++ b/arch/parisc/defconfig
261 @@ -56,6 +56,7 @@ CONFIG_SYSVIPC=y
262 CONFIG_SYSCTL=y
263 CONFIG_KCORE_ELF=y
264 CONFIG_BINFMT_ELF=y
265 +# CONFIG_BINFMT_ELF_AOUT is not set
266 CONFIG_BINFMT_SOM=y
267 # CONFIG_BINFMT_MISC is not set
268 # CONFIG_PM is not set
269 --- a/arch/ppc/config.in
270 +++ b/arch/ppc/config.in
271 @@ -384,6 +384,7 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
272 fi
273 define_bool CONFIG_BINFMT_ELF y
274 define_bool CONFIG_KERNEL_ELF y
275 +bool 'ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
276 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
277 bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
278
279 --- a/arch/ppc/defconfig
280 +++ b/arch/ppc/defconfig
281 @@ -59,7 +59,8 @@ CONFIG_SYSVIPC=y
282 CONFIG_KCORE_ELF=y
283 CONFIG_BINFMT_ELF=y
284 CONFIG_KERNEL_ELF=y
285 -CONFIG_BINFMT_MISC=m
286 +# CONFIG_BINFMT_ELF_AOUT is not set
287 +# CONFIG_BINFMT_MISC is not set
288 # CONFIG_OOM_KILLER is not set
289 CONFIG_PCI_NAMES=y
290 CONFIG_HOTPLUG=y
291 --- a/arch/ppc64/config.in
292 +++ b/arch/ppc64/config.in
293 @@ -82,6 +82,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
294 fi
295
296 bool 'Kernel support for 64 bit ELF binaries' CONFIG_BINFMT_ELF
297 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
298 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
299 +fi
300
301 tristate 'Kernel support for 32 bit ELF binaries' CONFIG_BINFMT_ELF32
302
303 --- a/arch/ppc64/defconfig
304 +++ b/arch/ppc64/defconfig
305 @@ -56,6 +56,7 @@ CONFIG_SYSVIPC=y
306 # CONFIG_BSD_PROCESS_ACCT is not set
307 CONFIG_KCORE_ELF=y
308 CONFIG_BINFMT_ELF=y
309 +# CONFIG_BINFMT_ELF_AOUT is not set
310 CONFIG_BINFMT_ELF32=y
311 # CONFIG_BINFMT_MISC is not set
312 CONFIG_PCI_NAMES=y
313 --- a/arch/s390/config.in
314 +++ b/arch/s390/config.in
315 @@ -58,6 +58,9 @@ bool 'BSD Process Accounting' CONFIG_BSD
316 bool 'Sysctl support' CONFIG_SYSCTL
317 define_bool CONFIG_KCORE_ELF y
318 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
319 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
320 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
321 +fi
322 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
323 bool 'Show crashed user process info' CONFIG_PROCESS_DEBUG
324 bool 'Pseudo page fault support' CONFIG_PFAULT
325 --- a/arch/s390/defconfig
326 +++ b/arch/s390/defconfig
327 @@ -46,6 +46,7 @@ CONFIG_SYSVIPC=y
328 CONFIG_SYSCTL=y
329 CONFIG_KCORE_ELF=y
330 CONFIG_BINFMT_ELF=y
331 +# CONFIG_BINFMT_ELF_AOUT is not set
332 # CONFIG_BINFMT_MISC is not set
333 # CONFIG_PROCESS_DEBUG is not set
334 CONFIG_PFAULT=y
335 --- a/arch/s390x/config.in
336 +++ b/arch/s390x/config.in
337 @@ -61,6 +61,9 @@ bool 'BSD Process Accounting' CONFIG_BSD
338 bool 'Sysctl support' CONFIG_SYSCTL
339 define_bool CONFIG_KCORE_ELF y
340 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
341 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
342 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
343 +fi
344 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
345 bool 'Show crashed user process info' CONFIG_PROCESS_DEBUG
346 bool 'Pseudo page fault support' CONFIG_PFAULT
347 --- a/arch/s390x/defconfig
348 +++ b/arch/s390x/defconfig
349 @@ -47,6 +47,7 @@ CONFIG_SYSVIPC=y
350 CONFIG_SYSCTL=y
351 CONFIG_KCORE_ELF=y
352 CONFIG_BINFMT_ELF=y
353 +# CONFIG_BINFMT_ELF_AOUT is not set
354 # CONFIG_BINFMT_MISC is not set
355 # CONFIG_PROCESS_DEBUG is not set
356 CONFIG_PFAULT=y
357 --- a/arch/sh/config.in
358 +++ b/arch/sh/config.in
359 @@ -283,6 +283,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
360 A.OUT CONFIG_KCORE_AOUT" ELF
361 fi
362 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
363 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
364 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
365 +fi
366 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
367
368 bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
369 --- a/arch/sh/defconfig
370 +++ b/arch/sh/defconfig
371 @@ -48,6 +48,7 @@ CONFIG_CF_ENABLER=y
372 CONFIG_KCORE_ELF=y
373 # CONFIG_KCORE_AOUT is not set
374 CONFIG_BINFMT_ELF=y
375 +# CONFIG_BINFMT_ELF_AOUT is not set
376 # CONFIG_BINFMT_MISC is not set
377
378 #
379 --- a/arch/sparc/config.in
380 +++ b/arch/sparc/config.in
381 @@ -74,6 +74,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
382 fi
383 tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
384 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
385 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
386 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
387 +fi
388 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
389 bool 'SunOS binary emulation' CONFIG_SUNOS_EMUL
390 bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
391 --- a/arch/sparc/defconfig
392 +++ b/arch/sparc/defconfig
393 @@ -49,9 +49,10 @@ CONFIG_SYSVIPC=y
394 # CONFIG_BSD_PROCESS_ACCT is not set
395 CONFIG_SYSCTL=y
396 CONFIG_KCORE_ELF=y
397 -CONFIG_BINFMT_AOUT=y
398 +# CONFIG_BINFMT_AOUT is not set
399 CONFIG_BINFMT_ELF=y
400 -CONFIG_BINFMT_MISC=m
401 +# CONFIG_BINFMT_ELF_AOUT is not set
402 +# CONFIG_BINFMT_MISC is not set
403 CONFIG_SUNOS_EMUL=y
404 # CONFIG_OOM_KILLER is not set
405
406 --- a/arch/sparc64/config.in
407 +++ b/arch/sparc64/config.in
408 @@ -79,6 +79,9 @@ if [ "$CONFIG_SPARC32_COMPAT" != "n" ];
409 bool ' Kernel support for 32-bit (ie. SunOS) a.out binaries' CONFIG_BINFMT_AOUT32
410 fi
411 bool 'Kernel support for 64-bit ELF binaries' CONFIG_BINFMT_ELF
412 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
413 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
414 +fi
415 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
416 bool 'SunOS binary emulation' CONFIG_SUNOS_EMUL
417 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
418 --- a/arch/sparc64/defconfig
419 +++ b/arch/sparc64/defconfig
420 @@ -70,7 +70,8 @@ CONFIG_SPARC32_COMPAT=y
421 CONFIG_BINFMT_ELF32=y
422 # CONFIG_BINFMT_AOUT32 is not set
423 CONFIG_BINFMT_ELF=y
424 -CONFIG_BINFMT_MISC=m
425 +# CONFIG_BINFMT_ELF_AOUT is not set
426 +# CONFIG_BINFMT_MISC is not set
427 # CONFIG_SUNOS_EMUL is not set
428 CONFIG_SOLARIS_EMUL=m
429 # CONFIG_OOM_KILLER is not set
430 --- a/arch/x86_64/config.in
431 +++ b/arch/x86_64/config.in
432 @@ -118,6 +118,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
433 fi
434 #tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
435 bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
436 +if [ "$CONFIG_BINFMT_ELF" != "n" ]; then
437 + bool ' ELF binaries with a.out format interpreters or a.out libraries' CONFIG_BINFMT_ELF_AOUT
438 +fi
439 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
440
441 bool 'Power Management support' CONFIG_PM
442 --- a/arch/x86_64/defconfig
443 +++ b/arch/x86_64/defconfig
444 @@ -67,6 +67,7 @@ CONFIG_SYSVIPC=y
445 CONFIG_SYSCTL=y
446 CONFIG_KCORE_ELF=y
447 CONFIG_BINFMT_ELF=y
448 +# CONFIG_BINFMT_ELF_AOUT is not set
449 # CONFIG_BINFMT_MISC is not set
450 CONFIG_PM=y
451 CONFIG_IA32_EMULATION=y
452 --- a/fs/binfmt_elf.c
453 +++ b/fs/binfmt_elf.c
454 @@ -9,6 +9,7 @@
455 * Copyright 1993, 1994: Eric Youngdale (ericy@cais.com).
456 */
457
458 +#include <linux/config.h>
459 #include <linux/module.h>
460
461 #include <linux/fs.h>
462 @@ -43,7 +44,9 @@
463 #include <linux/elf.h>
464
465 static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
466 +#ifdef CONFIG_BINFMT_ELF_AOUT
467 static int load_elf_library(struct file*);
468 +#endif
469 static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int);
470 extern int dump_fpu (struct pt_regs *, elf_fpregset_t *);
471 extern void dump_thread(struct pt_regs *, struct user *);
472 @@ -74,7 +77,13 @@ static int elf_core_dump(long signr, str
473 #define ELF_PAGEALIGN(_v) (((_v) + ELF_MIN_ALIGN - 1) & ~(ELF_MIN_ALIGN - 1))
474
475 static struct linux_binfmt elf_format = {
476 - NULL, THIS_MODULE, load_elf_binary, load_elf_library, elf_core_dump, ELF_EXEC_PAGESIZE
477 + NULL, THIS_MODULE, load_elf_binary,
478 +#ifdef CONFIG_BINFMT_ELF_AOUT
479 + load_elf_library,
480 +#else
481 + NULL,
482 +#endif
483 + elf_core_dump, ELF_EXEC_PAGESIZE
484 };
485
486 #define BAD_ADDR(x) ((unsigned long)(x) >= TASK_SIZE)
487 @@ -404,6 +413,7 @@ out:
488 return error;
489 }
490
491 +#ifdef CONFIG_BINFMT_ELF_AOUT
492 static unsigned long load_aout_interp(struct exec * interp_ex,
493 struct file * interpreter)
494 {
495 @@ -451,6 +461,7 @@ static unsigned long load_aout_interp(st
496 out:
497 return elf_entry;
498 }
499 +#endif
500
501 /*
502 * These are the functions used to load ELF style executables and shared
503 @@ -458,7 +469,9 @@ out:
504 */
505
506 #define INTERPRETER_NONE 0
507 +#ifdef CONFIG_BINFMT_ELF_AOUT
508 #define INTERPRETER_AOUT 1
509 +#endif
510 #define INTERPRETER_ELF 2
511
512
513 @@ -482,7 +495,9 @@ static int load_elf_binary(struct linux_
514 struct elfhdr elf_ex;
515 struct elfhdr interp_elf_ex;
516 struct exec interp_ex;
517 +#ifdef CONFIG_BINFMT_ELF_AOUT
518 char passed_fileno[6];
519 +#endif
520 struct files_struct *files;
521
522 /* Get the exec-header */
523 @@ -612,6 +627,7 @@ static int load_elf_binary(struct linux_
524
525 /* Some simple consistency checks for the interpreter */
526 if (elf_interpreter) {
527 +#ifdef CONFIG_BINFMT_ELF_AOUT
528 interpreter_type = INTERPRETER_ELF | INTERPRETER_AOUT;
529
530 /* Now figure out which format our binary is */
531 @@ -619,6 +635,9 @@ static int load_elf_binary(struct linux_
532 (N_MAGIC(interp_ex) != ZMAGIC) &&
533 (N_MAGIC(interp_ex) != QMAGIC))
534 interpreter_type = INTERPRETER_ELF;
535 +#else
536 + interpreter_type = INTERPRETER_ELF;
537 +#endif
538
539 if (memcmp(interp_elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
540 interpreter_type &= ~INTERPRETER_ELF;
541 @@ -627,6 +646,7 @@ static int load_elf_binary(struct linux_
542 if (!interpreter_type)
543 goto out_free_dentry;
544
545 +#ifdef CONFIG_BINFMT_ELF_AOUT
546 /* Make sure only one type was selected */
547 if ((interpreter_type & INTERPRETER_ELF) &&
548 interpreter_type != INTERPRETER_ELF) {
549 @@ -634,6 +654,7 @@ static int load_elf_binary(struct linux_
550 // printk(KERN_WARNING "ELF: Ambiguous type, using ELF\n");
551 interpreter_type = INTERPRETER_ELF;
552 }
553 +#endif
554 /* Verify the interpreter has a valid arch */
555 if ((interpreter_type == INTERPRETER_ELF) &&
556 !elf_check_arch(&interp_elf_ex))
557 @@ -651,6 +672,7 @@ static int load_elf_binary(struct linux_
558 /* OK, we are done with that, now set up the arg stuff,
559 and then start this sucker up */
560
561 +#ifdef CONFIG_BINFMT_ELF_AOUT
562 if (!bprm->sh_bang) {
563 char * passed_p;
564
565 @@ -669,6 +691,7 @@ static int load_elf_binary(struct linux_
566 /* Executables without an interpreter also need a personality */
567 SET_PERSONALITY(elf_ex, ibcs2_interpreter);
568 }
569 +#endif
570
571 /* Flush all traces of the currently running executable */
572 retval = flush_old_exec(bprm);
573 @@ -817,10 +840,12 @@ static int load_elf_binary(struct linux_
574 padzero(elf_bss);
575
576 if (elf_interpreter) {
577 +#ifdef CONFIG_BINFMT_ELF_AOUT
578 if (interpreter_type == INTERPRETER_AOUT)
579 elf_entry = load_aout_interp(&interp_ex,
580 interpreter);
581 else
582 +#endif
583 elf_entry = load_elf_interp(&interp_elf_ex,
584 interpreter,
585 &interp_load_addr);
586 @@ -849,7 +874,9 @@ static int load_elf_binary(struct linux_
587
588 kfree(elf_phdata);
589
590 +#ifdef CONFIG_BINFMT_ELF_AOUT
591 if (interpreter_type != INTERPRETER_AOUT)
592 +#endif
593 sys_close(elf_exec_fileno);
594
595 set_binfmt(&elf_format);
596 @@ -863,10 +890,14 @@ static int load_elf_binary(struct linux_
597 &elf_ex,
598 load_addr, load_bias,
599 interp_load_addr,
600 +#ifdef CONFIG_BINFMT_ELF_AOUT
601 (interpreter_type == INTERPRETER_AOUT ? 0 : 1));
602 /* N.B. passed_fileno might not be initialized? */
603 if (interpreter_type == INTERPRETER_AOUT)
604 current->mm->arg_start += strlen(passed_fileno) + 1;
605 +#else
606 + 1);
607 +#endif
608 current->mm->start_brk = current->mm->brk = elf_brk;
609 current->mm->end_code = end_code;
610 current->mm->start_code = start_code;
611 @@ -937,9 +968,9 @@ out_free_ph:
612 goto out;
613 }
614
615 +#ifdef CONFIG_BINFMT_ELF_AOUT
616 /* This is really simpleminded and specialized - we are loading an
617 a.out library that is given an ELF header. */
618 -
619 static int load_elf_library(struct file *file)
620 {
621 struct elf_phdr *elf_phdata;
622 @@ -1016,6 +1047,7 @@ out_free_ph:
623 out:
624 return error;
625 }
626 +#endif
627
628 /*
629 * Note that some platforms still use traditional core dumps and not
630 --- a/fs/exec.c
631 +++ b/fs/exec.c
632 @@ -109,6 +109,7 @@ static inline void put_binfmt(struct lin
633 */
634 asmlinkage long sys_uselib(const char * library)
635 {
636 +#if defined(CONFIG_BINFMT_AOUT) || defined(CONFIG_BINFMT_ELF_AOUT)
637 struct file * file;
638 struct nameidata nd;
639 int error;
640 @@ -155,6 +156,9 @@ out:
641 exit:
642 path_release(&nd);
643 goto out;
644 +#else
645 + return -ENOSYS;
646 +#endif
647 }
648
649 /*