Hi,
I'm trying to call Thumb ROM code from an ARM IWRAM routine.
Unfortunately, I get error messages like this:
Fastcode.text.iwram.o(.iwram+0xbd4): relocation truncated to fit:
R_ARM_PC24 CreateObject
To fix this I believe I need to mark the original declaration of
CreateObject() as being in ROM as follows:
#define CODE_IN_ROM __attribute__ ((section (".text"), long_call))
OBJECT* CreateObject( const STRUCTURE* StructureRef, int x, int y, int
rxy ) CODE_IN_ROM;
However, it won't compile unless I also change the definition of the
original function as follows:
CODE_IN_ROM OBJECT* CreateObject( const STRUCTURE* StructureRef, int x,
int y, int rxy )
{
// code here
}
This compiles and links ok, but the CreateObject() function no longer
works even though there weren't any problems before. Any ideas?
Thanks for your help,
James.
--
/\ apex James Daniels
//\\ designs james.daniels@...
//__\\ http://www.apex-designs.net