108-optional_aout_support.patch 26 KB

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