mbed library sources modified for open wear
Dependents: openwear-lifelogger-example
Fork of mbed-src by
targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_GCC_ARM/LPC4088.ld@310:6188e0254baa, 2014-09-16 (annotated)
- Committer:
- janekm
- Date:
- Tue Sep 16 22:42:01 2014 +0000
- Revision:
- 310:6188e0254baa
- Parent:
- 71:ca88dd32f209
N/A
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 43:c8a187835cf1 | 1 | /* Linker script for mbed LPC1768 */ |
mbed_official | 43:c8a187835cf1 | 2 | |
mbed_official | 43:c8a187835cf1 | 3 | /* Linker script to configure memory regions. */ |
mbed_official | 43:c8a187835cf1 | 4 | MEMORY |
mbed_official | 43:c8a187835cf1 | 5 | { |
mbed_official | 43:c8a187835cf1 | 6 | FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K |
mbed_official | 71:ca88dd32f209 | 7 | RAM (rwx) : ORIGIN = 0x100000E8, LENGTH = (64K - 0xE8) |
mbed_official | 43:c8a187835cf1 | 8 | |
mbed_official | 43:c8a187835cf1 | 9 | USB_RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 16K |
mbed_official | 43:c8a187835cf1 | 10 | ETH_RAM(rwx) : ORIGIN = 0x20004000, LENGTH = 16K |
mbed_official | 43:c8a187835cf1 | 11 | } |
mbed_official | 43:c8a187835cf1 | 12 | |
mbed_official | 43:c8a187835cf1 | 13 | /* Linker script to place sections and symbol values. Should be used together |
mbed_official | 43:c8a187835cf1 | 14 | * with other linker script that defines memory regions FLASH and RAM. |
mbed_official | 43:c8a187835cf1 | 15 | * It references following symbols, which must be defined in code: |
mbed_official | 43:c8a187835cf1 | 16 | * Reset_Handler : Entry of reset handler |
mbed_official | 43:c8a187835cf1 | 17 | * |
mbed_official | 43:c8a187835cf1 | 18 | * It defines following symbols, which code can use without definition: |
mbed_official | 43:c8a187835cf1 | 19 | * __exidx_start |
mbed_official | 43:c8a187835cf1 | 20 | * __exidx_end |
mbed_official | 43:c8a187835cf1 | 21 | * __etext |
mbed_official | 43:c8a187835cf1 | 22 | * __data_start__ |
mbed_official | 43:c8a187835cf1 | 23 | * __preinit_array_start |
mbed_official | 43:c8a187835cf1 | 24 | * __preinit_array_end |
mbed_official | 43:c8a187835cf1 | 25 | * __init_array_start |
mbed_official | 43:c8a187835cf1 | 26 | * __init_array_end |
mbed_official | 43:c8a187835cf1 | 27 | * __fini_array_start |
mbed_official | 43:c8a187835cf1 | 28 | * __fini_array_end |
mbed_official | 43:c8a187835cf1 | 29 | * __data_end__ |
mbed_official | 43:c8a187835cf1 | 30 | * __bss_start__ |
mbed_official | 43:c8a187835cf1 | 31 | * __bss_end__ |
mbed_official | 43:c8a187835cf1 | 32 | * __end__ |
mbed_official | 43:c8a187835cf1 | 33 | * end |
mbed_official | 43:c8a187835cf1 | 34 | * __HeapLimit |
mbed_official | 43:c8a187835cf1 | 35 | * __StackLimit |
mbed_official | 43:c8a187835cf1 | 36 | * __StackTop |
mbed_official | 43:c8a187835cf1 | 37 | * __stack |
mbed_official | 43:c8a187835cf1 | 38 | */ |
mbed_official | 43:c8a187835cf1 | 39 | ENTRY(Reset_Handler) |
mbed_official | 43:c8a187835cf1 | 40 | |
mbed_official | 43:c8a187835cf1 | 41 | SECTIONS |
mbed_official | 43:c8a187835cf1 | 42 | { |
mbed_official | 43:c8a187835cf1 | 43 | .text : |
mbed_official | 43:c8a187835cf1 | 44 | { |
mbed_official | 43:c8a187835cf1 | 45 | KEEP(*(.isr_vector)) |
mbed_official | 43:c8a187835cf1 | 46 | *(.text*) |
mbed_official | 43:c8a187835cf1 | 47 | |
mbed_official | 43:c8a187835cf1 | 48 | KEEP(*(.init)) |
mbed_official | 43:c8a187835cf1 | 49 | KEEP(*(.fini)) |
mbed_official | 43:c8a187835cf1 | 50 | |
mbed_official | 43:c8a187835cf1 | 51 | /* .ctors */ |
mbed_official | 43:c8a187835cf1 | 52 | *crtbegin.o(.ctors) |
mbed_official | 43:c8a187835cf1 | 53 | *crtbegin?.o(.ctors) |
mbed_official | 43:c8a187835cf1 | 54 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
mbed_official | 43:c8a187835cf1 | 55 | *(SORT(.ctors.*)) |
mbed_official | 43:c8a187835cf1 | 56 | *(.ctors) |
mbed_official | 43:c8a187835cf1 | 57 | |
mbed_official | 43:c8a187835cf1 | 58 | /* .dtors */ |
mbed_official | 43:c8a187835cf1 | 59 | *crtbegin.o(.dtors) |
mbed_official | 43:c8a187835cf1 | 60 | *crtbegin?.o(.dtors) |
mbed_official | 43:c8a187835cf1 | 61 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
mbed_official | 43:c8a187835cf1 | 62 | *(SORT(.dtors.*)) |
mbed_official | 43:c8a187835cf1 | 63 | *(.dtors) |
mbed_official | 43:c8a187835cf1 | 64 | |
mbed_official | 43:c8a187835cf1 | 65 | *(.rodata*) |
mbed_official | 43:c8a187835cf1 | 66 | |
mbed_official | 43:c8a187835cf1 | 67 | KEEP(*(.eh_frame*)) |
mbed_official | 43:c8a187835cf1 | 68 | } > FLASH |
mbed_official | 43:c8a187835cf1 | 69 | |
mbed_official | 43:c8a187835cf1 | 70 | .ARM.extab : |
mbed_official | 43:c8a187835cf1 | 71 | { |
mbed_official | 43:c8a187835cf1 | 72 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
mbed_official | 43:c8a187835cf1 | 73 | } > FLASH |
mbed_official | 43:c8a187835cf1 | 74 | |
mbed_official | 43:c8a187835cf1 | 75 | __exidx_start = .; |
mbed_official | 43:c8a187835cf1 | 76 | .ARM.exidx : |
mbed_official | 43:c8a187835cf1 | 77 | { |
mbed_official | 43:c8a187835cf1 | 78 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
mbed_official | 43:c8a187835cf1 | 79 | } > FLASH |
mbed_official | 43:c8a187835cf1 | 80 | __exidx_end = .; |
mbed_official | 43:c8a187835cf1 | 81 | |
mbed_official | 43:c8a187835cf1 | 82 | __etext = .; |
mbed_official | 43:c8a187835cf1 | 83 | |
mbed_official | 43:c8a187835cf1 | 84 | .data : AT (__etext) |
mbed_official | 43:c8a187835cf1 | 85 | { |
mbed_official | 43:c8a187835cf1 | 86 | __data_start__ = .; |
mbed_official | 43:c8a187835cf1 | 87 | Image$$RW_IRAM1$$Base = .; |
mbed_official | 43:c8a187835cf1 | 88 | *(vtable) |
mbed_official | 43:c8a187835cf1 | 89 | *(.data*) |
mbed_official | 43:c8a187835cf1 | 90 | |
mbed_official | 43:c8a187835cf1 | 91 | . = ALIGN(4); |
mbed_official | 43:c8a187835cf1 | 92 | /* preinit data */ |
mbed_official | 43:c8a187835cf1 | 93 | PROVIDE (__preinit_array_start = .); |
mbed_official | 43:c8a187835cf1 | 94 | KEEP(*(.preinit_array)) |
mbed_official | 43:c8a187835cf1 | 95 | PROVIDE (__preinit_array_end = .); |
mbed_official | 43:c8a187835cf1 | 96 | |
mbed_official | 43:c8a187835cf1 | 97 | . = ALIGN(4); |
mbed_official | 43:c8a187835cf1 | 98 | /* init data */ |
mbed_official | 43:c8a187835cf1 | 99 | PROVIDE (__init_array_start = .); |
mbed_official | 43:c8a187835cf1 | 100 | KEEP(*(SORT(.init_array.*))) |
mbed_official | 43:c8a187835cf1 | 101 | KEEP(*(.init_array)) |
mbed_official | 43:c8a187835cf1 | 102 | PROVIDE (__init_array_end = .); |
mbed_official | 43:c8a187835cf1 | 103 | |
mbed_official | 43:c8a187835cf1 | 104 | |
mbed_official | 43:c8a187835cf1 | 105 | . = ALIGN(4); |
mbed_official | 43:c8a187835cf1 | 106 | /* finit data */ |
mbed_official | 43:c8a187835cf1 | 107 | PROVIDE (__fini_array_start = .); |
mbed_official | 43:c8a187835cf1 | 108 | KEEP(*(SORT(.fini_array.*))) |
mbed_official | 43:c8a187835cf1 | 109 | KEEP(*(.fini_array)) |
mbed_official | 43:c8a187835cf1 | 110 | PROVIDE (__fini_array_end = .); |
mbed_official | 43:c8a187835cf1 | 111 | |
mbed_official | 43:c8a187835cf1 | 112 | . = ALIGN(4); |
mbed_official | 43:c8a187835cf1 | 113 | /* All data end */ |
mbed_official | 43:c8a187835cf1 | 114 | __data_end__ = .; |
mbed_official | 43:c8a187835cf1 | 115 | |
mbed_official | 43:c8a187835cf1 | 116 | } > RAM |
mbed_official | 43:c8a187835cf1 | 117 | |
mbed_official | 43:c8a187835cf1 | 118 | |
mbed_official | 43:c8a187835cf1 | 119 | .bss : |
mbed_official | 43:c8a187835cf1 | 120 | { |
mbed_official | 43:c8a187835cf1 | 121 | __bss_start__ = .; |
mbed_official | 43:c8a187835cf1 | 122 | *(.bss*) |
mbed_official | 43:c8a187835cf1 | 123 | *(COMMON) |
mbed_official | 43:c8a187835cf1 | 124 | __bss_end__ = .; |
mbed_official | 43:c8a187835cf1 | 125 | Image$$RW_IRAM1$$ZI$$Limit = . ; |
mbed_official | 43:c8a187835cf1 | 126 | } > RAM |
mbed_official | 43:c8a187835cf1 | 127 | |
mbed_official | 43:c8a187835cf1 | 128 | |
mbed_official | 43:c8a187835cf1 | 129 | .heap : |
mbed_official | 43:c8a187835cf1 | 130 | { |
mbed_official | 43:c8a187835cf1 | 131 | __end__ = .; |
mbed_official | 43:c8a187835cf1 | 132 | end = __end__; |
mbed_official | 43:c8a187835cf1 | 133 | *(.heap*) |
mbed_official | 43:c8a187835cf1 | 134 | __HeapLimit = .; |
mbed_official | 43:c8a187835cf1 | 135 | } > RAM |
mbed_official | 43:c8a187835cf1 | 136 | |
mbed_official | 43:c8a187835cf1 | 137 | /* .stack_dummy section doesn't contains any symbols. It is only |
mbed_official | 43:c8a187835cf1 | 138 | * used for linker to calculate size of stack sections, and assign |
mbed_official | 43:c8a187835cf1 | 139 | * values to stack symbols later */ |
mbed_official | 43:c8a187835cf1 | 140 | .stack_dummy : |
mbed_official | 43:c8a187835cf1 | 141 | { |
mbed_official | 43:c8a187835cf1 | 142 | *(.stack) |
mbed_official | 43:c8a187835cf1 | 143 | } > RAM |
mbed_official | 43:c8a187835cf1 | 144 | |
mbed_official | 43:c8a187835cf1 | 145 | /* Set stack top to end of RAM, and stack limit move down by |
mbed_official | 43:c8a187835cf1 | 146 | * size of stack_dummy section */ |
mbed_official | 43:c8a187835cf1 | 147 | __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
mbed_official | 43:c8a187835cf1 | 148 | __StackLimit = __StackTop - SIZEOF(.stack_dummy); |
mbed_official | 43:c8a187835cf1 | 149 | PROVIDE(__stack = __StackTop); |
mbed_official | 43:c8a187835cf1 | 150 | |
mbed_official | 43:c8a187835cf1 | 151 | /* Check if data + heap + stack exceeds RAM limit */ |
mbed_official | 43:c8a187835cf1 | 152 | ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
mbed_official | 43:c8a187835cf1 | 153 | |
mbed_official | 43:c8a187835cf1 | 154 | |
mbed_official | 43:c8a187835cf1 | 155 | /* Code can explicitly ask for data to be |
mbed_official | 43:c8a187835cf1 | 156 | placed in these higher RAM banks where |
mbed_official | 43:c8a187835cf1 | 157 | they will be left uninitialized. |
mbed_official | 43:c8a187835cf1 | 158 | */ |
mbed_official | 43:c8a187835cf1 | 159 | .AHBSRAM0 (NOLOAD): |
mbed_official | 43:c8a187835cf1 | 160 | { |
mbed_official | 43:c8a187835cf1 | 161 | Image$$RW_IRAM2$$Base = . ; |
mbed_official | 43:c8a187835cf1 | 162 | *(AHBSRAM0) |
mbed_official | 43:c8a187835cf1 | 163 | Image$$RW_IRAM2$$ZI$$Limit = .; |
mbed_official | 43:c8a187835cf1 | 164 | } > USB_RAM |
mbed_official | 43:c8a187835cf1 | 165 | |
mbed_official | 43:c8a187835cf1 | 166 | .AHBSRAM1 (NOLOAD): |
mbed_official | 43:c8a187835cf1 | 167 | { |
mbed_official | 43:c8a187835cf1 | 168 | Image$$RW_IRAM3$$Base = . ; |
mbed_official | 43:c8a187835cf1 | 169 | *(AHBSRAM1) |
mbed_official | 43:c8a187835cf1 | 170 | Image$$RW_IRAM3$$ZI$$Limit = .; |
mbed_official | 43:c8a187835cf1 | 171 | } > ETH_RAM |
mbed_official | 43:c8a187835cf1 | 172 | } |