From 678bf5914a4dbb013a818e23148abf78719c9122 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 25 Apr 2018 01:50:23 -0600 Subject: [PATCH] Loader: Properly map BSS as rw. --- stratosphere/loader/source/ldr_nso.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stratosphere/loader/source/ldr_nso.cpp b/stratosphere/loader/source/ldr_nso.cpp index 174a3b33b..9011725c7 100644 --- a/stratosphere/loader/source/ldr_nso.cpp +++ b/stratosphere/loader/source/ldr_nso.cpp @@ -268,6 +268,9 @@ Result NsoUtils::LoadNsosIntoProcessMemory(Handle process_h, u64 title_id, NsoLo for (unsigned int seg = 0; seg < 3; seg++) { u64 size = g_nso_headers[i].segments[seg].decomp_size; + if (seg == 2) { + size += g_nso_headers[i].segments[2].align_or_total_size; + } size += 0xFFF; size &= ~0xFFFULL; const static unsigned int segment_perms[3] = {5, 1, 3};