Skip to content

Instantly share code, notes, and snippets.

@exelotl
Last active March 8, 2022 22:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exelotl/f98a1f5878203eb673e252a1d385f6c1 to your computer and use it in GitHub Desktop.
Save exelotl/f98a1f5878203eb673e252a1d385f6c1 to your computer and use it in GitHub Desktop.
Analysing the GBA .elf.map
Analysing the GBA .elf.map
--------------------------
The gba linker script can be found under
/opt/devkitPro/devkitARM/arm-none-eabi/lib/gba_cart.ld
This can be used to see which sections in the .elf go into which parts of memory on the GBA
ROM:
.init
.plt
.text
.fini
.rodata
.ctors
.dtors
.eh_frame
.gcc_except_table
IWRAM
.iwram
.bss
.data
.preinit_array
.init_array
.fini_array
.jcr
.iwram[0-9]
EWRAM
.ewram
.sbss
-----------
Open MyProject.elf.map in AMAP (http://www.sikorskiy.net/prj/amap/)
You can see which sections are using up how much memory, and which files and symbols are contributing to that usage.
IWRAM is the main one to watch out for. Lots of stuff can inadvertantly end up there, and it's the most precious resource.
In particular, variables will go into the .data and .bss sections by default... So you should always keep an eye on these to make sure there's nothing hogging them!
Might be worth turning off malloc and stuff?
e.g. see this thread: https://devkitpro.org/viewtopic.php?t=8834
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment