mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02: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:
parent
51e1dfce24
commit
5f49ec82b9
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user