Re: [PATCH 1/2] MN10300: Permit AOUT library support to be suppressed in ELF binfmt

Previous thread: (online, partial) list of unused CONFIG variables in the source tree by Robert P. J. Day on Friday, October 26, 2007 - 11:28 am. (1 message)

Next thread: Regression: commit "ide: constify struct ide_port_info" causes breakage by Russell King on Friday, October 26, 2007 - 11:56 am. (7 messages)
To: <torvalds@...>, <akpm@...>
Cc: <linux-kernel@...>, <linux-am33-list@...>, <dhowells@...>
Date: Friday, October 26, 2007 - 11:42 am

These patches add the MEI/Panasonic MN10300/AM33 architecture to the Linux
kernel.

The first patch makes it possible to suppress AOUT support in the ELF binfmt.
MN10300 does not support the AOUT binfmt, so the ELF binfmt should not be
permitted to go looking for AOUT libraries to load.

The second patch adds the architecture itself, to be selected by ARCH=mn10300
on the make command line.

The patches can also be downloaded from:

http://people.redhat.com/~dhowells/mn10300/mn10300-arch.tar.bz2

A suitable toolchain can be downloaded from:

ftp://ftp.redhat.com/pub/redhat/gnupro/AM33/

The latest is currently:

am33-04r2-5/tools/i686-pc-linux-gnulibc2.3-x-am33_2.0-linux-gnu.tar.bz2

David
-

To: <torvalds@...>, <akpm@...>
Cc: <linux-kernel@...>, <linux-am33-list@...>, <dhowells@...>
Date: Friday, October 26, 2007 - 11:42 am

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...

To: David Howells <dhowells@...>
Cc: <torvalds@...>, <linux-kernel@...>, <linux-am33-list@...>, <dhowells@...>
Date: Friday, October 26, 2007 - 3:26 pm

On Fri, 26 Oct 2007 16:42:15 +0100

hm, seems a bit ungainly. Why can't we just make all the aout things in
binfmt_elf.c depend upon CONFIG_BINFMT_AOUT?

-

To: Andrew Morton <akpm@...>
Cc: <dhowells@...>, <torvalds@...>, <linux-kernel@...>, <linux-am33-list@...>
Date: Friday, October 26, 2007 - 6:29 pm

[Empty message]
Previous thread: (online, partial) list of unused CONFIG variables in the source tree by Robert P. J. Day on Friday, October 26, 2007 - 11:28 am. (1 message)

Next thread: Regression: commit "ide: constify struct ide_port_info" causes breakage by Russell King on Friday, October 26, 2007 - 11:56 am. (7 messages)