I am using c55xx platform and TI DSP/BIOS. I created a number of BUFs inside the TCF (located in SARAM and SDRAM) and a part of the code looks like this:
...
bios.BUF.create("BUF_SARAM_00001160");
bios.BUF.instance("BUF_SARAM_00001160").bufCount = 2;
bios.BUF.instance("BUF_SARAM_00001160").size = 1164;
bios.BUF.instance("BUF_SARAM_00001160").bufSeg = prog.get("SARAM");
bios.BUF.create("BUF_SDRAM_00000004");
bios.BUF.instance("BUF_SDRAM_00000004").bufCount = 2000;
bios.BUF.instance("BUF_SDRAM_00000004").size = 8;
bios.BUF.instance("BUF_SDRAM_00000004").bufSeg = prog.get("SDRAM");
...
I created own custom malloc function (link order replace the bios malloc) which accesses those buf by using extern command as follows:
extern BUF_Obj BUF_SARAM_00001160;
extern BUF_Obj BUF_SDRAM_00000004;
For C64xx, I could just declare extern far BUF_Obj. But since I am using C55 which has 64k boundary, there are several "relocation overflow" errors during linking. The number of relocation errors is equal to the number of BUF created in SARAM and SDRAM.
>> error: relocation overflow occurred at address 0x000003a6 in DATA section
'.cinit' of input file
'X:\\ult\code\startup\Omap1710\Conf_Omap1710cfg.obj'. The 22-bit
relocated address 0x392f0c is too large to encode in the 16-bit
signed field. You may need to add a mask to the assembly
instruction or use other target specific assembly features if you
really only need the lowest 16 bits of this symbol. Please see the
section on Relocation in the Assembly User's Guide.
Is there a way to get around this? I read online that it is possible to use macro but does not show example or details.
Your help is greatly appreaciated. Thanks.