Merge pull request #92 from gdkchan/nro_refactor

Fix NRO entry point
master
bunnei 2018-01-20 23:10:15 +07:00 committed by GitHub
commit defaaf4519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

@ -107,7 +107,7 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) {
bss_size = PageAlignSize(mod_header.bss_end_offset - mod_header.bss_start_offset); bss_size = PageAlignSize(mod_header.bss_end_offset - mod_header.bss_start_offset);
} }
codeset->data.size += bss_size; codeset->data.size += bss_size;
program_image.resize(PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)); program_image.resize(static_cast<u32>(program_image.size()) + bss_size);
// Load codeset for current process // Load codeset for current process
codeset->name = path; codeset->name = path;
@ -138,7 +138,7 @@ ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
process->address_mappings = default_address_mappings; process->address_mappings = default_address_mappings;
process->resource_limit = process->resource_limit =
Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION);
process->Run(base_addr + sizeof(NroHeader), 48, Kernel::DEFAULT_STACK_SIZE); process->Run(base_addr, 48, Kernel::DEFAULT_STACK_SIZE);
is_loaded = true; is_loaded = true;
return ResultStatus::Success; return ResultStatus::Success;