From: Josh Poimboeuf Date: Thu, 30 Apr 2026 04:54:41 +0000 (-0700) Subject: objtool/klp: Fix reloc corruption in convert_reloc_sym_to_secsym() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f49ec82b9f65507c262a6e3f1b53663f79eedce;p=thirdparty%2Fkernel%2Flinux.git objtool/klp: Fix reloc corruption in convert_reloc_sym_to_secsym() Use the section symbol's index instead of the old symbol's index when updating the ELF relocation entry in convert_reloc_sym_to_secsym(). Found by Sashiko review. Acked-by: Song Liu Signed-off-by: Josh Poimboeuf --- diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c index ca87bcb9afa34..463b6daa52341 100644 --- a/tools/objtool/klp-diff.c +++ b/tools/objtool/klp-diff.c @@ -975,7 +975,7 @@ static int convert_reloc_sym_to_secsym(struct elf *elf, struct reloc *reloc) return -1; reloc->sym = sec->sym; - set_reloc_sym(elf, reloc, sym->idx); + set_reloc_sym(elf, reloc, sec->sym->idx); set_reloc_addend(elf, reloc, sym->offset + reloc_addend(reloc)); return 0; }