You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As also discussed in the discord conversation there seems to be some discrepancy between how objdump writes binary files from an ELF and how mgba interpretes ELF. Specifically the LMA of some section is sometimes not put into the respective ROM section as specied by the ELF.
An example can be found in the pokeemerald-expansion project's test system. Steps to reproduce:
Looking into this, I think this might be an issue with the ELF after all. The resulting ELF has the following two load commands (a subset of the objdump -p output):
These tell the loader to load two different portions of the ELF into overlapping regions of physical memory. In fact, the desired memory is loaded, but then immediately overwritten by this second load command. It's probably a bug with the linker script generating the load commands in the wrong order.
For lack of better words in the tittle :(
As also discussed in the discord conversation there seems to be some discrepancy between how
objdump
writes binary files from an ELF and howmgba
interpretes ELF. Specifically theLMA
of some section is sometimes not put into the respective ROM section as specied by the ELF.An example can be found in the pokeemerald-expansion project's test system. Steps to reproduce:
pokeemerald-expansion
: https://github.com/rh-hideout/pokeemerald-expansion/tree/upcoming/docs/install/linuxupcoming
branch.make -j$(nproc) pokeemerald-test.elf
.The issue occured to me using gcc14, but others reported it with other gcc versions as well. Funkily enough it does not happen for me with gcc10.
The issue also disappears once you build a rom file e.g. with
arm-none-eabi-objcopy -O binary pokeemerald-test.elf pokeemerald-test.gba
The text was updated successfully, but these errors were encountered: