summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-10-30 02:55:06 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-15 18:48:09 +0100
commit0276761a1e8e9f1ac1e2678ac8fed0b6767f6732 (patch)
treeed470e1373abf20f14a69d2562be840aa0f77e9c
parentpl_u: Resize buffers in shared font data getter to what game requests (diff)
downloadyuzu-0276761a1e8e9f1ac1e2678ac8fed0b6767f6732.tar
yuzu-0276761a1e8e9f1ac1e2678ac8fed0b6767f6732.tar.gz
yuzu-0276761a1e8e9f1ac1e2678ac8fed0b6767f6732.tar.bz2
yuzu-0276761a1e8e9f1ac1e2678ac8fed0b6767f6732.tar.lz
yuzu-0276761a1e8e9f1ac1e2678ac8fed0b6767f6732.tar.xz
yuzu-0276761a1e8e9f1ac1e2678ac8fed0b6767f6732.tar.zst
yuzu-0276761a1e8e9f1ac1e2678ac8fed0b6767f6732.zip
-rw-r--r--src/core/hle/kernel/process.h3
-rw-r--r--src/core/loader/nro.cpp7
2 files changed, 7 insertions, 3 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h
index cf48787ce..230e395ff 100644
--- a/src/core/hle/kernel/process.h
+++ b/src/core/hle/kernel/process.h
@@ -259,7 +259,8 @@ public:
ResultVal<VAddr> HeapAllocate(VAddr target, u64 size, VMAPermission perms);
ResultCode HeapFree(VAddr target, u32 size);
- ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size);
+ ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size,
+ MemoryState state = MemoryState::Mapped);
ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size);
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp
index c8e491fec..fbbd6b0de 100644
--- a/src/core/loader/nro.cpp
+++ b/src/core/loader/nro.cpp
@@ -170,17 +170,20 @@ static constexpr u32 PageAlignSize(u32 size) {
arg_data.size());
}
- // Read MOD header
- ModHeader mod_header{};
// Default .bss to NRO header bss size if MOD0 section doesn't exist
u32 bss_size{PageAlignSize(nro_header.bss_size)};
+
+ // Read MOD header
+ ModHeader mod_header{};
std::memcpy(&mod_header, program_image.data() + nro_header.module_header_offset,
sizeof(ModHeader));
+
const bool has_mod_header{mod_header.magic == Common::MakeMagic('M', 'O', 'D', '0')};
if (has_mod_header) {
// Resize program image to include .bss section and page align each section
bss_size = PageAlignSize(mod_header.bss_end_offset - mod_header.bss_start_offset);
}
+
codeset.DataSegment().size += bss_size;
program_image.resize(static_cast<u32>(program_image.size()) + bss_size);