diff options
Diffstat (limited to 'src/core/loader/nso.h')
| -rw-r--r-- | src/core/loader/nso.h | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index 16b41b6dc..431b960b1 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h | |||
| @@ -9,12 +9,13 @@ | |||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/file_util.h" | 10 | #include "common/file_util.h" |
| 11 | #include "core/hle/kernel/kernel.h" | 11 | #include "core/hle/kernel/kernel.h" |
| 12 | #include "core/loader/linker.h" | ||
| 12 | #include "core/loader/loader.h" | 13 | #include "core/loader/loader.h" |
| 13 | 14 | ||
| 14 | namespace Loader { | 15 | namespace Loader { |
| 15 | 16 | ||
| 16 | /// Loads an NSO file | 17 | /// Loads an NSO file |
| 17 | class AppLoader_NSO final : public AppLoader { | 18 | class AppLoader_NSO final : public AppLoader, Linker { |
| 18 | public: | 19 | public: |
| 19 | AppLoader_NSO(FileUtil::IOFile&& file, std::string filename, std::string filepath) | 20 | AppLoader_NSO(FileUtil::IOFile&& file, std::string filename, std::string filepath) |
| 20 | : AppLoader(std::move(file)), filename(std::move(filename)), filepath(std::move(filepath)) { | 21 | : AppLoader(std::move(file)), filename(std::move(filename)), filepath(std::move(filepath)) { |
| @@ -34,25 +35,8 @@ public: | |||
| 34 | ResultStatus Load() override; | 35 | ResultStatus Load() override; |
| 35 | 36 | ||
| 36 | private: | 37 | private: |
| 37 | struct Symbol { | ||
| 38 | Symbol(std::string&& name, u64 value) : name(std::move(name)), value(value) {} | ||
| 39 | std::string name; | ||
| 40 | u64 value; | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct Import { | ||
| 44 | VAddr ea; | ||
| 45 | s64 addend; | ||
| 46 | }; | ||
| 47 | |||
| 48 | void WriteRelocations(const std::vector<Symbol>& symbols, VAddr load_base, | ||
| 49 | u64 relocation_offset, u64 size, bool is_jump_relocation); | ||
| 50 | VAddr GetEntryPoint(VAddr load_base) const; | 38 | VAddr GetEntryPoint(VAddr load_base) const; |
| 51 | bool LoadNso(const std::string& path, VAddr load_base); | 39 | bool LoadNso(const std::string& path, VAddr load_base); |
| 52 | void Relocate(VAddr load_base, VAddr dynamic_section_addr); | ||
| 53 | |||
| 54 | std::map<std::string, Import> imports; | ||
| 55 | std::map<std::string, VAddr> exports; | ||
| 56 | 40 | ||
| 57 | std::string filename; | 41 | std::string filename; |
| 58 | std::string filepath; | 42 | std::string filepath; |