aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
diff options
context:
space:
mode:
authorIvan Kokshaysky <ink@jurassic.park.msu.ru>2009-04-30 18:08:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-02 18:36:10 -0400
commit74641f584da8eccf30becfbb5507ab457187db22 (patch)
treeda212b7ae1b5a2a50a4314b3a75df5763623295e /arch/alpha
parent77b4cf5cb0c9d6010a18030a0e0a8d2aaf6b43ec (diff)
alpha: binfmt_aout fix
This fixes the problem introduced by commit 3bfacef412 (get rid of special-casing the /sbin/loader on alpha): osf/1 ecoff binary segfaults when binfmt_aout built as module. That happens because aout binary handler gets on the top of the binfmt list due to late registration, and kernel attempts to execute the binary without preparatory work that must be done by binfmt_loader. Fixed by changing the registration order of the default binfmt handlers using list_add_tail() and introducing insert_binfmt() function which places new handler on the top of the binfmt list. This might be generally useful for installing arch-specific frontends for default handlers or just for overriding them. Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: Richard Henderson <rth@twiddle.net Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/kernel/Makefile6
-rw-r--r--arch/alpha/kernel/binfmt_loader.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile
index a427538252f8..7739a62440a7 100644
--- a/arch/alpha/kernel/Makefile
+++ b/arch/alpha/kernel/Makefile
@@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror -Wno-sign-compare
8 8
9obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \ 9obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
10 irq_alpha.o signal.o setup.o ptrace.o time.o \ 10 irq_alpha.o signal.o setup.o ptrace.o time.o \
11 alpha_ksyms.o systbls.o err_common.o io.o binfmt_loader.o 11 alpha_ksyms.o systbls.o err_common.o io.o
12 12
13obj-$(CONFIG_VGA_HOSE) += console.o 13obj-$(CONFIG_VGA_HOSE) += console.o
14obj-$(CONFIG_SMP) += smp.o 14obj-$(CONFIG_SMP) += smp.o
@@ -43,6 +43,10 @@ else
43# Misc support 43# Misc support
44obj-$(CONFIG_ALPHA_SRM) += srmcons.o 44obj-$(CONFIG_ALPHA_SRM) += srmcons.o
45 45
46ifdef CONFIG_BINFMT_AOUT
47obj-y += binfmt_loader.o
48endif
49
46# Core logic support 50# Core logic support
47obj-$(CONFIG_ALPHA_APECS) += core_apecs.o 51obj-$(CONFIG_ALPHA_APECS) += core_apecs.o
48obj-$(CONFIG_ALPHA_CIA) += core_cia.o 52obj-$(CONFIG_ALPHA_CIA) += core_cia.o
diff --git a/arch/alpha/kernel/binfmt_loader.c b/arch/alpha/kernel/binfmt_loader.c
index 4a0af906b00a..3fcfad410130 100644
--- a/arch/alpha/kernel/binfmt_loader.c
+++ b/arch/alpha/kernel/binfmt_loader.c
@@ -46,6 +46,6 @@ static struct linux_binfmt loader_format = {
46 46
47static int __init init_loader_binfmt(void) 47static int __init init_loader_binfmt(void)
48{ 48{
49 return register_binfmt(&loader_format); 49 return insert_binfmt(&loader_format);
50} 50}
51arch_initcall(init_loader_binfmt); 51arch_initcall(init_loader_binfmt);