diff options
Diffstat (limited to 'Project/ld')
-rw-r--r-- | Project/ld/_flash.ld | 33 | ||||
-rw-r--r-- | Project/ld/_sram.ld | 26 | ||||
-rw-r--r-- | Project/ld/stm32f072x8.ld | 4 |
3 files changed, 63 insertions, 0 deletions
diff --git a/Project/ld/_flash.ld b/Project/ld/_flash.ld new file mode 100644 index 0000000..ec94ea7 --- /dev/null +++ b/Project/ld/_flash.ld @@ -0,0 +1,33 @@ +SECTIONS { + . = ORIGIN(FLASH); + .text : { + KEEP(*(.stack)) + KEEP(*(.vectors)) + KEEP(*(.vectors*)) + KEEP(*(.text)) + . = ALIGN(4); + *(.text*) + . = ALIGN(4); + KEEP(*(.rodata)) + *(.rodata*) + . = ALIGN(4); + } >FLASH + + .preinit_array ALIGN(4): { + __preinit_array_start = .; + KEEP(*(.preinit_array)) + __preinit_array_end = .; + } >FLASH + + .init_array ALIGN(4): { + __init_array_start = .; + KEEP(*(.init_array)) + __init_array_end = .; + } >FLASH + + .fini_array ALIGN(4): { + __fini_array_start = .; + KEEP(*(.fini_array)) + __fini_array_end = .; + } >FLASH +} diff --git a/Project/ld/_sram.ld b/Project/ld/_sram.ld new file mode 100644 index 0000000..4993c63 --- /dev/null +++ b/Project/ld/_sram.ld @@ -0,0 +1,26 @@ +SECTIONS { + __stacktop = ORIGIN(SRAM) + LENGTH(SRAM); + __data_load = LOADADDR(.data); + . = ORIGIN(SRAM); + + .data ALIGN(4) : { + __data_start = .; + *(.data) + *(.data*) + . = ALIGN(4); + __data_end = .; + } >SRAM AT >FLASH + + .bss ALIGN(4) (NOLOAD) : { + __bss_start = .; + *(.bss) + *(.bss*) + . = ALIGN(4); + __bss_end = .; + *(.noinit) + *(.noinit*) + } >SRAM + + . = ALIGN(4); + __heap_start = .; +} diff --git a/Project/ld/stm32f072x8.ld b/Project/ld/stm32f072x8.ld new file mode 100644 index 0000000..7600040 --- /dev/null +++ b/Project/ld/stm32f072x8.ld @@ -0,0 +1,4 @@ +MEMORY { + FLASH(rx) : ORIGIN = 0x08000000, LENGTH = 64K + SRAM(rwx) : ORIGIN = 0x20000000, LENGTH = 16K +} |