SPRU514Z July 2001 – October 2023 SM320F28335-EP
This section applies to applications that use the COFF ABI only.
Autoinitializing variables at run time is the default method of autoinitialization. To use this method, invoke the linker with the --rom_model option.
Using this method, the .cinit section is loaded into memory along with all the other initialized sections, and global variables are initialized at run time. The linker defines a special symbol called cinit that points to the beginning of the initialization tables in memory. When the program begins running, the C/C++ boot routine copies data from the tables (pointed to by .cinit) into the specified variables in the .ebss section. This allows initialization data to be stored in ROM and copied to RAM each time the program starts.
Figure 7-4 illustrates autoinitialization at run time. Use this method in any system where your application runs from code burned into ROM.