Part Number: TM4C1294NCZAD
Our Setup:
Compiler: TI ARM Compiler v20.2.6.LTS.
CCS Version: 11.2
MCU: TM4C1294NCZAD
Board: EK-TM4C129-XL
The linker places sections in memory according to size (largest section first and so on) and not in the order as they are specified in the Linker Command file.
The linker command file looks as Follows:
MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00100000
SRAM (RWX) : origin = 0x20000000, length = 0x00040000
}
--heap_size=0x10000
--stack_size=0x800
/* Section allocation in memory */
SECTIONS
{
.intvecs: > 0x00000000
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM (HIGH)
}
/* define top of Stack will be used by initialization routine */
__STACK_TOP = __stack + __STACK_SIZE;
Output in Map file looks as Follows:
SEGMENT ALLOCATION MAP
run origin load origin length init length attrs members
---------- ----------- ---------- ----------- ----- -------
20000000 20000000 00010678 00000000 rw-
20000000 20000000 0000026c 00000000 rw- .vtable
20000270 20000270 00010000 00000000 rw- .sysmem
20010270 20010270 0000021f 00000000 rw- .data
20010490 20010490 000001e8 00000000 rw- .bss
2003f800 2003f800 00000800 00000000 rw-
2003f800 2003f800 00000800 00000000 rw- .stack
As we see the .sysmem which is the largest section is allocated ahead of .data and .bss sections.
We want sections to be allocated in the same order as defined an Linker Command file.
Regards
Lal