Re: [PATCH v3 2/3] module/kallsyms: Refactor current symbol filtering into is_kept_symbol()

Tiezhu Yang <[email protected]>
Newsgroups dev.linux.lists.loongarch,org.kernel.vger.linux-kernel,org.kernel.vger.linux-modules
Message-ID <[email protected]>
On 2026/8/18 下午7:58, Petr Pavlu wrote:
> On 8/12/26 5:28 AM, Tiezhu Yang wrote:
>> Currently, the loops in layout_symtab() and add_kallsyms() duplicate the
>> exact same checks (i == 0 || is_livepatch_module() || is_core_symbol())
>> to determine whether a symbol should be preserved in the module's core
>> symbol table.
>>
>> Rename is_core_symbol() to is_kept_symbol() and move the entire checking
>> logic inside it, including the special handlers for the first symbol and
>> livepatch modules.
>>
>> No functional change.
>>
>> Suggested-by: Petr Pavlu <[email protected]>
>> Signed-off-by: Tiezhu Yang <[email protected]>
> 
> Looks ok to me. I'm also fine also keeping the current name,
> is_core_symbol(), as Huacai mentions in his review [1]. I previously
> suggested is_kept_symbol() [2], since the is_livepatch_module() check
> is moved into this function. However, is_core_symbol() is still ok, as
> it is consistent with where the symbols are assigned, in
> module::core_kallsyms.

OK, let me use is_core_symbol() in v4.

> The important part is to avoid duplicating the checks that determine
> whether a symbol should be kept in layout_symtab() and add_kallsyms().
> 
> Reviewed-by: Petr Pavlu <[email protected]>

Thanks,
Tiezhu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.