The following commit has been merged into the objtool/core branch of tip:
Commit-ID: 5f49ec82b9f65507c262a6e3f1b53663f79eedce
Gitweb: https://git.kernel.org/tip/5f49ec82b9f65507c262a6e3f1b53663f79eedce
Author: Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate: Wed, 29 Apr 2026 21:54:41 -07:00
Committer: Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Mon, 04 May 2026 21:16:02 -07:00
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 <song@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
tools/objtool/klp-diff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c
index ca87bcb..463b6da 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;
}