diff options
Diffstat (limited to 'src/core/loader/nso.cpp')
| -rw-r--r-- | src/core/loader/nso.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index ff96e129b..ef769dd91 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -88,7 +88,7 @@ static constexpr u32 PageAlignSize(u32 size) { | |||
| 88 | return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK; | 88 | return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base, bool relocate) { | 91 | VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base) { |
| 92 | FileUtil::IOFile file(path, "rb"); | 92 | FileUtil::IOFile file(path, "rb"); |
| 93 | if (!file.IsOpen()) { | 93 | if (!file.IsOpen()) { |
| 94 | return {}; | 94 | return {}; |
| @@ -135,12 +135,6 @@ VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base, bool relo | |||
| 135 | const u32 image_size{PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)}; | 135 | const u32 image_size{PageAlignSize(static_cast<u32>(program_image.size()) + bss_size)}; |
| 136 | program_image.resize(image_size); | 136 | program_image.resize(image_size); |
| 137 | 137 | ||
| 138 | // Relocate symbols if there was a proper MOD header - This must happen after the image has been | ||
| 139 | // loaded into memory | ||
| 140 | if (has_mod_header && relocate) { | ||
| 141 | Relocate(program_image, module_offset + mod_header.dynamic_offset, load_base); | ||
| 142 | } | ||
| 143 | |||
| 144 | // Load codeset for current process | 138 | // Load codeset for current process |
| 145 | codeset->name = path; | 139 | codeset->name = path; |
| 146 | codeset->memory = std::make_shared<std::vector<u8>>(std::move(program_image)); | 140 | codeset->memory = std::make_shared<std::vector<u8>>(std::move(program_image)); |
| @@ -181,8 +175,6 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) { | |||
| 181 | Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); | 175 | Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); |
| 182 | process->Run(Memory::PROCESS_IMAGE_VADDR, 48, Kernel::DEFAULT_STACK_SIZE); | 176 | process->Run(Memory::PROCESS_IMAGE_VADDR, 48, Kernel::DEFAULT_STACK_SIZE); |
| 183 | 177 | ||
| 184 | ResolveImports(); | ||
| 185 | |||
| 186 | is_loaded = true; | 178 | is_loaded = true; |
| 187 | return ResultStatus::Success; | 179 | return ResultStatus::Success; |
| 188 | } | 180 | } |