Re: [PATCH 07/14] module: Add module_kallsyms_on_each_core_symbol()
From: Josh Poimboeuf
Date: Mon Aug 03 2026 - 02:31:44 EST
On Sun, Aug 02, 2026 at 08:24:29PM -0700, Josh Poimboeuf wrote:
> module_kallsyms_on_each_symbol() iterates mod->kallsyms, which points at
> the full init symbol table until do_init_module() swaps it out. The set
> of symbols it reports thus differs based on whether init memory has been
> freed yet.
>
> Add module_kallsyms_on_each_core_symbol() for callers which need a
> symbol's position to be the same before and after that swap.
> core_kallsyms is fully populated by add_kallsyms() before the module
> leaves MODULE_STATE_UNFORMED, so it's readable on both paths.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
NAK
The Sashiko comment made me realize this is not worth adding kernel code
for. A duplicate symbol name between init and non-init module code is
somewhere between exceedingly rare and non-existent. I'll submit
another patch separately which will make it a build error for now.
--
Josh