Skip to content

Commit

Permalink
Merge pull request #1976 from SBird1337/ld/malloc
Browse files Browse the repository at this point in the history
fix(linking): link gflib/malloc.c at top of EWRAM in ld_script_modern.ld
  • Loading branch information
GriffinRichards authored Jan 28, 2024
2 parents 5e47049 + e2eca97 commit f2276e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ld_script_modern.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f2276e1

Please sign in to comment.