A vector table section places startup addresses in FLASH: its first entry sets the initial stack pointer to the top of RAM, and its second entry points to the reset handler. KEEP directives preserve the reset vector and exception handlers from linker garbage collection. section 4.1.3
SECTIONS
{
.vector_table :
{
LONG(ORIGIN(RAM) + LENGTH(RAM)); /* Initial stack pointer (
top of RAM) */
KEEP(*(.vector_table.reset_vector)) /* Reset vector (
entry point) */
KEEP(*(.vector_table.exceptions)) /* Other exceptions and
interrupts */
} > FLASH
Linker-script example defining the vector table output section and retaining its entries. section 4.1.3
