SPRUI03E June 2015 – January 2023
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 TMS320C6000 Devices were used.
MEMORY
{
RAM : origin = 0x00000001, length = 0xFFFFFFFE
}
SECTIONS
{
.text : ALIGN(32) {} > RAM
.const : ALIGN(8) {} > RAM
.data : ALIGN(8) {} > RAM
.bss : ALIGN(8) {} > RAM
.cinit : ALIGN(4) {} > RAM ; cflag option only
.pinit : ALIGN(4) {} > RAM ; cflag option only
.stack : ALIGN(8) {} > RAM ; cflag option only
.far : ALIGN(8) {} > RAM ; cflag option only
.sysmem: ALIGN(8) {} > RAM ; cflag option only
.switch: ALIGN(4) {} > RAM ; cflag option only
.cio : ALIGN(4) {} > RAM ; cflag option only
}
See Section 3.6.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 9.8.1.