Permit AOUT library support to be suppressed in the ELF binfmt if the arch does
not support it. AOUT support is suppressed by adding:
config NO_AOUT_SUPPORT
def_bool y
to the arch Kconfig file.
The MN10300 architecture does not support the AOUT binfmt, so the ELF binfmt
should not be permitted to go looking for AOUT libraries to load.
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/Kconfig.binfmt | 3 ++-
fs/binfmt_elf.c | 30 ++++++++++++++++++++++--------
include/linux/a.out.h | 6 ++++++
3 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
index d4fc609..a9ea391 100644
--- a/fs/Kconfig.binfmt
+++ b/fs/Kconfig.binfmt
@@ -57,7 +57,8 @@ config BINFMT_SHARED_FLAT
config BINFMT_AOUT
tristate "Kernel support for a.out and ECOFF binaries"
- depends on X86_32 || ALPHA || ARM || M68K || SPARC32
+ depends on (X86_32 || ALPHA || ARM || M68K || SPARC32) && \
+ !NO_AOUT_SUPPORT
---help---
A.out (Assembler.OUTput) is a set of formats for libraries and
executables used in the earliest versions of UNIX. Linux used
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index ba8de7c..5a348c6 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -464,6 +464,7 @@ out:
return error;
}
+#ifndef CONFIG_NO_AOUT_SUPPORT
static unsigned long load_aout_interp(struct exec *interp_ex,
struct file *interpreter)
{
@@ -509,6 +510,10 @@ static unsigned long load_aout_interp(struct exec *interp_ex,
out:
return elf_entry;
}
+#else
+extern unsigned long load_aout_interp(struct exec *interp_ex,
+ struct file *interpreter);
+#endif
/*
* These are the functions used to load ELF style executables and shared
@@ -516,9 +521,15 @@ out:
*/
#define INTERPRETER_NONE 0
-#define INTERPRETER_AOUT 1
#define INTERPRETER_ELF 2
+#ifndef CONFIG_NO_AOUT_SUPPORT
+#define INTERPRETER_AOUT 1
+#define IS_AOUT_INTERP(x) ((x) == INTERPRETER_AOUT)
+#else
+#defi...