2
0

108-optional_aout_support.patch 21 KB

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