]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
objtool/klp: Don't report uncorrelated functions as new
authorJosh Poimboeuf <jpoimboe@kernel.org>
Mon, 13 Apr 2026 08:59:31 +0000 (01:59 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 5 May 2026 04:16:00 +0000 (21:16 -0700)
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@kernel.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
tools/objtool/klp-diff.c

index 4f668117c45e66d82bcf69f72d561252d06b3ae0..ccb16a45107e3ceadca194db5e794957d5e83faf 100644 (file)
@@ -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) {