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