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.

Beginners > Weird problem in gba linking

#88583 - Legolas - Tue Jun 20, 2006 1:35 pm

I have updated devkitPro to r19a and some code I have does not link animore. I get a strange error:
Code:

...
linking cartridge
d:\devkitpro\devkitarm\arm-eabi\bin\ld.real.exe: error: no memory region specified for loadable section `.ARM.extab'
collect2: ld returned 1 exit status
make[1]: *** [/d/devkitpro/WinDS_devKit/Examples/GBA/WGL/SwSprites/SwSprites.elf] Error 1
make: *** [build] Error 2

I have rebuilt all libraries, but no way to make the linker working.
Even more strange is that I'm able to link all devkitPro gba examples.
_________________
My homepage!

#88602 - wintermute - Tue Jun 20, 2006 3:52 pm

http://www.devkitpro.org/index.php?action=fullnews&id=112
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#88621 - Legolas - Tue Jun 20, 2006 5:37 pm

Ok, this patch resolves the linking stage. Now the problem is that my generated ROM crashes both on emus and real hardware (black screen). No$gba says that "elf file contains code/data outside of usual ROM area".
_________________
My homepage!

#89256 - Legolas - Fri Jun 23, 2006 8:30 pm

In gba_cart.ld file from arm-elf there is:
Code:
__eheap_end = 0x2040000;

but in arm-eabi one:
Code:
__eheap_end = ORIGIN(ewram) + LENGTH(iwram);

LENGTH(iwram) is 32K=0x8000, so __eheap_end is 0x2008000, instead of 0x2040000, like in arm-elf. Is it a typo or the right value?

Edit: maybe I have found why the rom does not work. Seems that the executable misses .ctors and .dtors sections, even if in my code I use classes. Any help is appreciated ^_^
_________________
My homepage!

#89342 - wintermute - Sat Jun 24, 2006 1:23 pm

That would be a typo, sorry. The correct value should be LENGTH(ewram)

arm-eabi handles constructors/destructors in a different way to arm-elf.

Where did you get the source for winDS?
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#89348 - Legolas - Sat Jun 24, 2006 2:04 pm

wintermute wrote:
That would be a typo, sorry. The correct value should be LENGTH(ewram)

arm-eabi handles constructors/destructors in a different way to arm-elf.

Where did you get the source for winDS?


Ok, so I'll correct it :)

About my problem, VBA logging gives me a lot of errors like:

Code:
Illegal word read: 80058004 at 002b0026
Undefined THUMB instruction e92d at 002b002a


As LiraNuna lost his interest in WinDS, I asked him the sources, in order to go on with the development. I'll put the sources on sourceforge svn ASAP :)

Edit: ok, now the sources are on svn
_________________
My homepage!

#90104 - Legolas - Wed Jun 28, 2006 1:06 pm

A little update: I have been able to make a working demo by using multiboot linkerscript; the same code does not work at all using "cartridge" linking. :/
_________________
My homepage!