Subject: modules fail to load for 64bit kernel with 32bit ELF format

From: Dave Johnson <[email-masked]>
Date: Wed, 3 Aug 2005 14:17:08 -0400

Building for 64bit kernel with 32bit ELF format produces the correct
object files for loading, but attempting to load them produces
ENOEXEC.

This is because the object file is failing ELF header checks in
load_module().

Elf_Ehdr in include/asm-mips/module.h is being defined as Elf64_Ehdr
based on CONFIG_MIPS64 instead of CONFIG_BUILD_ELF64.

elf_check_arch() also needs some fixing in include/asm-mips/elf.h as
it too is invoked from load_module(), however elf_check_arch() is also
used in binfmt_elf*.c.

Simply changing the defines produces loads of warnings due to casting
pointers around in module.c. Any suggestions on the best way to fix
this?

-- 
Dave Johnson
Starent Networks

---

From: Thiemo Seufer <[email-masked]>
Date: Wed, 3 Aug 2005 22:21:54 +0200

> pointers around in module.c. Any suggestions on the best way to fix

The plan is to obsolete 64bit kernel in 32bit ELF and use 64bit ELF
with gcc -msym32 to get a similiar optimization.

Thiemo