summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/loader/nso.cpp20
-rw-r--r--src/core/loader/nso.h3
2 files changed, 6 insertions, 17 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp
index ef769dd91..77b4f93eb 100644
--- a/src/core/loader/nso.cpp
+++ b/src/core/loader/nso.cpp
@@ -88,7 +88,7 @@ static constexpr u32 PageAlignSize(u32 size) {
return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK;
}
-VAddr AppLoader_NSO::LoadNso(const std::string& path, VAddr load_base) {
+VAddr AppLoader_NSO::LoadModule(const std::string& path, VAddr load_base) {
FileUtil::IOFile file(path, "rb");
if (!file.IsOpen()) {
return {};
@@ -153,21 +153,9 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
process = Kernel::Process::Create("main");
- // Load NSO modules
- VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR};
- for (const auto& module :
- {"rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", "subsdk3", "subsdk4"}) {
- const std::string path = filepath.substr(0, filepath.find_last_of("/\\")) + "/" + module;
- const VAddr load_addr = next_load_addr;
- next_load_addr = LoadNso(path, load_addr);
- if (next_load_addr) {
- LOG_DEBUG(Loader, "loaded module %s @ 0x%llx", module, load_addr);
- } else {
- next_load_addr = load_addr;
- }
- }
- // Load "main" module
- LoadNso(filepath, next_load_addr);
+ // Load module
+ LoadModule(filepath, Memory::PROCESS_IMAGE_VADDR);
+ LOG_DEBUG(Loader, "loaded module %s @ 0x%llx", filepath.c_str(), Memory::PROCESS_IMAGE_VADDR);
process->svc_access_mask.set();
process->address_mappings = default_address_mappings;
diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h
index a24bcdc24..44d6dbbd9 100644
--- a/src/core/loader/nso.h
+++ b/src/core/loader/nso.h
@@ -31,10 +31,11 @@ public:
return IdentifyType(file);
}
+ static VAddr LoadModule(const std::string& path, VAddr load_base);
+
ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
private:
- VAddr LoadNso(const std::string& path, VAddr load_base);
std::string filepath;
};