Writing the linker script and startup file
Now that we have a good understanding of linker scripts and their essential components, we’re prepared to write our own. However, before diving into writing the script, it’s crucial to revisit the memory map of the microcontroller and gain insight into the positions
load memory for various sections within the object file.
Understanding the load memory of different sections
As discussed earlier in this chapter, the output object file is structured into sections such as .data
, .rodata
, .text
, and .bss
. Together with the sections created by the assembler, we must define our own section to accommodate the vector table for interrupt service routines (ISRs). We will name this section .isr_vector_tbl
.
Each of these sections plays an important role in organizing the memory layout of the microcontroller, contributing to the functionality and efficiency of the final executable.
Figure 4.7 shows a zoomed-in view of the flash...