| Age | Commit message (Collapse) | Author |
|
Use the mapping of Elf_[SPE]hdr, Elf_Addr, Elf_Sym, Elf_Dyn, Elf_Rel/Rela,
ELF_R_TYPE() and ELF_R_SYM() to either the 32-bit version or the 64-bit version
into asm-generic/module.h for all arches bar MIPS.
Also, use the generic definition mod_arch_specific where possible.
To this end, I've defined three new config bools:
(*) HAVE_MOD_ARCH_SPECIFIC
Arches define this if they don't want to use the empty generic
mod_arch_specific struct.
(*) MODULES_USE_ELF_RELA
Arches define this if their modules can contain RELA records. This causes
the Elf_Rela mapping to be emitted and allows apply_relocate_add() to be
defined by the arch rather than have the core emit an error message.
(*) MODULES_USE_ELF_REL
Arches define this if their modules can contain REL records. This causes
the Elf_Rel mapping to be emitted and allows apply_relocate() to be
defined by the arch rather than have the core emit an error message.
Note that it is possible to allow both REL and RELA records: m68k and mips are
two arches that do this.
With this, some arch asm/module.h files can be deleted entirely and replaced
with a generic-y marker in the arch Kbuild file.
Additionally, I have removed the bits from m32r and score that handle the
unsupported type of relocation record as that's now handled centrally.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
The module loader code allows architectures to hook into the code by
providing a small number of entry points that each arch must implement.
This patch provides __weakly linked generic implementations of these
entry points for architectures that don't need to do anything special.
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
When creating the final layout of a kernel module in memory, allow the
module loader to reserve some additional memory in front of a given section.
This is currently only needed for the parisc port which needs to put the
stub entries there to fulfill the 17/22bit PCREL relocations with large
kernel modules like xfs.
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (renamed fn)
|
|
From: Rusty Russell <rusty@rustcorp.com.au>, David Mosberger
The patch below updates the other platforms with module_arch_cleanup().
Also, I added more debug output to kernel/module.c since I found it useful
to be able to see the final section layout.
|
|
|
|
The declaration of `module_frob_arch_sections' in moduleloader.h (and
the definitions in most of the module.c files) are inconsistent with the
definition in the PPC's module.c -- in the latter the first two
arguments are not declared `const', whereas everyplace else they are.
PS. secstrings can be modded to: if an arch can't handle discarding
init, it simply renames the .init sections.
|
|
RTH's final complaint (so far 8) was that we should sort the module
sections: archs might require some sections to be adjacent, so they can
all be reached by a relative pointer (ie. GOT pointer). This
implements that reordering, and simplfies the module interface for
architectures as well.
Previously an arch could specify it wanted extra space, but not where
that space would be. The new method (used only by PPC so far) is to
allocate an empty section (in asm/module.h or by setting LDFLAGS_MODULE
to use an arch specific linker script), and expand that to the desired
size in "module_frob_arch_sections()".
|
|
Sparc64 (and probably others) need all the kernel symbols within
32-bits, which includes the manufactured "__this_module" which refers
to the struct module *.
This changes the interface back to its old style: the arch-specific code
manipulates the init and core sizes, and we call module_alloc() ourselves.
|
|
Separates the module loading function prototypes (and elf.h) into
moduleloader.h. AT_GID in elf.h clashes with xfs.h, but this also
makes module.h less cluttered.
|