mirror of
https://github.com/AuxXxilium/redpill-lkm5.git
synced 2024-11-23 15:01:01 +07:00
update apply_relocate_add for R_X86_64_PC64 and R_X86_64_PLT32 (#11)
For SA6400 DSM 7.2, there are many errors when load modules: "Unknown rela relocation: 4" The root cause is that the apply_relocate_add is outdated, so update it here.
This commit is contained in:
parent
69a8d200f8
commit
ac1c30d109
@ -344,9 +344,14 @@ static int _apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, unsigned
|
||||
goto overflow;
|
||||
break;
|
||||
case R_X86_64_PC32:
|
||||
case R_X86_64_PLT32:
|
||||
val -= (u64)loc;
|
||||
*(u32 *)loc = val;
|
||||
break;
|
||||
case R_X86_64_PC64:
|
||||
val -= (u64)loc;
|
||||
*(u64 *)loc = val;
|
||||
break;
|
||||
default:
|
||||
pr_err("%s: Unknown rela relocation: %llu\n",
|
||||
me->name, ELF64_R_TYPE(rel[i].r_info));
|
||||
|
Loading…
Reference in New Issue
Block a user