1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00

LibELF+LibC: Add support for aarch64 relocations

This commit adds the used relocation types to elf.h, and handles the
types in DynamicLoader and DynamicObject. No new functionalitty has to
be added, as the same code can be reused between aarch64 and x86_64.
This commit is contained in:
Timon Kruiper 2023-01-31 09:45:50 +01:00 committed by Jelle Raaijmakers
parent cfd73e5d9f
commit ed3be5b7f5
3 changed files with 10 additions and 1 deletions

View file

@ -484,7 +484,7 @@ NonnullRefPtr<DynamicObject> DynamicObject::create(DeprecatedString const& filep
VirtualAddress DynamicObject::patch_plt_entry(u32 relocation_offset)
{
auto relocation = plt_relocation_section().relocation_at_offset(relocation_offset);
VERIFY(relocation.type() == R_X86_64_JUMP_SLOT);
VERIFY(relocation.type() == R_X86_64_JUMP_SLOT || relocation.type() == R_AARCH64_JUMP_SLOT);
auto symbol = relocation.symbol();
auto relocation_address = (FlatPtr*)relocation.address().as_ptr();