This source file includes following definitions.
- apply_relocate
- apply_relocate_add
1
2 #ifndef _LINUX_MODULELOADER_H
3 #define _LINUX_MODULELOADER_H
4
5
6 #include <linux/module.h>
7 #include <linux/elf.h>
8
9
10
11
12
13
14
15
16
17 int module_frob_arch_sections(Elf_Ehdr *hdr,
18 Elf_Shdr *sechdrs,
19 char *secstrings,
20 struct module *mod);
21
22
23 unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section);
24
25
26
27 void *module_alloc(unsigned long size);
28
29
30 void module_memfree(void *module_region);
31
32
33
34
35 bool module_exit_section(const char *name);
36
37
38
39
40
41 #ifdef CONFIG_MODULES_USE_ELF_REL
42 int apply_relocate(Elf_Shdr *sechdrs,
43 const char *strtab,
44 unsigned int symindex,
45 unsigned int relsec,
46 struct module *mod);
47 #else
48 static inline int apply_relocate(Elf_Shdr *sechdrs,
49 const char *strtab,
50 unsigned int symindex,
51 unsigned int relsec,
52 struct module *me)
53 {
54 printk(KERN_ERR "module %s: REL relocation unsupported\n",
55 module_name(me));
56 return -ENOEXEC;
57 }
58 #endif
59
60
61
62
63
64 #ifdef CONFIG_MODULES_USE_ELF_RELA
65 int apply_relocate_add(Elf_Shdr *sechdrs,
66 const char *strtab,
67 unsigned int symindex,
68 unsigned int relsec,
69 struct module *mod);
70 #else
71 static inline int apply_relocate_add(Elf_Shdr *sechdrs,
72 const char *strtab,
73 unsigned int symindex,
74 unsigned int relsec,
75 struct module *me)
76 {
77 printk(KERN_ERR "module %s: REL relocation unsupported\n",
78 module_name(me));
79 return -ENOEXEC;
80 }
81 #endif
82
83
84 int module_finalize(const Elf_Ehdr *hdr,
85 const Elf_Shdr *sechdrs,
86 struct module *mod);
87
88
89 void module_arch_cleanup(struct module *mod);
90
91
92 void module_arch_freeing_init(struct module *mod);
93
94 #ifdef CONFIG_KASAN
95 #include <linux/kasan.h>
96 #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT)
97 #else
98 #define MODULE_ALIGN PAGE_SIZE
99 #endif
100
101 #endif