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.

INTERNAL ERROR ??? linker problem, lnk6x.exe failed to allocate memory!



Hi, all,  when I complie my project (the code size is very large), I found this problem, is it CCS's problem or my programm?

the version of CCS i used is CCS5.1.0, the device is DM6467. in my project there are many libs, I am sure my project is ok, I can build it successfully,when i remove the libs from project or use  a few libs.  the projec use the DSP/BIOS.   

map file:

MEMORY CONFIGURATION

name                           origin            length         used unused           attr fill
---------------------- -------- --------- -------- -------- ---- ---------- ---------- -------- ------------
ARM_RAM                10010000   00008000    00000000    00008000 RWIX
IRAM                          11818000   00020000     00003404    0001cbfc RWIX
CACHE_L1P            11e00000   00008000     00000000    00008000 RWIX
CACHE_L1D            11f00000    00008000     00000000    00008000 RWIX
DDR2                         80000000  10000000      003ce77e    0fc31882 RWIX

.....

cmd file:

/* MODULE MEM */
-stack 0xffff
MEMORY {
CACHE_L1P : origin = 0x11e00000, len = 0x8000
CACHE_L1D : origin = 0x11f00000, len = 0x8000
DDR2 : origin = 0x80000000, len = 0x10000000
ARM_RAM : origin = 0x10010000, len = 0x8000
IRAM : origin = 0x11818000, len = 0x20000
}

....

=====================================================================================

bellow are the ccs's console ouput:

.......

warning #17009-D: relocation type is static base-relative, but references
symbol
"_npos__Q2_3std78basic_string__tm__58_cQ2_3std20char_traits__tm__2_cQ2_3std1
8allocator__tm__2_c" defined in section ".const"; references to section
".const" are not relative to any static base, so this relocation cannot be
performed (type = 'R_C60BASE' (80), file =
"D:/DUANLIAN/DSPProject20121026(DSP)/DspTest/../C6000Lib/Release/TTDataCore_
r.lib<TTDetectionProfile.obj>", offset = 0x000007c4, section = ".text")
warning #17009-D: relocation type is static base-relative, but references
symbol
"_npos__Q2_3std78basic_string__tm__58_cQ2_3std20char_traits__tm__2_cQ2_3std1
8allocator__tm__2_c" defined in section ".const"; references to section
".const" are not relative to any static base, so this relocation cannot be
performed (type = 'R_C60BASE' (80), file =
"D:/DUANLIAN/DSPProject20121026(DSP)/DspTest/../C6000Lib/Release/TTDataCore_
r.lib<TTDetectionProfile.obj>", offset = 0x00000b44, section = ".text")
warning #17009-D: relocation type is static base-relative, but references
symbol
"_npos__Q2_3std78basic_string__tm__58_cQ2_3std20char_traits__tm__2_cQ2_3std1
8allocator__tm__2_c" defined in section ".const"; references to section
".const" are not relative to any static base, so this relocation cannot be
performed (type = 'R_C60BASE' (80), file =
"D:/DUANLIAN/DSPProject20121026(DSP)/DspTest/../C6000Lib/Release/TTDataCore_
r.lib<TTDetectionProfilesEnable.obj>", offset = 0x0000029c, section =
".text")
warning #17009-D: relocation type is static base-relative, but references
symbol
"_npos__Q2_3std78basic_string__tm__58_cQ2_3std20char_traits__tm__2_cQ2_3std1
8allocator__tm__2_c" defined in section ".const"; references to section
".const" are not relative to any static base, so this relocation cannot be
performed (type = 'R_C60BASE' (80), file =
"D:/DUANLIAN/DSPProject20121026(DSP)/DspTest/../C6000Lib/Release/TTDataCore_
r.lib<TTDetectionProfilesEnable.obj>", offset = 0x00001008, section =
".text")
warning #17009-D: relocation type is static base-relative, but references
symbol "__Raise_handler__3std" defined in section ".far"; references to
section ".far" are not relative to any static base, so this relocation
cannot be performed (type = 'R_C60BASE' (80), file =
"D:/DUANLIAN/DSPProject20121026(DSP)/DspTest/../C6000Lib/Release/TTDataCore_
r.lib<TTDetectionProfilesEnable.obj>", offset = 0x00001028, section =
".text")

INTERNAL ERROR: D:\ti\ccsv5\tools\compiler\c6000\bin\lnk6x.exe failed to allocate memory


This is a serious problem. Please contact Customer
Support with this message and a copy of the input file
and help us to continue to make the tools more robust.

  • Probably both.

    It is always a bug for the compiler tools to emit "INTERNAL ERROR."  In this case, the linker tells us that it "failed to allocate memory", which means the linker itself ran out of memory on the host.  This program might be too big for the linker, running on your machine, to handle.  However, it might be due to a bug where the linker consumes too much memory.  I'd say you should fix the other errors before trying to look at the internal error.

    The warning

    warning #17009-D: relocation type is static base-relative, but references symbol "symbolname" defined in section ".const"; references to section ".const" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "filename", offset = 0x000007c4, section = ".text")

    is quite a mouthful, but it means that some variable (e.g. string::npos, which comes from the RTS library) which lives in .const is being accessed as if it were "near", but it is not, which is an error.

    This is usually due to mixing memory models.  On C6000, mixing memory models is generally OK, but there are some cases that won't work.

    To analyze this further, I need to know what version of the compiler tools you're using.  This is not the same as the CCS version.

  • Thanks, , Thanks for your reply!

    I can't solve this "INTERNAL ERROR".  I am sure my libs or my Project is ok,  it can run well in the PC,  when used VS2008. 

    when I built it under the CCS5.1.0( the compiler tool version was V7.3.1) ,I found the IDE TOOL was very slow, although I have to change the project settings(e.g: --sysdebug:none or others).   I also found the strange thing that  the ccs always got the  bellow message:

    warning #17009-D: relocation type is static base-relative, but references
    symbol "__Raise_handler__3std" defined in section ".far"; references to
    section ".far" are not relative to any static base, so this relocation
    cannot be performed (type = 'R_C60BASE' (80), file =
    "D:/DUANLIAN/DSPProject20121026(DSP)/DspTest/../C6000Lib/Release/TTDataCore_
    r.lib<TTDetectionProfilesEnable.obj>", offset = 0x00001028, section =
    ".text")

    INTERNAL ERROR: D:\ti\ccsv5\tools\compiler\c6000\bin\lnk6x.exe failed to allocate memory


    This is a serious problem. Please contact Customer
    Support with this message and a copy of the input file
    and help us to continue to make the tools more robust.


    ==================================================

    Is there a bug in CCS or Compiler tools,?  my codes(libs) is very large,very large!,even a  single lib is up to 12MBytes(all the functions need to link to the *.out file at last), so far the total size of Libs has reached up to 80MBytes !   what can I do ?  I can't change my code into pieces!  it's beyond my ability now!

    as you mentioned that it may by the host memory problem,but I have built the project on  different PCs(in my notebook and the desktop computer). so what is your suggestion?

  • Here is what I think is causing your relocation errors.

    I believe the object files in library TTDataCore_r.lib were compiled with C6000 compiler version 6.1.0 or earlier. Up to 6.1.0, there was a bug (SDSCM00023045) in the RTS library header files such that they defined "string::npos" as a near object, which means it is DP-relative. This bug is fixed in 6.1.1 by making "string::npos" a far object, which would not get this relocation error.

    You are using compiler/linker version 7.3.1; the version 7.3.1 RTS library correctly places "string::pos" in far memory.  TTDataCore_r.lib expects "string::pos" to be near, but it is actually far, resulting in this error.

    To fix this error, you should recompile TTDataCore_r.lib with compiler version 6.1.1 or higher.

  • Archaeologist, no , all libs was been compiled with the version 7.3.1.   so when I need to set all the libs with the same settings: --system:none, the linker works well!

  • I do not understand.  There is no compiler option named --system:none.  Are you saying you have resolved the problem yourself?