circuitpython/ports/stm32/boards/common_ifs.ld
Andrew Leech fa57ee971b stm32/boards: Consolidate linker snippets to reduce duplication.
This commit uses the REGION_ALIAS GNU linker command to simplify the linker
snippets and consolidate the duplication.

Signed-off-by: Damien George <damien@micropython.org>
2023-01-13 15:14:26 +11:00

50 lines
1.2 KiB
Plaintext

/* Memory layout for internal flash storage configuration:
FLASH_ISR .isr_vector
FLASH_TEXT .text
FLASH_TEXT .data
RAM .data
RAM .bss
RAM .heap
RAM .stack
*/
ENTRY(Reset_Handler)
REGION_ALIAS("FLASH_COMMON", FLASH_TEXT);
/* define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
/* This first flash block is 16K annd the isr vectors only take up
about 400 bytes. So we pull in a couple of object files to pad it
out. */
. = ALIGN(4);
/* NOTE: If you update the list of files contained in .isr_vector,
then be sure to also update smhal/Makefile where it forcibly
builds each of these files with -Os */
*/ff.o(.text*)
*/vfs_fat_*.o(.text*)
*/py/formatfloat.o(.text*)
*/py/parsenum.o(.text*)
*/py/mpprint.o(.text*)
. = ALIGN(4);
} >FLASH_ISR
INCLUDE common_text.ld
INCLUDE common_extratext_data_in_flash.ld
INCLUDE common_bss_heap_stack.ld
}