Moving find_kallsyms_symbol_value from kernel/module/internal.h to include/linux/module.h. The reason is that internal.h is not prepared to be included when CONFIG_MODULES=n. find_kallsyms_symbol_value is used by kernel/bpf/verifier.c and including internal.h from it (without modules) leads into a compilation error: In file included from ../include/linux/container_of.h:5, from ../include/linux/list.h:5, from ../include/linux/timer.h:5, from ../include/linux/workqueue.h:9, from ../include/linux/bpf.h:10, from ../include/linux/bpf-cgroup.h:5, from ../kernel/bpf/verifier.c:7: ../kernel/bpf/../module/internal.h: In function 'mod_find': ../include/linux/container_of.h:20:54: error: invalid use of undefined type 'struct module' 20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \ | ^~ [...] This patch fixes the above error.
Showing the changes to kernel/module (1 of 3 files). Show all
Unified · Split
| @@ -246,7 +246,6 @@ static inline void kmemleak_load_module(const struct module *mod, · 245 unmodified lines | ||
| 246 | 246 | void init_build_id(struct module *mod, const struct load_info *info); |
| 247 | 247 | void layout_symtab(struct module *mod, struct load_info *info); |
| 248 | 248 | void add_kallsyms(struct module *mod, const struct load_info *info); |
| 249 | −unsigned long find_kallsyms_symbol_value(struct module *mod, const char *name); | |
| 250 | 249 | |
| 251 | 250 | static inline bool sect_empty(const Elf_Shdr *sect) |
| 252 | 251 | { |
| @@ -256,11 +255,6 @@ static inline bool sect_empty(const Elf_Shdr *sect) · 3 unmodified lines | ||
| 256 | 255 | static inline void init_build_id(struct module *mod, const struct load_info *info) { } |
| 257 | 256 | static inline void layout_symtab(struct module *mod, struct load_info *info) { } |
| 258 | 257 | static inline void add_kallsyms(struct module *mod, const struct load_info *info) { } |
| 259 | −static inline unsigned long find_kallsyms_symbol_value(struct module *mod, | |
| 260 | − const char *name) | |
| 261 | −{ | |
| 262 | − return 0; | |
| 263 | −} | |
| 264 | 258 | #endif /* CONFIG_KALLSYMS */ |
| 265 | 259 | |
| 266 | 260 | #ifdef CONFIG_SYSFS |