SPRU514Z July 2001 – October 2023 SM320F28335-EP
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 or .init_array section (depending on the ABI) simply consists of a list of addresses of constructors to be called (see Figure 7-3). 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 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 or .init_array sections from all C/C++ modules and append a null word to the end of the composite .pinit or .init_array 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 6.5.1.