From e2eca97b02c322f16e023e9e0915739640d1a74e Mon Sep 17 00:00:00 2001 From: sbird Date: Sun, 28 Jan 2024 12:36:36 +0100 Subject: [PATCH] fix(linking): link gflib/malloc.c at top of EWRAM in ld_script_modern.ld --- ld_script_modern.ld | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ld_script_modern.ld b/ld_script_modern.ld index 4ccbfbaa0f..4f4bdae492 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); } > EWRAM