lkml.org 
[lkml]   [2022]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] Fixup for 54f2273e5fef ("module: Move kallsyms support into a separate file")
Date
Fixes: 54f2273e5fef ("module: Move kallsyms support into a separate file")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
kernel/module/internal.h | 7 ++++---
kernel/module/kallsyms.c | 3 +--
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index 6a54a1e06f4f..fecfa590c149 100644
--- a/kernel/module/internal.h
+++ b/kernel/module/internal.h
@@ -212,12 +212,13 @@ static inline void kmemleak_load_module(const struct module *mod,
const struct load_info *info) { }
#endif /* CONFIG_DEBUG_KMEMLEAK */

-#ifdef CONFIG_KALLSYMS
-#ifdef CONFIG_STACKTRACE_BUILD_ID
+#if defined(CONFIG_KALLSYMS) && defined(CONFIG_STACKTRACE_BUILD_ID)
void init_build_id(struct module *mod, const struct load_info *info);
-#else /* !CONFIG_STACKTRACE_BUILD_ID */
+#else
static inline void init_build_id(struct module *mod, const struct load_info *info) { }
#endif
+
+#ifdef CONFIG_KALLSYMS
void layout_symtab(struct module *mod, struct load_info *info);
void add_kallsyms(struct module *mod, const struct load_info *info);
unsigned long find_kallsyms_symbol_value(struct module *mod, const char *name);
diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c
index 6c8f1f390cf5..2ee8d2e67068 100644
--- a/kernel/module/kallsyms.c
+++ b/kernel/module/kallsyms.c
@@ -171,8 +171,7 @@ void add_kallsyms(struct module *mod, const struct load_info *info)
Elf_Shdr *symsec = &info->sechdrs[info->index.sym];

/* Set up to point into init section. */
- mod->kallsyms = (struct mod_kallsyms __rcu *)mod->init_layout.base +
- info->mod_kallsyms_init_off;
+ mod->kallsyms = (void __rcu *)mod->init_layout.base + info->mod_kallsyms_init_off;

/* The following is safe since this pointer cannot change */
rcu_dereference_sched(mod->kallsyms)->symtab = (void *)symsec->sh_addr;
--
2.34.1
\
 
 \ /
  Last update: 2022-02-22 11:24    [W:0.035 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site