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