X-Git-Url: https://robinkrens.nl/gitweb/?a=blobdiff_plain;f=link.ld;h=63f173d8bb676df43673ecdba0603f6d147e4fc9;hb=9f7dfa3d2de5600111eb5c09dc1727b58a30be18;hp=1f6b5f663afdb58dc975c8a13913e4bede98cdc3;hpb=41d25ed67df8b6acd6126c41c8b0882586db0b0d;p=cortex-from-scratch diff --git a/link.ld b/link.ld index 1f6b5f6..63f173d 100644 --- a/link.ld +++ b/link.ld @@ -1,4 +1,28 @@ -/* */ +/* (CC-BY-NC-SA) ROBIN KRENS - ROBIN @ ROBINKRENS.NL + * + * $LOG$ + * 2019/7/20 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * Linker file for Cortex-M3 STM32 based boards + * Boards have similar FLASH and SRAM ORIGINs + * LENGTHs differs of course. + * + * _start flag is the first procedure to be + * executed (linked to beginning of FLASH at + * 0x08000000). The procedure should do some + * basic things, such as set up the stack and + * reset and hard fault handler (see start.asm) + * * + * _endofbss flag is used to calculate the end + * of .bss and the start of (a possible) kernel + * heap + * + * */ + +KHEAP_SIZE = 0x100; + MEMORY { FLASH (xr) : ORIGIN = 0x08000000, LENGTH = 512K @@ -14,16 +38,23 @@ SECTIONS { /* (.vector_table */ *(.text) - *(.rodata) + *(.rodata) + data_lma = .; } . = 0x20000000; - .data : + data_vma = .; + .data : AT (data_lma) { *(.data) } + data_end = .; .bss : ALIGN(4) { *(.bss) } _endofbss = .; + _beginofheap = .; + . = . + KHEAP_SIZE; + . = ALIGN(8); + _endofheap = .; }