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.

TMS320C6678: .cinit Section

Part Number: TMS320C6678

Hi Team,

Need your expertise on our customer's query below. Posting on their behalf:

The doc SPRU187U says that .cinit contains tables for explicitly initialized global and static variables when choose -rom_mode. But my code defines a variable as uninitialized variable, and the .cinit of map have some information about it, may we know the reason behind this?

#include"stdio.h"
int itemp;
void main()
{
itemp = 1;
printf("%d\n",itemp);
}
[07:53] qifeng liu: .cinit 0 0c006ef0 000000a8
0c006ef0 00000072 (.cinit..fardata.load) [load image, compression = rle]
0c006f62 00000002 --HOLE-- [fill = 0]
0c006f64 0000000c (__TI_handler_table)
0c006f70 00000008 (.cinit..bss.load) [load image, compression = zero_init]
0c006f78 00000008 (.cinit..far.load) [load image, compression = zero_init]
0c006f80 00000018 (__TI_cinit_table)

.bss 0 0c006b5c 00000004 UNINITIALIZED
0c006b5c 00000004 main.obj (.bss)


Thanks in advance!


Kind Regards,

Jejomar

  • Hello 

    Sorry for the extreme delay on this. Please feel free to create a new post if needed. 

    Question from our side on this

    Can you please try to explain what is your intended use of the –rom_model setting with the compiler. Do you want to define a uninitialized variable that should only show up in .bss section and not in .cinit?

    Please refer to section 5.3.4 in the Compiler User guide document for handling of global variables when –rom_model or –ram_model is used.

  • The doc SPRU187U says that .cinit contains tables for explicitly initialized global and static variables when choose -rom_mode.

    That applies to the older COFF ABI, and not the newer EABI.  I can tell from those lines in the map file that you use EABI.  These lines ...

    0c006f70 00000008 (.cinit..bss.load) [load image, compression = zero_init]
    0c006f78 00000008 (.cinit..far.load) [load image, compression = zero_init]

    ... correspond to entries in .cinit which cause variables in the sections .bss and .far (such as your variable itemp) to be initialized with 0 by the startup code.

    Thanks and regards,

    -George