108-optional_aout_support.patch 25 KB

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