From: Peter Oberparleiter Disable calling of constructor functions for uml as they are already called by the host run-time environment. Found-by: Miklos Szeredi Signed-off-by: Peter Oberparleiter Cc: Jeff Dike Cc: Sam Ravnborg Signed-off-by: Andrew Morton --- init/main.c | 4 ++++ kernel/module.c | 4 ++++ 2 files changed, 8 insertions(+) diff -puN init/main.c~kernel-call-constructors-uml-fix-2 init/main.c --- a/init/main.c~kernel-call-constructors-uml-fix-2 +++ a/init/main.c @@ -692,11 +692,15 @@ asmlinkage void __init start_kernel(void static void __init do_ctors(void) { +#ifndef CONFIG_UML + /* Note: constructors on UML are called by the host run-time + * environment. */ ctorcall_t *call; for (call = (ctorcall_t *) __ctor_start; call < (ctorcall_t *) __ctor_end; call++) (*call)(); +#endif /* !CONFIG_UML */ } static int __initdata initcall_debug; diff -puN kernel/module.c~kernel-call-constructors-uml-fix-2 kernel/module.c --- a/kernel/module.c~kernel-call-constructors-uml-fix-2 +++ a/kernel/module.c @@ -2238,10 +2238,14 @@ static struct module *load_module(void _ static void do_mod_ctors(struct module *mod) { +#ifndef CONFIG_UML + /* Note: constructors on UML are called by the host run-time + * environment. */ unsigned long i; for (i = 0; i < mod->num_ctors; i++) mod->ctors[i](); +#endif /* !CONFIG_UML */ } /* This is where the real work happens */ _