diff options
author | bunnei <bunneidev@gmail.com> | 2018-01-16 23:23:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-16 23:23:33 +0100 |
commit | 52fe15278b812a2518dd874f29c0829b221fd70f (patch) | |
tree | 6bf8782b9338d94938e4060c8a3c88855d68ee75 /src/core/loader/linker.cpp | |
parent | Merge pull request #48 from spycrab/cmake_python (diff) | |
parent | clang-format (diff) | |
download | yuzu-52fe15278b812a2518dd874f29c0829b221fd70f.tar yuzu-52fe15278b812a2518dd874f29c0829b221fd70f.tar.gz yuzu-52fe15278b812a2518dd874f29c0829b221fd70f.tar.bz2 yuzu-52fe15278b812a2518dd874f29c0829b221fd70f.tar.lz yuzu-52fe15278b812a2518dd874f29c0829b221fd70f.tar.xz yuzu-52fe15278b812a2518dd874f29c0829b221fd70f.tar.zst yuzu-52fe15278b812a2518dd874f29c0829b221fd70f.zip |
Diffstat (limited to 'src/core/loader/linker.cpp')
-rw-r--r-- | src/core/loader/linker.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/loader/linker.cpp b/src/core/loader/linker.cpp index f82c6f4b4..87cc65e91 100644 --- a/src/core/loader/linker.cpp +++ b/src/core/loader/linker.cpp @@ -48,9 +48,9 @@ struct Elf64_Sym { }; static_assert(sizeof(Elf64_Sym) == 0x18, "Elf64_Sym has incorrect size."); -void Linker::WriteRelocations(std::vector<u8>& program_image, - const std::vector<Symbol>& symbols, u64 relocation_offset, - u64 size, bool is_jump_relocation, VAddr load_base) { +void Linker::WriteRelocations(std::vector<u8>& program_image, const std::vector<Symbol>& symbols, + u64 relocation_offset, u64 size, bool is_jump_relocation, + VAddr load_base) { for (u64 i = 0; i < size; i += sizeof(Elf64_Rela)) { Elf64_Rela rela; std::memcpy(&rela, &program_image[relocation_offset + i], sizeof(Elf64_Rela)); @@ -90,8 +90,7 @@ void Linker::WriteRelocations(std::vector<u8>& program_image, } } -void Linker::Relocate(std::vector<u8>& program_image, u32 dynamic_section_offset, - VAddr load_base) { +void Linker::Relocate(std::vector<u8>& program_image, u32 dynamic_section_offset, VAddr load_base) { std::map<u64, u64> dynamic; while (dynamic_section_offset < program_image.size()) { Elf64_Dyn dyn; @@ -141,8 +140,7 @@ void Linker::ResolveImports() { const auto& search = exports.find(import.first); if (search != exports.end()) { Memory::Write64(import.second.ea, search->second + import.second.addend); - } - else { + } else { LOG_ERROR(Loader, "Unresolved import: %s", import.first.c_str()); } } |