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

LibELF: Implement PLT relocations for x86_64

This commit is contained in:
Gunnar Beutner 2021-06-29 17:43:08 +02:00 committed by Andreas Kling
parent 1d4ae9194e
commit d3127efc01
3 changed files with 44 additions and 3 deletions

View file

@ -449,7 +449,11 @@ NonnullRefPtr<DynamicObject> DynamicObject::create(const String& filename, Virtu
VirtualAddress DynamicObject::patch_plt_entry(u32 relocation_offset)
{
auto relocation = plt_relocation_section().relocation_at_offset(relocation_offset);
#if ARCH(I386)
VERIFY(relocation.type() == R_386_JMP_SLOT);
#else
VERIFY(relocation.type() == R_X86_64_JUMP_SLOT);
#endif
auto symbol = relocation.symbol();
u8* relocation_address = relocation.address().as_ptr();