1 --- a/Documentation/Configure.help
2 +++ b/Documentation/Configure.help
3 @@ -4701,6 +4701,12 @@ CONFIG_BINFMT_ELF
4 ld.so (check the file <file:Documentation/Changes> for location and
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.
13 Kernel support for a.out binaries
15 A.out (Assembler.OUTput) is a set of formats for libraries and
16 @@ -4714,13 +4720,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
28 + called binfmt_aout.o.
30 OSF/1 v4 readv/writev compatibility
32 --- a/arch/alpha/config.in
33 +++ b/arch/alpha/config.in
34 @@ -315,6 +315,9 @@ if [ "$CONFIG_BINFMT_AOUT" != "n" ]; the
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
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
50 +# CONFIG_BINFMT_ELF_AOUT is not set
51 # CONFIG_BINFMT_MISC is not set
52 # CONFIG_BINFMT_EM86 is not set
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
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
71 # CONFIG_KCORE_AOUT is not set
73 +# CONFIG_BINFMT_AOUT is not set
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
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
89 string 'Kernel command line' CONFIG_ETRAX_CMDLINE "root=/dev/mtdblock3"
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
97 +# CONFIG_BINFMT_ELF_AOUT is not set
98 # CONFIG_ETRAX_KGDB is not set
99 # CONFIG_ETRAX_WATCHDOG is not set
101 --- a/arch/i386/config.in
102 +++ b/arch/i386/config.in
103 @@ -345,6 +345,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
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
110 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
111 bool 'Select task to kill on out of memory condition' CONFIG_OOM_KILLER
113 --- a/arch/i386/defconfig
114 +++ b/arch/i386/defconfig
115 @@ -115,9 +115,10 @@ CONFIG_SYSVIPC=y
118 # CONFIG_KCORE_AOUT is not set
119 -CONFIG_BINFMT_AOUT=y
120 +# CONFIG_BINFMT_AOUT is not set
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
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
137 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
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
146 +# CONFIG_BINFMT_ELF_AOUT is not set
147 # CONFIG_BINFMT_MISC is not set
150 --- a/arch/m68k/config.in
151 +++ b/arch/m68k/config.in
152 @@ -99,6 +99,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
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
159 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
161 if [ "$CONFIG_AMIGA" = "y" ]; then
162 --- a/arch/m68k/defconfig
163 +++ b/arch/m68k/defconfig
164 @@ -44,8 +44,9 @@ CONFIG_SYSVIPC=y
167 # CONFIG_KCORE_AOUT is not set
168 -CONFIG_BINFMT_AOUT=y
169 +# CONFIG_BINFMT_AOUT is not set
171 +# CONFIG_BINFMT_ELF_AOUT is not set
172 # CONFIG_BINFMT_MISC is not set
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
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
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
200 * Copyright 1993, 1994: Eric Youngdale (ericy@cais.com).
203 +#include <linux/config.h>
204 #include <linux/module.h>
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 *);
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
218 irix_core_dump, PAGE_SIZE
221 @@ -794,6 +800,7 @@ out_free_ph:
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.
229 @@ -873,6 +880,7 @@ static int load_irix_library(struct file
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
243 +# CONFIG_BINFMT_ELF_AOUT is not set
244 CONFIG_MIPS32_COMPAT=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
256 tristate 'Kernel support for SOM binaries' CONFIG_BINFMT_SOM
257 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
259 --- a/arch/parisc/defconfig
260 +++ b/arch/parisc/defconfig
261 @@ -56,6 +56,7 @@ CONFIG_SYSVIPC=y
265 +# CONFIG_BINFMT_ELF_AOUT is not set
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
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
279 --- a/arch/ppc/defconfig
280 +++ b/arch/ppc/defconfig
281 @@ -59,7 +59,8 @@ CONFIG_SYSVIPC=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
291 --- a/arch/ppc64/config.in
292 +++ b/arch/ppc64/config.in
293 @@ -82,6 +82,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
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
301 tristate 'Kernel support for 32 bit ELF binaries' CONFIG_BINFMT_ELF32
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
309 +# CONFIG_BINFMT_ELF_AOUT is not set
310 CONFIG_BINFMT_ELF32=y
311 # CONFIG_BINFMT_MISC is not set
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
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
331 +# CONFIG_BINFMT_ELF_AOUT is not set
332 # CONFIG_BINFMT_MISC is not set
333 # CONFIG_PROCESS_DEBUG is not set
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
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
353 +# CONFIG_BINFMT_ELF_AOUT is not set
354 # CONFIG_BINFMT_MISC is not set
355 # CONFIG_PROCESS_DEBUG is not set
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
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
366 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
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
373 # CONFIG_KCORE_AOUT is not set
375 +# CONFIG_BINFMT_ELF_AOUT is not set
376 # CONFIG_BINFMT_MISC is not set
379 --- a/arch/sparc/config.in
380 +++ b/arch/sparc/config.in
381 @@ -74,6 +74,9 @@ if [ "$CONFIG_PROC_FS" = "y" ]; then
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
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
397 -CONFIG_BINFMT_AOUT=y
398 +# CONFIG_BINFMT_AOUT is not set
400 -CONFIG_BINFMT_MISC=m
401 +# CONFIG_BINFMT_ELF_AOUT is not set
402 +# CONFIG_BINFMT_MISC is not set
404 # CONFIG_OOM_KILLER is not set
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
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
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
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
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
439 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
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
448 +# CONFIG_BINFMT_ELF_AOUT is not set
449 # CONFIG_BINFMT_MISC is not set
451 CONFIG_IA32_EMULATION=y
452 --- a/fs/binfmt_elf.c
453 +++ b/fs/binfmt_elf.c
455 * Copyright 1993, 1994: Eric Youngdale (ericy@cais.com).
458 +#include <linux/config.h>
459 #include <linux/module.h>
461 #include <linux/fs.h>
463 #include <linux/elf.h>
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*);
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))
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
483 + elf_core_dump, ELF_EXEC_PAGESIZE
486 #define BAD_ADDR(x) ((unsigned long)(x) >= TASK_SIZE)
487 @@ -404,6 +413,7 @@ out:
491 +#ifdef CONFIG_BINFMT_ELF_AOUT
492 static unsigned long load_aout_interp(struct exec * interp_ex,
493 struct file * interpreter)
495 @@ -451,6 +461,7 @@ static unsigned long load_aout_interp(st
502 * These are the functions used to load ELF style executables and shared
503 @@ -458,7 +469,9 @@ out:
506 #define INTERPRETER_NONE 0
507 +#ifdef CONFIG_BINFMT_ELF_AOUT
508 #define INTERPRETER_AOUT 1
510 #define INTERPRETER_ELF 2
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];
520 struct files_struct *files;
522 /* Get the exec-header */
523 @@ -612,6 +627,7 @@ static int load_elf_binary(struct linux_
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;
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;
536 + interpreter_type = INTERPRETER_ELF;
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;
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;
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 */
561 +#ifdef CONFIG_BINFMT_ELF_AOUT
562 if (!bprm->sh_bang) {
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);
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_
576 if (elf_interpreter) {
577 +#ifdef CONFIG_BINFMT_ELF_AOUT
578 if (interpreter_type == INTERPRETER_AOUT)
579 elf_entry = load_aout_interp(&interp_ex,
583 elf_entry = load_elf_interp(&interp_elf_ex,
586 @@ -849,7 +874,9 @@ static int load_elf_binary(struct linux_
590 +#ifdef CONFIG_BINFMT_ELF_AOUT
591 if (interpreter_type != INTERPRETER_AOUT)
593 sys_close(elf_exec_fileno);
595 set_binfmt(&elf_format);
596 @@ -863,10 +890,14 @@ static int load_elf_binary(struct linux_
598 load_addr, load_bias,
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;
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:
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. */
619 static int load_elf_library(struct file *file)
621 struct elf_phdr *elf_phdata;
622 @@ -1016,6 +1047,7 @@ out_free_ph:
629 * Note that some platforms still use traditional core dumps and not
632 @@ -109,6 +109,7 @@ static inline void put_binfmt(struct lin
634 asmlinkage long sys_uselib(const char * library)
636 +#if defined(CONFIG_BINFMT_AOUT) || defined(CONFIG_BINFMT_ELF_AOUT)
640 @@ -155,6 +156,9 @@ out: