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