mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04: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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user