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