diff options
Diffstat (limited to 'src/core/loader/elf.cpp')
-rw-r--r-- | src/core/loader/elf.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 352938dcb..6420a7f11 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -311,11 +311,11 @@ SharedPtr<CodeSet> ElfReader::LoadInto(u32 vaddr) { CodeSet::Segment* codeset_segment; u32 permission_flags = p->p_flags & (PF_R | PF_W | PF_X); if (permission_flags == (PF_R | PF_X)) { - codeset_segment = &codeset->code; + codeset_segment = &codeset->CodeSegment(); } else if (permission_flags == (PF_R)) { - codeset_segment = &codeset->rodata; + codeset_segment = &codeset->RODataSegment(); } else if (permission_flags == (PF_R | PF_W)) { - codeset_segment = &codeset->data; + codeset_segment = &codeset->DataSegment(); } else { LOG_ERROR(Loader, "Unexpected ELF PT_LOAD segment id {} with flags {:X}", i, p->p_flags); @@ -390,7 +390,7 @@ ResultStatus AppLoader_ELF::Load(Kernel::SharedPtr<Kernel::Process>& process) { std::vector<u8> buffer = file->ReadAllBytes(); if (buffer.size() != file->GetSize()) - return ResultStatus::Error; + return ResultStatus::ErrorIncorrectELFFileSize; ElfReader elf_reader(&buffer[0]); SharedPtr<CodeSet> codeset = elf_reader.LoadInto(Memory::PROCESS_IMAGE_VADDR); @@ -398,7 +398,6 @@ ResultStatus AppLoader_ELF::Load(Kernel::SharedPtr<Kernel::Process>& process) { process->LoadModule(codeset, codeset->entrypoint); process->svc_access_mask.set(); - process->address_mappings = default_address_mappings; // Attach the default resource limit (APPLICATION) to the process process->resource_limit = |