This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Relocation Overflow

Hi,

 

I know this is an issue already discussed in some threads, still and due to my lack of experience in this field i am still a little bit lost.

 

Platform: dm6446

First of all, this is the error:

------------------------------------------------------------------

undefined                        first referenced
 symbol                              in file
---------                        ----------------
_Background_Subtraction_Func     /home/computervision/workdir/Current_Project/prog/codec/ccg/background_subtraction/lib/release/background_subtraction.a64P
>>   error: relocation overflow occurred at address 0x0000009c in section
            '.text:algProcess:_BACKGROUND_SUBTRACTION_CCG_process' of input
            file 'background_subtraction.o64P
            (/home/computervision/workdir/Current_Project/prog/codec/ccg/background_subtraction/lib/release/background_subtraction.a64P)'.  The 29-bit PC-relative displacement 471270592 at this location is too large to fit into the 21-bit PC-Relative field; the destination address is too far away from the instruction. 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 21 bits of this symbol. Please see the section on Relocation in the Assembly User's Guide.

------------------------------------------------------------------

I have created a "codec" using the GenCodecPkg Iuniversal type.

After the codec i create de server with the Codec Engine GenServerWizard, with the default values.

Now, when i place the "function code" directly on the process call of the codec everything works great.

When i create a function (in a separate .c) to be called inside the process call, the codec compiles ok, but when compiling the server the above error appears.

 

I have read the relocatiion overflow wiki at:

http://processors.wiki.ti.com/index.php?title=Relocation_Overflow_Error

But still i have some doubts.

First has it refers changing the mode_map to far has a costly performance drawback. Still i got the impression it referred mainly to access data. Isnt the above error related to a code jump? I read somewhere about the linker usage of trampolines, is it set by default? or must i set it?

Second and this is a "noob" question, i dont know where to change it, since i am not working with CCS but with the toolchain in Linux.

Thirdly , is it possible to force the data/code to be in the 32K near address space?

 

Thanks in advance.

 

Best Regards

  • Solution found.

     

    As surprisingly has it can be, the problem was not related to what i thought it was.

    In fact the problem came from the codec compilation time. I though the XDC tool would find out all the dependencies and act accordingly.

    Instead, we must supply them in package.bld at:

    var SRCS = ["background_subtraction",
            "dsp_app"]; -> this is my source file with the function

     

    Since i was getting no errors at this compilation time, i assumed everything was ok and literally compiled.

     

    P.S. I will keep the post, in case others come across this "trap"

     

    Best Regards