1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +00:00

Kernel+LibELF: Add support for validating and loading ELF64 executables

This commit is contained in:
Gunnar Beutner 2021-06-28 17:24:08 +02:00 committed by Andreas Kling
parent e35b060501
commit 158355e0d7
13 changed files with 109 additions and 78 deletions

View file

@ -35,8 +35,8 @@ static void perform_self_relocations(auxv_t* auxvp)
}
}
VERIFY(found_base_address);
Elf32_Ehdr* header = (Elf32_Ehdr*)(base_address);
Elf32_Phdr* pheader = (Elf32_Phdr*)(base_address + header->e_phoff);
ElfW(Ehdr)* header = (ElfW(Ehdr)*)(base_address);
ElfW(Phdr)* pheader = (ElfW(Phdr)*)(base_address + header->e_phoff);
u32 dynamic_section_addr = 0;
for (size_t i = 0; i < (size_t)header->e_phnum; ++i, ++pheader) {
if (pheader->p_type != PT_DYNAMIC)