diff options
Diffstat (limited to 'kexec/arch/arm64/kexec-arm64.c')
-rw-r--r-- | kexec/arch/arm64/kexec-arm64.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c index 9dd072c..e25f600 100644 --- a/kexec/arch/arm64/kexec-arm64.c +++ b/kexec/arch/arm64/kexec-arm64.c @@ -1250,6 +1250,10 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym), # define R_AARCH64_LDST64_ABS_LO12_NC 286 #endif +#if !defined(R_AARCH64_LDST128_ABS_LO12_NC) +# define R_AARCH64_LDST128_ABS_LO12_NC 299 +#endif + uint64_t *loc64; uint32_t *loc32; uint64_t *location = (uint64_t *)ptr; @@ -1309,6 +1313,7 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym), *loc32 = cpu_to_le32(le32_to_cpu(*loc32) + (((value - address) >> 2) & 0x3ffffff)); break; + /* encode imm field with bits [11:3] of value */ case R_AARCH64_LDST64_ABS_LO12_NC: if (value & 7) die("%s: ERROR Unaligned value: %lx\n", __func__, @@ -1318,6 +1323,17 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym), *loc32 = cpu_to_le32(le32_to_cpu(*loc32) + ((value & 0xff8) << (10 - 3))); break; + + /* encode imm field with bits [11:4] of value */ + case R_AARCH64_LDST128_ABS_LO12_NC: + if (value & 15) + die("%s: ERROR Unaligned value: %lx\n", __func__, + value); + type = "LDST128_ABS_LO12_NC"; + loc32 = ptr; + imm = value & 0xff0; + *loc32 = cpu_to_le32(le32_to_cpu(*loc32) + (imm << (10 - 4))); + break; default: die("%s: ERROR Unknown type: %lu\n", __func__, r_type); break; |