Re: [PATCH 26/48] objtool/klp: Don't set sym->file for section symbols
From: Peter Zijlstra
Date: Thu Apr 23 2026 - 04:34:55 EST
On Wed, Apr 22, 2026 at 09:03:54PM -0700, Josh Poimboeuf wrote:
> 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.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> ---
> 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 c4cb371e72b2..00c2389f345f 100644
> --- a/tools/objtool/elf.c
> +++ b/tools/objtool/elf.c
> @@ -680,7 +680,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;
> }
>
> --
> 2.53.0
>