From f6a2143e22f577abafea5190b242471da6e34896 Mon Sep 17 00:00:00 2001 From: Victor Mignot Date: Tue, 22 Jul 2025 15:14:14 +0200 Subject: cortex-m4f: bootstrap code --- link.ld | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 link.ld (limited to 'link.ld') diff --git a/link.ld b/link.ld new file mode 100644 index 0000000..9f2e79d --- /dev/null +++ b/link.ld @@ -0,0 +1,51 @@ +MEMORY { + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000 + RAM (rwx): ORIGIN = 0x20000000, LENGTH = 0x10000 +} + +SECTIONS { + .vector_table ORIGIN(FLASH) : + { + *(.vector_table .vector_table.*); + } > FLASH + + .text : + { + *(.text .text.*); + } > FLASH + + .rodata : + { + *(.rodata .rodata.*); + } > FLASH + + .bss : ALIGN(4) + { + __bss_start = .; + + *(.bss .bss.*); + + . = ALIGN(4); + __bss_end = .; + } > RAM + + .data : ALIGN(4) + { + __data_start = .; + + *(.data .data.*); + + . = ALIGN(4); + __data_end = .; + } > RAM AT > FLASH + + __data_lma = LOADADDR(.data); + + /DISCARD/ : + { + *(.ARM.exidx .ARM.exidx.*); + } + + /* Start the stack from the end of the RAM */ + __stack_top = ORIGIN(RAM) + LENGTH(RAM); +} -- cgit v1.2.3