arm64: fix static data relocations in machine_apply_elf_rel()
Subsystems (2)
PATCH 1/1 arm64: fix static data relocations in machine_apply_elf_rel()
As for 'static data relocations', instead of patching an instruction (OR ops), it should be assigned to value directly.
Signed-off-by Pingfan Liu <[email protected]>
Cc Geoff Levand <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Simon Horman <[email protected]>
--- kexec/arch/arm64/kexec-arm64.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kexec/arch/arm64/kexec-arm64.c +2 -3
@@ -1249,13 +1249,12 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym),case R_AARCH64_ABS64 : type ="ABS64" ; loc64 = ptr; - *loc64 =cpu_to_elf64 (ehdr,elf64_to_cpu (ehdr, *loc64) + value); + *loc64 =cpu_to_elf64 (ehdr, value);break ;case R_AARCH64_PREL32 : type ="PREL32" ; loc32 = ptr; - *loc32 =cpu_to_elf32 (ehdr, -elf32_to_cpu (ehdr, *loc32) + value - address); + *loc32 =cpu_to_elf32 (ehdr, value - address);break ;/* Set a MOV[KZ] immediate field to bits [15:0] of X. No overflow check */
Signature · 1 line
2.31.1
Simon Horman
AppliedPATCH 1/1 arm64: fix static data relocations in machine_apply_elf_rel()
Quoted 8 lines · Pingfan Liu
As for 'static data relocations', instead of patching an instruction (OR ops), it should be assigned to value directly.
Signed-off-by Pingfan Liu <[email protected]>Cc Geoff Levand <[email protected]>Cc Catalin Marinas <[email protected]>Cc Simon Horman <[email protected]>To: kexec at lists.infradead.org
Thanks, applied.