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.

stack_size冲突和重定义问题

Other Parts Discussed in Thread: CCSTUDIO

朋友们,我今天遇见了一个问题,希望大侠们能指点一二

开发环境:CCS3.3.82+xds560plus;芯片使用OMAPL138,目前只使用C6748单核,采用BIOS系统;采用CCS开发,完全不牵涉ARM部分;

BIOS系统版本:bios_5.41.02.14,编译器V6.1.11,build顺利通过,linking过程程序报错如下:

--------------------------------------------------------------------------------------------------------------------------------------------------------------
[Linking...] "C:\Program Files\Texas Instruments\C6000 Code Generation Tools 6.1.11\bin\cl6x" -@"Debug.lkf"
<Linking>
error: symbol "__stack" redefined: first defined in "C:/Program Files/Texas
   Instruments/C6000 Code Generation Tools 6.1.11/lib/rts67plus.lib<boot.obj>";
   redefined in
   "C:/CCStudio_v3.3/bios_5_41_02_14/packages/ti/bios/lib/bios.a674<boot.o674>"
error: symbol "_c_int00" redefined: first defined in "C:/Program Files/Texas
   Instruments/C6000 Code Generation Tools 6.1.11/lib/rts67plus.lib<boot.obj>";
   redefined in
   "C:/CCStudio_v3.3/bios_5_41_02_14/packages/ti/bios/lib/bios.a674<boot.o674>"

 undefined    first referenced                                                                                
  symbol          in file                                                                                     
 ---------    ----------------                                                                                
 __STACK_SIZE C:/Program Files/Texas Instruments/C6000 Code Generation Tools 6.1.11/lib/rts67plus.lib<boot.obj>

error: unresolved symbols remain
error: errors encountered during linking; "./Debug/138_dm9000RJ45.out" not
   built

>> Compilation failure

Build Complete,
  1 Errors, 11 Warnings, 0 Remarks.

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

在dsplinker.cmd文件中的stack定义如下:—stack  0x00000800

在BIOS的TCF文件中对stack size定义 0x0400

以上部分如信息不够,还请指出。折腾了三天木有结果,诚盼指点,谢谢!

  • stack size重复定义了。把在dsplinker.cmd文件中的stack定义删掉,在BIOS的TCF文件中准确配置需要的size,再试试。

  • 你好,我删掉了dsplinker.cmd文件中的stack文件定义,在TCF中配置size为0x0800,编译之后报错依然。

  • 抱歉刚才没看仔细,我看你的出错信息是说rts67plus.lib和bios的重复定义了_c_int00和stack size。我觉得很奇怪因为按我的理解rts的库一般是不会包含c_int00或者stack size的信息的。感觉这个库有问题?你能不能再试试把这个rts的库去掉?

  • 把cmd文件里的定义去掉。

    另外,BIOS的配置为C674x的,为什么RTS库是rts67plus.lib,是不是在什么地方手动添加了rts67plus.lib,对于现在编译器,尤其是用了BIOS的工程,不需要手动添加rts库的,CCS会根据配置自动为工程选择相应的rts库。

  • @Tony Tang,@ Hong Lan 谢谢提醒,

    在dsplinker.cmd文件里有这么一句

    -l rts67plus.lib

    我把这句注释掉了,然后前两个错误就没了,谢谢哦。

    最后一个错误仍然存在,再粘贴如下:

    [Linking...] "C:\Program Files\Texas Instruments\C6000 Code Generation Tools 6.1.11\bin\cl6x" -@"Debug.lkf"

    <Linking>

    undefined    first referenced                                                          

     symbol          in file                                                              

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

    __STACK_SIZE C:/CCStudio_v3.3/bios_5_41_02_14/packages/ti/bios/lib/bios.a674<boot.o674>

    error: unresolved symbols remain

    error: errors encountered during linking; "./Debug/138_dm9000RJ45.out" not

      built

    bios.a674这个文件是不是需要替换?

  • 把cmd文件贴上来看一下。

  • 以下部分是dsplinker.cmd文件,还有个文件是BIOS生成的cmd文件,属于BIOS自动生成,不可更改,就不贴了

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

    /*

    *  Linker command file

    *

    */

    //-l rts67plus.lib

    //-l ..\..\..\bsl\lib\evmomapl138_bsl.lib

    //-stack           0x00000800

    -heap            0x00000800

    //MEMORY

    //{

    //    IRAM:       o = 0x80000000  l = 0x00020000  /* 128 kBytes L3RAM */

    //    DRAM:       o = 0xC2000000  l = 0x02000000  /*  64 MBytes SDRAM */

    //    AEMIF:      o = 0x62000000  l = 0x02000000   /*  32 MBytes CS3 EMIF  */

    //}

    SECTIONS

    {

       .bss        >   L3_CBA_RAM

       .cinit      >   L3_CBA_RAM

       .cio        >   L3_CBA_RAM

       .const      >   L3_CBA_RAM

       .stack      >   L3_CBA_RAM

       .sysmem     >   L3_CBA_RAM

       .text       >   L3_CBA_RAM

       .DRAM       >   L3_CBA_RAM

       .far        >   DDR

       .switch     >   L3_CBA_RAM

    .aemif_mem  >   AEMIF

    .vecs       >   L3_CBA_RAM

    .buffer >  DDR

    }

  • 在用了DSP BIOS的情况下,下面红色字体部分都不需要在自定义的cmd文件里出现。

    -heap            0x00000800

    //MEMORY

    //{

    //    IRAM:       o = 0x80000000  l = 0x00020000  /* 128 kBytes L3RAM */

    //    DRAM:       o = 0xC2000000  l = 0x02000000  /*  64 MBytes SDRAM */

    //    AEMIF:      o = 0x62000000  l = 0x02000000   /*  32 MBytes CS3 EMIF  */

    //}

    SECTIONS

    {

      .bss        >   L3_CBA_RAM

      .cinit      >   L3_CBA_RAM

      .cio        >   L3_CBA_RAM

      .const      >   L3_CBA_RAM

      .stack      >   L3_CBA_RAM

      .sysmem     >   L3_CBA_RAM

      .text       >   L3_CBA_RAM

      .DRAM       >   L3_CBA_RAM

      .far        >   DDR

      .switch     >   L3_CBA_RAM

    .aemif_mem  >   AEMIF

    .vecs       >   L3_CBA_RAM

    .buffer >  DDR}

  • @Tony Tang,谢谢你的提醒,我按照你的提示修改了CMD文件,结果还是出现了错误,错误如下

    <Linking>

    warning: creating output section ".vecs" without a SECTIONS specification

    "D:\\workspace\\MuPro\\tests\\138_dm9000RJ45_main\\src\\omapl138cfg.cmd", line 335: error:

      run placement fails for object ".far", size 0x10370b (page 0).  Available

      ranges:

      IRAM         size: 0x30000      unused: 0x1c593      max hole: 0x1c588  

    error: errors encountered during linking; "./Debug/138_dm9000RJ45.out" not

      built

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

    我取消了对以下两句的注释,问题就解决了

         .far        >   DDR

         .vecs       >   IRAM

    按照提示.far占用空间大,不能放在IRAM里,所以就指定在DDR里。

    给.vecs       分配到IRAM里,警告和错误就没了。

    谢谢各位DX指点,问题搞定,结贴。