From 127a7e96007a6fda833604f777ffc99af4c114d3 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 28 Jan 2024 20:43:14 -0300 Subject: [PATCH] Backported gHeap alignment fix from upstream pret --- ld_script_modern.ld | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ld_script_modern.ld b/ld_script_modern.ld index f3bf7b6798..5d9a7daf07 100644 --- a/ld_script_modern.ld +++ b/ld_script_modern.ld @@ -15,6 +15,11 @@ SECTIONS { ewram 0x2000000 (NOLOAD) : ALIGN(4) { + /* + We link malloc.o here to prevent `gHeap` from landing in the middle of EWRAM. + Otherwise this causes corruption issues on some ld versions + */ + gflib/malloc.o(ewram_data); src/*.o(ewram_data); gflib/*.o(ewram_data);