[tip: objtool/core] objtool/klp: Don't report uncorrelated functions as new

From: tip-bot2 for Josh Poimboeuf

Date: Tue May 05 2026 - 07:11:40 EST


The following commit has been merged into the objtool/core branch of tip:

Commit-ID: 76eb0f8639fbc6bcc0e7c1ca649c456bfebc4d5c
Gitweb: https://git.kernel.org/tip/76eb0f8639fbc6bcc0e7c1ca649c456bfebc4d5c
Author: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
AuthorDate: Mon, 13 Apr 2026 01:59:31 -07:00
Committer: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
CommitterDate: Mon, 04 May 2026 21:16:00 -07:00

objtool/klp: Don't report uncorrelated functions as new

Clang LTO uses __UNIQUE_ID() to generate some uniquely named wrapper
functions, like initstubs. If they're uncorrelated, prevent them from
being reported as new functions and included unnecessarily.

Note that dont_correlate() already includes prefix functions, so prefix
functions are still being ignored here.

Acked-by: Song Liu <song@xxxxxxxxxx>
Reviewed-by: Miroslav Benes <mbenes@xxxxxxx>
Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
---
tools/objtool/klp-diff.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c
index 4f66811..ccb16a4 100644
--- a/tools/objtool/klp-diff.c
+++ b/tools/objtool/klp-diff.c
@@ -802,7 +802,7 @@ static int mark_changed_functions(struct elfs *e)

/* Find changed functions */
for_each_sym(e->orig, sym_orig) {
- if (!is_func_sym(sym_orig) || is_prefix_func(sym_orig))
+ if (!is_func_sym(sym_orig) || dont_correlate(sym_orig))
continue;

patched_sym = sym_orig->twin;
@@ -818,7 +818,7 @@ static int mark_changed_functions(struct elfs *e)

/* Find added functions and print them */
for_each_sym(e->patched, patched_sym) {
- if (!is_func_sym(patched_sym) || is_prefix_func(patched_sym))
+ if (!is_func_sym(patched_sym) || dont_correlate(patched_sym))
continue;

if (!patched_sym->twin) {