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