System Initialization
6-34
When you use the
−
c or
−
cr linker 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, marking the end of the initialization tables.
The const-qualified variables are initialized differently; see section 5.7.1,
Ini-
tializing Static and Global Variables With the const Type Qualifier
, on page
6.8.4 Autoinitialization of Variables at Run Time
Autoinitializing variables at run time is the default method of autoinitialization.
To use this method, invoke the linker with the
−
c option.
Using this method, the .cinit section is loaded into memory along with all the
other initialized sections. 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 boot routine copies data from the tables (pointed to by
.cinit) into the specified variables in the .bss section. This allows initialization
data to be stored in ROM and copied to RAM each time the program starts.
3 illustrates autoinitialization at run time. Use this method in any sys-
tem where your application runs from code burned into ROM.
Figure 6
−
3. Autoinitialization at Run Time
Boot
routine
Object file
Memory
.bss
section
(RAM)
Initialization
tables
(ROM)
.cinit
section
Loader
cinit
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...