Memory layout
The linker script, as we already know, contains the instructions for the linker on how to assemble the components of an embedded system. More specifically, it describes the sections mapped in memory and how they are deployed into the flash and the RAM of the target, as in the example provided in Chapter 2, Work Environment and Workflow Optimization.
In most embedded devices, and in particular our reference platform, the .text
output section in the linker script, which contains all the executable code, should also include the special input section dedicated to storing the IV at the very beginning of the executable image.
We integrate the linker script by adding the .isr_vector
section at the beginning of the .text
output section before the rest of the code:
.text : { *(.isr_vector) *(.text*) *(.rodata*) } > FLASH
Defining a read-only area in flash, which is dedicated to the vector table, is the only strict requirement...