I would like to place a new linker section and have it placed as the last section of the flash object (not the last byte of the flash memory). I added the new linker section (named .version) as the last section for FLASH in the linker command file, but the linker actually placed the .cinit section last. How can I force my new section to be the last section of a flash image?
I am using CCS version 5.2.1.00018 and targeting the Stellaris family.
See my failed attempt below…
~~~~~~~~~~~~~~~~~~~~~~~~~~~ command linker file ~~~~~~~~~~~~~~~~~~~~~~~~~~~
SECTIONS
{
.intvecs : > 0x00000000 /* INTERRUPT VECTORS */
.text : > FLASH /* CODE */
.const : > FLASH /* CONSTANT DATA */
.cinit : > FLASH /* INITIALIZATION TABLES */
.pinit : > FLASH /* TEMPLATE INITIALIZATION TABLES */
.version : > FLASH
.vtable : > 0x20000000 /* INTERRUPT VECTORS */
.data : > SRAM
.bss : > SRAM /* GLOBAL & STATIC VARS */
.sysmem : > SRAM /* DYNAMIC MEMORY ALLOCATION AREA */
.stack : > SRAM /* SOFTWARE SYSTEM STACK */
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~ output map file ~~~~~~~~~~~~~~~~~~~~~~~~~~~
SEGMENT ALLOCATION MAP
run origin load origin length init length attrs members
---------- ----------- ---------- ----------- ----- -------
00000000 00000000 0000eb68 0000eb68 r-x
00000000 00000000 0000011c 0000011c r-- .intvecs
0000011c 0000011c 0000e61c 0000e61c r-x .text
0000e738 0000e738 0000033a 0000033a r-- .const
0000ea74 0000ea74 00000010 00000010 r-- .version
0000ea88 0000ea88 000000e0 000000e0 r-- .cinit
20000000 20000000 0000f074 00000000 rw-
20000000 20000000 0000e872 00000000 rw- .bss
2000e874 2000e874 00000800 00000000 rw- .stack
2000f078 2000f078 00000259 00000259 rw-
2000f078 2000f078 00000259 00000259 rw- .data