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