gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > devkitARM linker broken?

#173073 - Ruben - Fri Mar 19, 2010 2:55 pm

Hi.

I was working on my small just-for-the-fun-of-it game [using my own linkscripts + cart files]... and I came across a strange problem.

At first, it would link fine but... it would place some of my RAM sections in BSS, even though they were initialized and explicitly declared to be in RAM. However, when I placed some more safeguards [like ALIGN(4) on the VMA] in the linkscript, it came up with...
Code:
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld.exe: region `ram' overflowed by -37703456 bytes

I'm not 100% sure but... isn't a negative overflow a problem with the linker, rather than my code?

[it was working a few minutes ago, when the size was around 200KB bigger]

#173074 - wintermute - Fri Mar 19, 2010 4:57 pm

Most likely culprit is your linkscript.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#173075 - Ruben - Fri Mar 19, 2010 4:59 pm

That's odd, as it's 99% based on libnds' linkscript, just without the debug sections. I've already tried adding them, and while it linked fine, my RAM data ended up in BSS. Any ideas?

#173078 - wintermute - Fri Mar 19, 2010 5:35 pm

not a clue, sorry.

your ram data ending up in bss is a pretty big hint that you've got problems with your linkscript.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog