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.

ASM > DevKitAdv compile error

#9769 - Omega81 - Sun Aug 17, 2003 4:05 am

Quote:

[root@localhost root]# gba-gcc -o test.elf test.c
/DevKitAdv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/bin/ld: section .iwram [080003f8 -> 080004bf] overlaps section .init [080003e4 -> 080003ff]
/DevKitAdv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/lib/crt0.o: In function `jump_intr':
/DevKitAdv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/lib/crt0.o(.iwram+0xc4): undefined reference to `IntrTable'
collect2: ld returned 1 exit status
[root@localhost root]#


when I try to compile a simple program I get this error. any Ideas as to why this is happening. The code is give below.

Code:
#include <stdio.h>
#include "GameBoyAdv.h"
#define RGB(r,g,b) (r+(g<<5)+(b<<10))    //Macro to build a color from its parts

int color,i,x,y;
u16* Vram = (u16*)VideoBuffer;
int main()
{
  REG_DISPCNT = (0x0400|0x03); // select mode 3 with bacground 2 bitmap backgoun
d
  x = 10;
  y = 20;
  //for (i=0; i< 2000; i++)
  //{
        Vram[x+y*240] = RGB(31,31,31);
 // }
   return 0;
}


thank in advanced guys/gals[/code][/quote]

#9770 - DekuTree64 - Sun Aug 17, 2003 7:00 am

That means you have the interrupt handler in Crt0.S enabled, and since it uses a table of function pointers, you need to declare that somewhere in your code. It should be an array called IntrTable of 14 function poitners, or 32 bit values if you prefer, either way works. The order of them is the same as the order of the IRQ enabling bits in REG_IE, so you can look that up at http://www.cs.rit.edu/~tjh8300/CowBite/CowBiteSpec.htm if you need to.
Or if you don't need interrupt support at all, you can disable it in Crt0.S, just read through the first part of it and it should have a line to comment or uncomment to disable it.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#9778 - Omega81 - Mon Aug 18, 2003 1:10 am

Quote:
if u don't need interrupt support at all, you can disable it in Crt0.S
just one Question, were is Crt0.S? I have tried search in the devkitadv directory (even on my whole HDD) but nothign comes up.

thank
_________________
Keep it real, keep it Free, Keep it GNU

#9783 - Omega81 - Mon Aug 18, 2003 2:27 am

Just got to Tom Badran site and it appear the is a problem with the current biuld of DevKitAdv so my asm code has to be build manually step by step :), done that and it all works althrough I didn't included the CRT0.s file from http://www.devrs.com/gba/ccode.php#cmisc in my linkage but and my program still works but VisualGameBoy won't exit. so I have to use Xkill all the time. O well thanks for all the help anyway mate. I will be coming back for more.

Omega81 out
_________________
Keep it real, keep it Free, Keep it GNU