mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
LibELF+LibC: Add support for relative relocations in aarch64 binaries
This commit adds R_AARCH64_RELATIVE to elf.h and uses it in ELF::perform_relative_relocations to correctly verify the relocation type. This is the only change needed to support relative relocations for aarch64.
This commit is contained in:
parent
b2e223d2bc
commit
4b0f8e9a20
2 changed files with 3 additions and 1 deletions
|
@ -59,7 +59,7 @@ bool perform_relative_relocations(FlatPtr base_address)
|
|||
for (unsigned i = 0; i < relocation_count; ++i) {
|
||||
size_t offset_in_section = i * relocation_entry_size;
|
||||
auto* relocation = (ElfW(Rela)*)(relocation_section_addr + offset_in_section);
|
||||
VERIFY(ELF64_R_TYPE(relocation->r_info) == R_X86_64_RELATIVE);
|
||||
VERIFY(ELF64_R_TYPE(relocation->r_info) == R_X86_64_RELATIVE || ELF64_R_TYPE(relocation->r_info) == R_AARCH64_RELATIVE);
|
||||
auto* patch_address = (FlatPtr*)(base_address + relocation->r_offset);
|
||||
FlatPtr relocated_address;
|
||||
if (use_addend) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue