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