
System Initialization
6-35
Run-Time Environment
6.8.5 Initialization of Variables at Load Time
Initialization of variables at load time enhances performance by reducing boot
time and by saving the memory used by the initialization tables. To use this
method, invoke the linker with the
−
cr option.
When you use the
−
cr linker option, the linker sets the STYP_COPY bit in the
.cinit section’s header. This tells the loader not to load the .cinit section into
memory. (The .cinit section occupies no space in the memory map.) The linker
also sets the cinit symbol to
−
1 (normally, cinit points to the beginning of the
initialization tables). This indicates to the boot routine that the initialization
tables are not present in memory; accordingly, no run time initialization is per-
formed at boot time.
A loader (which is not part of the compiler package) must be able to perform
the following tasks to use initialization at load time:
-
Detect the presence of the .cinit section in the object file
-
Determine that STYP_COPY is set in the .cinit section header, so that it
knows not to copy the .cinit section into memory
-
Understand the format of the initialization tables
4 illustrates the initialization of variables at load time.
Figure 6
−
4. Initialization at
Load Time
Object file
Memory
.bss
section
.cinit
section
Loader
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...