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.

Compiler: Confused with section .data .ebss

Tool/software: TI C/C++ Compiler

Hi,

From the Wiki of C28x Compiler, the below content can be seen:

But i do not know why x&y are in the .ebss seciton, in my understanding, x&y should be in the .data section because they are initialized global variables.

Thank you in advance.

  • qiu wei said:
    But i do not know why x&y are in the .ebss seciton

    That is not what you expect.  But that is what the compiler does.  The variables x and y are defined in .ebss.  To say 2 and 7 are in .cinit isn't wrong, but it is incomplete.  The section .cinit contains two initialization records that, when processed by the startup code, copy the values 2 and 7 to the variables x and y.

    qiu wei said:
    in my understanding, x&y should be in the .data section because they are initialized global variables.

    That is how it works in every other TI compiler, provided you build for EABI.  EABI stands for Extended Application Binary Interface.  It is a set of conventions which specify (among many other details) the section names used by the compiler.  EABI is the default (or only) ABI in recent versions of all TI compilers except C28x.

    Because it is related ... A future release of the C28x compiler will support EABI.  When you build for EABI, then initialized global variables like x and y are in the .data section.

    Thanks and regards,

    -George

  • Thank you, George.

    And in the current version of C28x compiler, which data will be placed in the .data section?

  • The current compiler does not use the .data section.  Please see the section titled Specifying Where to Allocate Sections in Memory in the C28x compiler manual.

    Thanks and regards,

    -George