SPRU513Z August 2001 – October 2023 SM320F28335-EP
The MEMORY and SECTIONS directives provide flexible ways to build, combine, and allocate sections. However, any memory locations or sections you choose not to specify must still be handled by the linker. The linker uses algorithms to build and allocate sections in coordination with any specifications you do supply.
If you do not use the MEMORY and SECTIONS directives, the linker allocates output sections as though the memory map and section definitions shown in Default Allocation for TMS320C28x Devices were used.
MEMORY
{
PAGE 0: PROG: origin = 0x000040 length = 0x3fffc0
PAGE 1: DATA: origin = 0x000000 length = 0x010000
PAGE 1: DATA1: origin = 0x010000 length = 0x3f0000
}
SECTIONS
{
.text: PAGE = 0
.data: PAGE = 0
.cinit: PAGE = 0 /* Used only for C programs */
.ebss: PAGE = 1
}
See Section 2.5.1 for information about default memory allocation.
All .text input sections are concatenated to form a .text output section in the executable output file, and all .data input sections are combined to form a .data output section.
If you use a SECTIONS directive, the linker performs no part of this default allocation. Instead, allocation is performed according to the rules specified by the SECTIONS directive and the general algorithm described next in Section 8.7.1.