mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_DISCO_F100RB/TOOLCHAIN_GCC_ARM/STM32F100.ld@323:9e901b0a5aa1, 2014-09-13 (annotated)
- Committer:
- shaoziyang
- Date:
- Sat Sep 13 14:25:46 2014 +0000
- Revision:
- 323:9e901b0a5aa1
- Parent:
- 126:549ba18ddd81
test with CLOCK_SETUP = 0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 126:549ba18ddd81 | 1 | /* Linker script for STM32F407 */ |
mbed_official | 126:549ba18ddd81 | 2 | |
mbed_official | 126:549ba18ddd81 | 3 | /* Linker script to configure memory regions. */ |
mbed_official | 126:549ba18ddd81 | 4 | MEMORY |
mbed_official | 126:549ba18ddd81 | 5 | { |
mbed_official | 126:549ba18ddd81 | 6 | FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128k |
mbed_official | 126:549ba18ddd81 | 7 | RAM (rwx) : ORIGIN = 0x20000188, LENGTH = 0x2000-0x188 |
mbed_official | 126:549ba18ddd81 | 8 | } |
mbed_official | 126:549ba18ddd81 | 9 | |
mbed_official | 126:549ba18ddd81 | 10 | /* Linker script to place sections and symbol values. Should be used together |
mbed_official | 126:549ba18ddd81 | 11 | * with other linker script that defines memory regions FLASH and RAM. |
mbed_official | 126:549ba18ddd81 | 12 | * It references following symbols, which must be defined in code: |
mbed_official | 126:549ba18ddd81 | 13 | * Reset_Handler : Entry of reset handler |
mbed_official | 126:549ba18ddd81 | 14 | * |
mbed_official | 126:549ba18ddd81 | 15 | * It defines following symbols, which code can use without definition: |
mbed_official | 126:549ba18ddd81 | 16 | * __exidx_start |
mbed_official | 126:549ba18ddd81 | 17 | * __exidx_end |
mbed_official | 126:549ba18ddd81 | 18 | * __etext |
mbed_official | 126:549ba18ddd81 | 19 | * __data_start__ |
mbed_official | 126:549ba18ddd81 | 20 | * __preinit_array_start |
mbed_official | 126:549ba18ddd81 | 21 | * __preinit_array_end |
mbed_official | 126:549ba18ddd81 | 22 | * __init_array_start |
mbed_official | 126:549ba18ddd81 | 23 | * __init_array_end |
mbed_official | 126:549ba18ddd81 | 24 | * __fini_array_start |
mbed_official | 126:549ba18ddd81 | 25 | * __fini_array_end |
mbed_official | 126:549ba18ddd81 | 26 | * __data_end__ |
mbed_official | 126:549ba18ddd81 | 27 | * __bss_start__ |
mbed_official | 126:549ba18ddd81 | 28 | * __bss_end__ |
mbed_official | 126:549ba18ddd81 | 29 | * __end__ |
mbed_official | 126:549ba18ddd81 | 30 | * end |
mbed_official | 126:549ba18ddd81 | 31 | * __HeapLimit |
mbed_official | 126:549ba18ddd81 | 32 | * __StackLimit |
mbed_official | 126:549ba18ddd81 | 33 | * __StackTop |
mbed_official | 126:549ba18ddd81 | 34 | * __stack |
mbed_official | 126:549ba18ddd81 | 35 | */ |
mbed_official | 126:549ba18ddd81 | 36 | ENTRY(Reset_Handler) |
mbed_official | 126:549ba18ddd81 | 37 | |
mbed_official | 126:549ba18ddd81 | 38 | SECTIONS |
mbed_official | 126:549ba18ddd81 | 39 | { |
mbed_official | 126:549ba18ddd81 | 40 | .text : |
mbed_official | 126:549ba18ddd81 | 41 | { |
mbed_official | 126:549ba18ddd81 | 42 | KEEP(*(.isr_vector)) |
mbed_official | 126:549ba18ddd81 | 43 | *(.text*) |
mbed_official | 126:549ba18ddd81 | 44 | |
mbed_official | 126:549ba18ddd81 | 45 | KEEP(*(.init)) |
mbed_official | 126:549ba18ddd81 | 46 | KEEP(*(.fini)) |
mbed_official | 126:549ba18ddd81 | 47 | |
mbed_official | 126:549ba18ddd81 | 48 | /* .ctors */ |
mbed_official | 126:549ba18ddd81 | 49 | *crtbegin.o(.ctors) |
mbed_official | 126:549ba18ddd81 | 50 | *crtbegin?.o(.ctors) |
mbed_official | 126:549ba18ddd81 | 51 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
mbed_official | 126:549ba18ddd81 | 52 | *(SORT(.ctors.*)) |
mbed_official | 126:549ba18ddd81 | 53 | *(.ctors) |
mbed_official | 126:549ba18ddd81 | 54 | |
mbed_official | 126:549ba18ddd81 | 55 | /* .dtors */ |
mbed_official | 126:549ba18ddd81 | 56 | *crtbegin.o(.dtors) |
mbed_official | 126:549ba18ddd81 | 57 | *crtbegin?.o(.dtors) |
mbed_official | 126:549ba18ddd81 | 58 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
mbed_official | 126:549ba18ddd81 | 59 | *(SORT(.dtors.*)) |
mbed_official | 126:549ba18ddd81 | 60 | *(.dtors) |
mbed_official | 126:549ba18ddd81 | 61 | |
mbed_official | 126:549ba18ddd81 | 62 | *(.rodata*) |
mbed_official | 126:549ba18ddd81 | 63 | |
mbed_official | 126:549ba18ddd81 | 64 | KEEP(*(.eh_frame*)) |
mbed_official | 126:549ba18ddd81 | 65 | } > FLASH |
mbed_official | 126:549ba18ddd81 | 66 | |
mbed_official | 126:549ba18ddd81 | 67 | .ARM.extab : |
mbed_official | 126:549ba18ddd81 | 68 | { |
mbed_official | 126:549ba18ddd81 | 69 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
mbed_official | 126:549ba18ddd81 | 70 | } > FLASH |
mbed_official | 126:549ba18ddd81 | 71 | |
mbed_official | 126:549ba18ddd81 | 72 | __exidx_start = .; |
mbed_official | 126:549ba18ddd81 | 73 | .ARM.exidx : |
mbed_official | 126:549ba18ddd81 | 74 | { |
mbed_official | 126:549ba18ddd81 | 75 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
mbed_official | 126:549ba18ddd81 | 76 | } > FLASH |
mbed_official | 126:549ba18ddd81 | 77 | __exidx_end = .; |
mbed_official | 126:549ba18ddd81 | 78 | |
mbed_official | 126:549ba18ddd81 | 79 | __etext = .; |
mbed_official | 126:549ba18ddd81 | 80 | _sidata = .; |
mbed_official | 126:549ba18ddd81 | 81 | |
mbed_official | 126:549ba18ddd81 | 82 | .data : AT (__etext) |
mbed_official | 126:549ba18ddd81 | 83 | { |
mbed_official | 126:549ba18ddd81 | 84 | __data_start__ = .; |
mbed_official | 126:549ba18ddd81 | 85 | _sdata = .; |
mbed_official | 126:549ba18ddd81 | 86 | *(vtable) |
mbed_official | 126:549ba18ddd81 | 87 | *(.data*) |
mbed_official | 126:549ba18ddd81 | 88 | |
mbed_official | 126:549ba18ddd81 | 89 | . = ALIGN(4); |
mbed_official | 126:549ba18ddd81 | 90 | /* preinit data */ |
mbed_official | 126:549ba18ddd81 | 91 | PROVIDE_HIDDEN (__preinit_array_start = .); |
mbed_official | 126:549ba18ddd81 | 92 | KEEP(*(.preinit_array)) |
mbed_official | 126:549ba18ddd81 | 93 | PROVIDE_HIDDEN (__preinit_array_end = .); |
mbed_official | 126:549ba18ddd81 | 94 | |
mbed_official | 126:549ba18ddd81 | 95 | . = ALIGN(4); |
mbed_official | 126:549ba18ddd81 | 96 | /* init data */ |
mbed_official | 126:549ba18ddd81 | 97 | PROVIDE_HIDDEN (__init_array_start = .); |
mbed_official | 126:549ba18ddd81 | 98 | KEEP(*(SORT(.init_array.*))) |
mbed_official | 126:549ba18ddd81 | 99 | KEEP(*(.init_array)) |
mbed_official | 126:549ba18ddd81 | 100 | PROVIDE_HIDDEN (__init_array_end = .); |
mbed_official | 126:549ba18ddd81 | 101 | |
mbed_official | 126:549ba18ddd81 | 102 | |
mbed_official | 126:549ba18ddd81 | 103 | . = ALIGN(4); |
mbed_official | 126:549ba18ddd81 | 104 | /* finit data */ |
mbed_official | 126:549ba18ddd81 | 105 | PROVIDE_HIDDEN (__fini_array_start = .); |
mbed_official | 126:549ba18ddd81 | 106 | KEEP(*(SORT(.fini_array.*))) |
mbed_official | 126:549ba18ddd81 | 107 | KEEP(*(.fini_array)) |
mbed_official | 126:549ba18ddd81 | 108 | PROVIDE_HIDDEN (__fini_array_end = .); |
mbed_official | 126:549ba18ddd81 | 109 | |
mbed_official | 126:549ba18ddd81 | 110 | KEEP(*(.jcr*)) |
mbed_official | 126:549ba18ddd81 | 111 | . = ALIGN(4); |
mbed_official | 126:549ba18ddd81 | 112 | /* All data end */ |
mbed_official | 126:549ba18ddd81 | 113 | __data_end__ = .; |
mbed_official | 126:549ba18ddd81 | 114 | _edata = .; |
mbed_official | 126:549ba18ddd81 | 115 | |
mbed_official | 126:549ba18ddd81 | 116 | } > RAM |
mbed_official | 126:549ba18ddd81 | 117 | |
mbed_official | 126:549ba18ddd81 | 118 | .bss : |
mbed_official | 126:549ba18ddd81 | 119 | { |
mbed_official | 126:549ba18ddd81 | 120 | . = ALIGN(4); |
mbed_official | 126:549ba18ddd81 | 121 | __bss_start__ = .; |
mbed_official | 126:549ba18ddd81 | 122 | _sbss = .; |
mbed_official | 126:549ba18ddd81 | 123 | *(.bss*) |
mbed_official | 126:549ba18ddd81 | 124 | *(COMMON) |
mbed_official | 126:549ba18ddd81 | 125 | . = ALIGN(4); |
mbed_official | 126:549ba18ddd81 | 126 | __bss_end__ = .; |
mbed_official | 126:549ba18ddd81 | 127 | _ebss = .; |
mbed_official | 126:549ba18ddd81 | 128 | } > RAM |
mbed_official | 126:549ba18ddd81 | 129 | |
mbed_official | 126:549ba18ddd81 | 130 | .heap (COPY): |
mbed_official | 126:549ba18ddd81 | 131 | { |
mbed_official | 126:549ba18ddd81 | 132 | __end__ = .; |
mbed_official | 126:549ba18ddd81 | 133 | end = __end__; |
mbed_official | 126:549ba18ddd81 | 134 | *(.heap*) |
mbed_official | 126:549ba18ddd81 | 135 | __HeapLimit = .; |
mbed_official | 126:549ba18ddd81 | 136 | } > RAM |
mbed_official | 126:549ba18ddd81 | 137 | |
mbed_official | 126:549ba18ddd81 | 138 | /* .stack_dummy section doesn't contains any symbols. It is only |
mbed_official | 126:549ba18ddd81 | 139 | * used for linker to calculate size of stack sections, and assign |
mbed_official | 126:549ba18ddd81 | 140 | * values to stack symbols later */ |
mbed_official | 126:549ba18ddd81 | 141 | .stack_dummy (COPY): |
mbed_official | 126:549ba18ddd81 | 142 | { |
mbed_official | 126:549ba18ddd81 | 143 | *(.stack*) |
mbed_official | 126:549ba18ddd81 | 144 | } > RAM |
mbed_official | 126:549ba18ddd81 | 145 | |
mbed_official | 126:549ba18ddd81 | 146 | /* Set stack top to end of RAM, and stack limit move down by |
mbed_official | 126:549ba18ddd81 | 147 | * size of stack_dummy section */ |
mbed_official | 126:549ba18ddd81 | 148 | __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
mbed_official | 126:549ba18ddd81 | 149 | _estack = __StackTop; |
mbed_official | 126:549ba18ddd81 | 150 | __StackLimit = __StackTop - SIZEOF(.stack_dummy); |
mbed_official | 126:549ba18ddd81 | 151 | PROVIDE(__stack = __StackTop); |
mbed_official | 126:549ba18ddd81 | 152 | |
mbed_official | 126:549ba18ddd81 | 153 | /* Check if data + heap + stack exceeds RAM limit */ |
mbed_official | 126:549ba18ddd81 | 154 | ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
mbed_official | 126:549ba18ddd81 | 155 | } |
mbed_official | 126:549ba18ddd81 | 156 |