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 6.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 Created by the Compiler

Name Contents
.binit Boot time copy tables (See the Assembly Language Tools User's Guide for information on BINIT in linker command files.)
.cinit Tables for explicitly initialized global and static variables.
.const Global and static const variables that are explicitly initialized.
.data Global and static non-const variables that are explicitly initialized.
.init_array Table of constructors to be called at startup.
.ovly Copy tables other than boot time (.binit) copy tables. Read-only data.
.text Executable code and constants. Also contains string literals and switch tables. See Section 6.1.1 for exceptions.
.TI.crctab Generated CRC checking tables. Read-only data.

Table 4-2 Uninitialized Sections Created by the Compiler

Name Contents
.bss Uninitialized global and static variables
.cio Buffers for stdio functions from the run-time support library
.stack Stack
.sysmem Memory pool (heap) for dynamic memory allocation (malloc, etc)

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 ARM Assembly Language Tools User's Guide.