SPRU514Z July 2001 – October 2023 SM320F28335-EP
The tables in the .cinit section consist of variable-size initialization records. Each variable that must be autoinitialized has a record in the .cinit section. Figure 7-2 shows the format of the .cinit section and the initialization records.
The fields of an initialization record contain the following information:
Each variable that must be autoinitialized has an initialization record in the .cinit section.
The following example shows initialized global variables defined in C.
int i= 23;
int j[2] = { 1,2};
The corresponding initialization table is as follows:
.global _i
.ebss _i,1,1,0
.global _j
_j: .usect .ebss,2,1,0
.sect ".cinit"
.align 1
.field 1,16
.field _i+0,16
.field 23,16 ; _i @ 0
.sect ".cinit"
.align 1
.field -IR_1,16
.field _j+0,32
.field 1,16 ; _j[0] @ 0
.field 2,16 ; _j[1] @ 16
IR_1: .set2