Re: [PATCH v2 1/7] objtool/klp: Fix vmlinux .klp.symid link error for .no_trim_symbol symbols

Song Liu <[email protected]>
Newsgroups org.kernel.vger.live-patching,org.kernel.vger.linux-kernel
Message-ID <CAPhsuW4UgkF26GMEmXT5QxJ=SLS3u7JMHZ4KfAQVJeqUEDJkKA@mail.gmail.com>
On Wed, Aug 5, 2026 at 7:30 AM Josh Poimboeuf <[email protected]> wrote:
>
> Testing klp-build with arm64 produced the following linker error during
> the original kernel build:
>
>   `__notrim.1' referenced in section `.klp.symid' of vmlinux.o: defined in discarded section `.no_trim_symbol' of vmlinux.o
>
> symbol_get() puts a static __notrim[] in .no_trim_symbol, which GCC
> names __notrim.1, __notrim.2, etc.  Two or more built-in translation
> units calling symbol_get() thus produce duplicate names, resulting in
> corresponding .klp.symid references which trigger the above error.
>
> Add .no_trim_symbol to the discarded section list so its symbols don't
> get symids.
>
> Note this issue is not specific to arm64: it just needs two built-in
> symbol_get() callers.  arm64 trips over it easily because it has KVM
> always compiled in vmlinux, whereas on x86 it's typically a module.

Interesting. I didn't notice this difference between x86 and arm64.

>
> Fixes: 029223d30162 ("objtool/klp: Add .klp.symid for sympos disambiguation")
> Signed-off-by: Josh Poimboeuf <[email protected]>

Acked-by: Song Liu <[email protected]>
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.