[tip: objtool/core] objtool/klp: Don't set sym->file for section symbols

From: tip-bot2 for Josh Poimboeuf

Date: Tue May 05 2026 - 07:07:43 EST


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

Commit-ID: 8d4cbb6d0caf03b0a22be4d6d2198a9edac46517
Gitweb: https://git.kernel.org/tip/8d4cbb6d0caf03b0a22be4d6d2198a9edac46517
Author: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
AuthorDate: Sun, 12 Apr 2026 22:40:02 -07:00
Committer: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
CommitterDate: Mon, 04 May 2026 21:16:04 -07:00

objtool/klp: Don't set sym->file for section symbols

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@xxxxxxxxxxxxx>
Acked-by: Song Liu <song@xxxxxxxxxx>
Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
---
tools/objtool/elf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index f41280e..d9cee8d 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -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;
}