]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
objtool/klp: Don't set sym->file for section symbols
authorJosh Poimboeuf <jpoimboe@kernel.org>
Mon, 13 Apr 2026 05:40:02 +0000 (22:40 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 5 May 2026 04:16:04 +0000 (21:16 -0700)
Section symbols aren't grouped after their corresponding FILE symbols.
Their sym->file should really be NULL rather than whatever random FILE
happened to be last.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
tools/objtool/elf.c

index f41280e454ca46dc1a8f7ff0c40ee226a2e11d91..d9cee8d5d9e8fb632ba3580227cc50c0a1018828 100644 (file)
@@ -649,7 +649,7 @@ static int read_symbols(struct elf *elf)
 
                if (is_file_sym(sym))
                        file = sym;
-               else if (sym->bind == STB_LOCAL)
+               else if (sym->bind == STB_LOCAL && !is_sec_sym(sym))
                        sym->file = file;
        }