[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c1fdda1d836cdd7a05d3178d5e6ea4b687e548cd.1645525354.git.christophe.leroy@csgroup.eu>
Date: Tue, 22 Feb 2022 11:23:27 +0100
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Aaron Tomlin <atomlin@...hat.com>,
Luis Chamberlain <mcgrof@...nel.org>,
linux-modules@...r.kernel.org
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
linux-kernel@...r.kernel.org
Subject: [PATCH 4/4] Fixup for 54f2273e5fef ("module: Move kallsyms support into a separate file")
Fixes: 54f2273e5fef ("module: Move kallsyms support into a separate file")
Signed-off-by: Christophe Leroy <christophe.leroy@...roup.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
Powered by blists - more mailing lists