1 #ifndef _LINUX_MODULELOADER_H
2 #define _LINUX_MODULELOADER_H
3 /* The stuff needed for archs to support modules. */
5 #include <linux/module.h>
8 /* These must be implemented by the specific architecture */
10 /* Adjust arch-specific sections. Return 0 on success. */
11 int module_frob_arch_sections(Elf_Ehdr *hdr,
16 /* Allocator used for allocating struct module, core sections and init
17 sections. Returns NULL on failure. */
18 void *module_alloc(unsigned long size);
20 /* Free memory returned from module_alloc. */
21 void module_free(struct module *mod, void *module_region);
23 /* Apply the given relocation to the (simplified) ELF. Return -error
25 int apply_relocate(Elf_Shdr *sechdrs,
27 unsigned int symindex,
31 /* Apply the given add relocation to the (simplified) ELF. Return
33 int apply_relocate_add(Elf_Shdr *sechdrs,
35 unsigned int symindex,
39 /* Any final processing of module before access. Return -error or 0. */
40 int module_finalize(const Elf_Ehdr *hdr,
41 const Elf_Shdr *sechdrs,
44 /* Any cleanup needed when module leaves. */
45 void module_arch_cleanup(struct module *mod);