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