Creating a Linker Command File
C2000 Microcontroller Workshop - Programming Development Environment 2 - 13
Following is a list of the sections that are created by the compiler. Along with their description,
we provide the Section Name defined by the compiler. This is a small list of compiler default
section names. The top group is initialized sections, and they are linked to flash. In our previous
code example, we saw .txt was used for code, and .cinit for initialized values. The bottom group
is uninitialized sections, and they are linked to RAM. Once again, in our previous example, we
saw .ebss used for global variables and .stack for local variables.
Compiler Section Names
Name Description Link Location
.text code FLASH
.cinit initialization values for FLASH
global and static variables
.econst constants (e.g. const int k = 3;) FLASH
.switch tables for switch statements FLASH
.pinit tables for global constructors (C++) FLASH
Initialized Sections
Name Description Link Location
.ebss global and static variables RAM
.stack stack space low 64Kw RAM
.esysmem memory for far malloc functions RAM
Uninitialized Sections
Note: During development initialized sections could be linked to RAM since
the emulator can be used to load the RAM
Sections of a C program must be located in different memories in your target system. This is the
big advantage of creating the separate sections for code, constants, and variables. In this way,
they can all be linked (located) into their proper memory locations in your target embedded
system. Generally, they’re located as follows:
Program Code (.text)
Program code consists of the sequence of instructions used to manipulate data, initialize system
settings, etc. Program code must be defined upon system reset (power turn-on). Due to this basic
system constraint it is usually necessary to place program code into non-volatile memory, such as
FLASH or EPROM.
Constants (.cinit – initialized data)
Initialized data are those data memory locations defined at reset.It contains constants or initial
values for variables. Similar to program code, constant data is expected to be valid upon reset of
the system. It is often found in FLASH or EPROM (non-volatile memory).
Variables (.ebss – uninitialized data)
Uninitialized data memory locations can be changed and manipulated by the program code during
runtime execution. Unlike program code or constants, uninitialized data or variables must reside