mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 23:14:38 +00:00
Do not read the header if it's not "PT_LOAD"
This commit is contained in:
parent
b1e09147bf
commit
bade38e173
@ -183,10 +183,8 @@ namespace Execute
|
||||
uintptr_t MAddr;
|
||||
|
||||
if (ItrProgramHeader.p_type == PT_LOAD)
|
||||
{
|
||||
debug("PT_LOAD");
|
||||
else
|
||||
debug("Not PT_LOAD");
|
||||
|
||||
MAddr = (ItrProgramHeader.p_vaddr - BaseAddress) + (uintptr_t)MemoryImage;
|
||||
|
||||
memset(MemoryImage, 0, ItrProgramHeader.p_memsz);
|
||||
@ -196,6 +194,11 @@ namespace Execute
|
||||
debug("memset operation: 0 to %#lx for length %ld", MemoryImage + MAddr, ItrProgramHeader.p_memsz);
|
||||
debug("memcpy operation: %#lx to %#lx for length %ld", (uint8_t *)BaseImage + ItrProgramHeader.p_offset, MemoryImage + MAddr, ItrProgramHeader.p_filesz);
|
||||
}
|
||||
else
|
||||
{
|
||||
fixme("Not PT_LOAD (%ld)", ItrProgramHeader.p_type);
|
||||
}
|
||||
}
|
||||
|
||||
debug("Entry Point: %#lx", ELFHeader->e_entry);
|
||||
|
||||
|
@ -239,6 +239,7 @@ enum SegmentTypes
|
||||
PT_NOTE = 4,
|
||||
PT_SHLIB = 5,
|
||||
PT_PHDR = 6,
|
||||
PT_TLS = 7,
|
||||
PT_LOSUNW = 0x6ffffffa,
|
||||
PT_SUNWBSS = 0x6ffffffb,
|
||||
PT_SUNWSTACK = 0x6ffffffa,
|
||||
|
Loading…
x
Reference in New Issue
Block a user