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.

C6678 cmd 问题



SECTIONS
{
.text > L2SRAM
.data > L2SRAM
.bss > L2SRAM
.other >L2SRM
}

关于ti的cmd文件,能不能像linux下的lds链接文件一样,在里面定义一个符号等于当前的定位连接值,然后再c文件里面使用呢?

比如

{
.text > L2SRAM
.data > L2SRAM

__bss_start_ = .
.bss > L2SRAM

__bss_end  = .
.other >L2SRM
}

然后这两个标签可以给c文件使用呢?

  • Hi Jinming,

                    Please check if below info could solve your question:

    (The related information can be found in spru186q section 7.13.2 ,  7.13.4 and 7.13.6)

    A special symbol, denoted by a dot (.), represents the current value of the section program counter (SPC) during allocation.

    An SPC represents the current address within a section of code or data. Initially, the assembler sets each SPC to 0. As the assembler fills a section with code or data, it increments the  appropriate SPC. If you

    resume assembling into a section, the assembler remembers the appropriate SPC's previous value and continues incrementing the SPC from that value. 

    For example, suppose a program needs to know the address of the beginning of the .text section. By using the .global directive, you can create an external undefined variable called Tstart in the program. Also, you can create variable called Tsize to record the section size.

     Following is the one link command example :

      GROUP

      {

        .text:

        {

          Tstart = .;

        }

         .dummy {Tsize = . - Tstart ;} 

      }

      >   GEM0_TEXT_MEM

    The symbols declared in the link CMD files can be accessed in assembly language modules.

  • 在c语言使用这个标号,可是得到的值不正确