Re: [PATCH] objtool/klp: Fix bug table handling for __WARN_printf()

From: Song Liu

Date: Mon Jan 26 2026 - 13:44:54 EST


On Sun, Jan 25, 2026 at 9:56 PM Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> Running objtool klp-diff on a changed function which uses WARN() can
> fail with:
>
> vmlinux.o: error: objtool: md_run+0x866: failed to convert reloc sym '__bug_table' to its proper format
>
> The problem is that since commit 5b472b6e5bd9 ("x86_64/bug: Implement
> __WARN_printf()"), each __WARN_printf() call site now directly
> references its bug table entry. klp-diff errors out when it can't
> convert such section-based references to object symbols (because bug
> table entries don't have symbols).
>
> Luckily, klp-diff already has code to create symbols for bug table
> entries. Move that code earlier, before function diffing.
>
> Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files")
> Fixes: 5b472b6e5bd9 ("x86_64/bug: Implement __WARN_printf()")
> Reported-by: Song Liu <song@xxxxxxxxxx>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>

Tested-by: Song Liu <song@xxxxxxxxxx>

Thanks for the fix!