.. | .. |
---|
29 | 29 | /* Free memory returned from module_alloc. */ |
---|
30 | 30 | void module_memfree(void *module_region); |
---|
31 | 31 | |
---|
| 32 | +/* Determines if the section name is an init section (that is only used during |
---|
| 33 | + * module loading). |
---|
| 34 | + */ |
---|
| 35 | +bool module_init_section(const char *name); |
---|
| 36 | + |
---|
| 37 | +/* Determines if the section name is an exit section (that is only used during |
---|
| 38 | + * module unloading) |
---|
| 39 | + */ |
---|
| 40 | +bool module_exit_section(const char *name); |
---|
| 41 | + |
---|
| 42 | +/* Describes whether within_module_init() will consider this an init section |
---|
| 43 | + * or not. This behaviour changes with CONFIG_MODULE_UNLOAD. |
---|
| 44 | + */ |
---|
| 45 | +bool module_init_layout_section(const char *sname); |
---|
| 46 | + |
---|
32 | 47 | /* |
---|
33 | 48 | * Apply the given relocation to the (simplified) ELF. Return -error |
---|
34 | 49 | * or 0. |
---|
.. | .. |
---|
86 | 101 | /* Any cleanup before freeing mod->module_init */ |
---|
87 | 102 | void module_arch_freeing_init(struct module *mod); |
---|
88 | 103 | |
---|
89 | | -#ifdef CONFIG_KASAN |
---|
| 104 | +#if (defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)) && \ |
---|
| 105 | + !defined(CONFIG_KASAN_VMALLOC) |
---|
90 | 106 | #include <linux/kasan.h> |
---|
91 | 107 | #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT) |
---|
92 | 108 | #else |
---|