SLAU132V October 2004 – February 2020
.global _x
.bss _x,4,4
.sect ".cinit:c"
.align 8
.field (CIR - $) - 8, 32
.field _I+0,32
.field 23,16 ; _I @ 0
.sect ".text"
.global _I
_I: .usect ".bss:c",2,2
.sect ".cinit:c"
.align 4
.field _x,32 ; _p @ 0
.sect ".text"
.global _p
_p: .usect ".bss:c",4,4
.sect ".cinit"
.align 8
.field IR_1,32
.field _a+0,32
.field 1,32 ; _a[0] @ 0
.field 2,32 ; _a[1] @ 32
.field 3,32 ; _a[2] @ 64
.field 4,32 ; _a[3] @ 96
.field 5,32 ; _a[4] @ 128
IR_1: .set 20
.sect ".text"
.global _a
.bss _a,20,4
;**********************************************************************
;* MARK THE END OF THE SCALAR INIT RECORD IN CINIT:C *
;**********************************************************************
CIR: .sect ".cinit:c"
The .cinit section must contain only initialization tables in this format. When interfacing assembly language modules, do not use the .cinit section for any other purpose.
The table in the .pinit section simply consists of a list of addresses of constructors to be called (see Figure 6-7). The constructors appear in the table after the .cinit initialization.
When you use the --rom_model or --ram_model option, the linker combines the .cinit sections from all the C/C++ modules and appends a null word to the end of the composite .cinit section. This terminating record appears as a record with a size field of 0 and marks the end of the initialization tables.
Likewise, the --rom_model or --ram_model link option causes the linker to combine all of the .pinit sections from all C/C++ modules and append a null word to the end of the composite .pinit section. The boot routine knows the end of the global constructor table when it encounters a null constructor address.
The const-qualified variables are initialized differently; see Section 5.8.1.