Sections

The compiler produces relocatable blocks of code and data called sections. The sections are allocated into memory in a variety of ways to conform to a variety of system configurations. For more information about sections and allocating them, see the introductory object file information in the TMS320C28x Assembly Language Tools User's Guide.

There are two basic types of sections:

The assembler creates the default sections .text, .ebss, and .data. You can instruct the compiler to create additional sections by using the CODE_SECTION and DATA_SECTION pragmas (see Section 6.10.5 and Section 6.10.7).

The linker takes the individual sections from different object files and combines sections that have the same name. The resulting output sections and the appropriate placement in memory for each section are listed in Table 7-1. You can place these output sections anywhere in the address space as needed to meet system requirements.

Table 7-1 Summary of Sections and Memory Placement

Section Type of Memory Page Section Type of Memory Page
.cinit ROM or RAM 0 .pinit ROM or RAM 0
.data RAM .stack RAM 1
.ebss RAM .switch ROM or RAM 0, 1
.econst ROM or RAM 1 .text ROM or RAM 0
.esysmem RAM 1

You can use the SECTIONS directive in the linker command file to customize the section-allocation process. For more information about allocating sections into memory, see the linker description chapter in the TMS320C28x Assembly Language Tools User's Guide.