From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Eva Kurchatova <eva.kurchatova@virtuozzo.com>,
Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.2 1/6] ms/objtool/klp: Fix bug table handling for __WARN_printf()
Date: Thu, 26 Nov 2026 22:51:16 +0100 [thread overview]
Message-ID: <20261126-khorenko-vstor-157128-more-klp-build-fixes-v1-1-69a0363954e4@virtuozzo.com> (raw)
In-Reply-To: <20261126-khorenko-vstor-157128-more-klp-build-fixes-v1-0-69a0363954e4@virtuozzo.com>
From: Josh Poimboeuf <jpoimboe@kernel.org>
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@kernel.org>
Tested-by: Song Liu <song@kernel.org>
Link: https://patch.msgid.link/a8e0a714b9da962858842b9aecd63b4900927c88.1769406850.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
[khorenko@: 26.x has no 5b472b6e5bd9, so no code references a bug table
entry directly and this changes nothing here; taken as context for the
next patch]
(cherry picked from commit f2dba60339a6299e181671e95293efe312237e2d)
https://virtuozzo.atlassian.net/browse/VSTOR-157128
Feature: klp-build support
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
tools/objtool/klp-diff.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c
index 066dbe69c7093..530d91644eb4b 100644
--- a/tools/objtool/klp-diff.c
+++ b/tools/objtool/klp-diff.c
@@ -1600,9 +1600,6 @@ static int clone_special_sections(struct elfs *e)
{
struct section *patched_sec;
- if (create_fake_symbols(e->patched))
- return -1;
-
for_each_sec(e->patched, patched_sec) {
if (is_special_section(patched_sec)) {
if (clone_special_section(e, patched_sec))
@@ -1885,6 +1882,17 @@ int cmd_klp_diff(int argc, const char **argv)
if (!e.out)
return -1;
+ /*
+ * Special section fake symbols are needed so that individual special
+ * section entries can be extracted by clone_special_sections().
+ *
+ * Note the fake symbols are also needed by clone_included_functions()
+ * because __WARN_printf() call sites add references to bug table
+ * entries in the calling functions.
+ */
+ if (create_fake_symbols(e.patched))
+ return -1;
+
if (clone_included_functions(&e))
return -1;
--
2.43.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-26 21:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 21:51 [Devel] [PATCH hci-8.2 0/6] objtool/klp: more upstream klp-build fixes for the 8.2 kernel Konstantin Khorenko
2026-11-26 21:51 ` Konstantin Khorenko [this message]
2026-12-01 0:41 ` [Devel] [PATCH hci-8.2 1/6] ms/objtool/klp: Fix bug table handling for __WARN_printf() no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 2/6] ms/objtool/klp: Fix extraction of text annotations for alternatives Konstantin Khorenko
2026-12-01 0:41 ` no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 3/6] ms/objtool/klp: Fix false module dependencies caused by dead relocs Konstantin Khorenko
2026-12-01 0:43 ` no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 4/6] ms/objtool/klp: Explicitly disallow patching or referencing init code/data Konstantin Khorenko
2026-12-01 0:43 ` no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 5/6] ms/klp-build: Fix wrong index in funcs cleanup error path Konstantin Khorenko
2026-12-01 0:44 ` no-reply
2026-11-26 21:51 ` [Devel] [PATCH hci-8.2 6/6] ms/objtool/klp: Fix checksums for constant pool references Konstantin Khorenko
2026-12-01 0:45 ` no-reply
2026-11-27 14:42 ` [Devel] [PATCH hci-8.2 0/6] objtool/klp: more upstream klp-build fixes for the 8.2 kernel Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261126-khorenko-vstor-157128-more-klp-build-fixes-v1-1-69a0363954e4@virtuozzo.com \
--to=khorenko@virtuozzo.com \
--cc=devel@openvz.org \
--cc=eva.kurchatova@virtuozzo.com \
--cc=vasileios.almpanis@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.