Specifying Where to Allocate Sections in Memory

The compiler produces relocatable blocks of code and data. These blocks, called sections, are allocated in memory in a variety of ways to conform to a variety of system configurations. See Section 7.1.1 for a complete description of how the compiler uses these sections.

The compiler creates two basic kinds of sections: initialized and uninitialized. Table 4-1 summarizes the initialized sections. Table 4-2 summarizes the uninitialized sections.

Table 4-1 Initialized Sections

Name Contents Restrictions
.args Reserved space for copying command line arguments before the main() function is called by the boot routine. See Section 2.6.
.binit Boot time copy tables (See the Assembly Language Tools User's Guide for information on BINIT in linker command files.)
.c28xabi.exidx Index table for exception handling; read-only. (EABI only) Program
.c28xabi.extab Unwinding instructions for exception handling; read-only. (EABI only) Program
.cinit Tables for explicitly initialized global and static variables. (1) Program
.const Global and static const variables that are explicitly initialized and contain string literals. String literals are placed in the .const:.string subsection to enable greater link-time placement control. (EABI only) Data
.data Global and static non-const variables that are explicitly initialized. (1) Data
.econst Global and static const variables that are explicitly initialized and contain string literals. String literals are placed in the .econst:.string subsection to enable greater link-time placement control. (COFF only) Data
.init_array Table of constructors to be called at startup. (EABI only) Program
.ovly Copy tables other than boot time (.binit) copy tables.
.pinit Table of constructors to be called at startup. (COFF only) Program
.ppdata Data tables for compiler-based profiling (see the --gen_profile_info option). Data
.ppinfo Correlation tables for compiler-based profiling ( see the --gen_profile_info option). Data
.switch Jump tables for large switch statements. Program with -mt option
Data without -mt option
.text Executable code and constants. Program
For EABI, the compiler creates initialized .data sections. The linker creates the .cinit section.

Table 4-2 Uninitialized Sections

Name Contents Restrictions
.bss Global and static variables (EABI only) Anywhere in data
.ebss Global and static variables (COFF only) Anywhere in data
.stack Stack Low 64K
.sysmem Memory for malloc functions (heap) (EABI only) Anywhere in data
.esysmem Memory for malloc functions (heap) (COFF only) Anywhere in data

When you link your program, you must specify where to allocate the sections in memory. In general, initialized sections are linked into ROM or RAM; uninitialized sections are linked into RAM.

The linker provides MEMORY and SECTIONS directives for allocating sections. For more information about allocating sections into memory, see the TMS320C28x Assembly Language Tools User's Guide.