mbed library sources
Fork of mbed-src by
targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/TOOLCHAIN_GCC_CW_EWL/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 | /* |
mbed_official | 82:0b31dbcd4769 | 2 | ***************************************************************************** |
mbed_official | 82:0b31dbcd4769 | 3 | ** |
mbed_official | 82:0b31dbcd4769 | 4 | ** File : KL25Z128M4_flash.ld |
mbed_official | 82:0b31dbcd4769 | 5 | ** |
mbed_official | 82:0b31dbcd4769 | 6 | ** Default linker command file for Flash targets |
mbed_official | 82:0b31dbcd4769 | 7 | ** |
mbed_official | 82:0b31dbcd4769 | 8 | ***************************************************************************** |
mbed_official | 82:0b31dbcd4769 | 9 | */ |
mbed_official | 82:0b31dbcd4769 | 10 | /* Entry Point */ |
mbed_official | 82:0b31dbcd4769 | 11 | ENTRY(__thumb_startup) |
mbed_official | 82:0b31dbcd4769 | 12 | |
mbed_official | 82:0b31dbcd4769 | 13 | /* Highest address of the user mode stack */ |
mbed_official | 82:0b31dbcd4769 | 14 | _estack = 0x20003000; /* end of SRAM */ |
mbed_official | 82:0b31dbcd4769 | 15 | __SP_INIT = _estack; |
mbed_official | 82:0b31dbcd4769 | 16 | |
mbed_official | 82:0b31dbcd4769 | 17 | /* Generate a link error if heap and stack don't fit into RAM */ |
mbed_official | 82:0b31dbcd4769 | 18 | __heap_size = 0x400; /* required amount of heap */ |
mbed_official | 82:0b31dbcd4769 | 19 | __stack_size = 0x400; /* required amount of stack */ |
mbed_official | 82:0b31dbcd4769 | 20 | |
mbed_official | 82:0b31dbcd4769 | 21 | /* Specify the memory areas */ |
mbed_official | 82:0b31dbcd4769 | 22 | MEMORY |
mbed_official | 82:0b31dbcd4769 | 23 | { |
mbed_official | 82:0b31dbcd4769 | 24 | m_interrupts (rx) : ORIGIN = 0x00000000, LENGTH = 0xC0 |
mbed_official | 82:0b31dbcd4769 | 25 | m_cfmprotrom (rx) : ORIGIN = 0x00000400, LENGTH = 0x10 |
mbed_official | 82:0b31dbcd4769 | 26 | m_text (rx) : ORIGIN = 0x00000800, LENGTH = 128K - 0x800 |
mbed_official | 82:0b31dbcd4769 | 27 | m_data (rwx) : ORIGIN = 0x1FFFF000, LENGTH = 16K /* SRAM */ |
mbed_official | 82:0b31dbcd4769 | 28 | } |
mbed_official | 82:0b31dbcd4769 | 29 | |
mbed_official | 82:0b31dbcd4769 | 30 | |
mbed_official | 82:0b31dbcd4769 | 31 | /* Define output sections */ |
mbed_official | 82:0b31dbcd4769 | 32 | SECTIONS |
mbed_official | 82:0b31dbcd4769 | 33 | { |
mbed_official | 82:0b31dbcd4769 | 34 | /* The startup code goes first into Flash */ |
mbed_official | 82:0b31dbcd4769 | 35 | .interrupts : |
mbed_official | 82:0b31dbcd4769 | 36 | { |
mbed_official | 82:0b31dbcd4769 | 37 | __vector_table = .; |
mbed_official | 82:0b31dbcd4769 | 38 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 39 | KEEP(*(.vectortable)) /* Startup code */ |
mbed_official | 82:0b31dbcd4769 | 40 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 41 | } > m_interrupts |
mbed_official | 82:0b31dbcd4769 | 42 | |
mbed_official | 82:0b31dbcd4769 | 43 | .cfmprotect : |
mbed_official | 82:0b31dbcd4769 | 44 | { |
mbed_official | 82:0b31dbcd4769 | 45 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 46 | KEEP(*(.cfmconfig)) /* Flash Configuration Field (FCF) */ |
mbed_official | 82:0b31dbcd4769 | 47 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 48 | } > m_cfmprotrom |
mbed_official | 82:0b31dbcd4769 | 49 | |
mbed_official | 82:0b31dbcd4769 | 50 | /* The program code and other data goes into Flash */ |
mbed_official | 82:0b31dbcd4769 | 51 | .text : |
mbed_official | 82:0b31dbcd4769 | 52 | { |
mbed_official | 82:0b31dbcd4769 | 53 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 54 | *(.text) /* .text sections (code) */ |
mbed_official | 82:0b31dbcd4769 | 55 | *(.text*) /* .text* sections (code) */ |
mbed_official | 82:0b31dbcd4769 | 56 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ |
mbed_official | 82:0b31dbcd4769 | 57 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ |
mbed_official | 82:0b31dbcd4769 | 58 | *(.glue_7) /* glue arm to thumb code */ |
mbed_official | 82:0b31dbcd4769 | 59 | *(.glue_7t) /* glue thumb to arm code */ |
mbed_official | 82:0b31dbcd4769 | 60 | *(.eh_frame) |
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 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 66 | _etext = .; /* define a global symbols at end of code */ |
mbed_official | 82:0b31dbcd4769 | 67 | } > m_text |
mbed_official | 82:0b31dbcd4769 | 68 | |
mbed_official | 82:0b31dbcd4769 | 69 | .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } > m_text |
mbed_official | 82:0b31dbcd4769 | 70 | .ARM : { |
mbed_official | 82:0b31dbcd4769 | 71 | __exidx_start = .; |
mbed_official | 82:0b31dbcd4769 | 72 | *(.ARM.exidx*) |
mbed_official | 82:0b31dbcd4769 | 73 | __exidx_end = .; |
mbed_official | 82:0b31dbcd4769 | 74 | } > m_text |
mbed_official | 82:0b31dbcd4769 | 75 | |
mbed_official | 82:0b31dbcd4769 | 76 | .ctors : |
mbed_official | 82:0b31dbcd4769 | 77 | { |
mbed_official | 82:0b31dbcd4769 | 78 | __CTOR_LIST__ = .; |
mbed_official | 82:0b31dbcd4769 | 79 | /* gcc uses crtbegin.o to find the start of |
mbed_official | 82:0b31dbcd4769 | 80 | the constructors, so we make sure it is |
mbed_official | 82:0b31dbcd4769 | 81 | first. Because this is a wildcard, it |
mbed_official | 82:0b31dbcd4769 | 82 | doesn't matter if the user does not |
mbed_official | 82:0b31dbcd4769 | 83 | actually link against crtbegin.o; the |
mbed_official | 82:0b31dbcd4769 | 84 | linker won't look for a file to match a |
mbed_official | 82:0b31dbcd4769 | 85 | wildcard. The wildcard also means that it |
mbed_official | 82:0b31dbcd4769 | 86 | doesn't matter which directory crtbegin.o |
mbed_official | 82:0b31dbcd4769 | 87 | is in. */ |
mbed_official | 82:0b31dbcd4769 | 88 | KEEP (*crtbegin.o(.ctors)) |
mbed_official | 82:0b31dbcd4769 | 89 | /* We don't want to include the .ctor section from |
mbed_official | 82:0b31dbcd4769 | 90 | from the crtend.o file until after the sorted ctors. |
mbed_official | 82:0b31dbcd4769 | 91 | The .ctor section from the crtend file contains the |
mbed_official | 82:0b31dbcd4769 | 92 | end of ctors marker and it must be last */ |
mbed_official | 82:0b31dbcd4769 | 93 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) |
mbed_official | 82:0b31dbcd4769 | 94 | KEEP (*(SORT(.ctors.*))) |
mbed_official | 82:0b31dbcd4769 | 95 | KEEP (*(.ctors)) |
mbed_official | 82:0b31dbcd4769 | 96 | __CTOR_END__ = .; |
mbed_official | 82:0b31dbcd4769 | 97 | } > m_text |
mbed_official | 82:0b31dbcd4769 | 98 | .dtors : |
mbed_official | 82:0b31dbcd4769 | 99 | { |
mbed_official | 82:0b31dbcd4769 | 100 | __DTOR_LIST__ = .; |
mbed_official | 82:0b31dbcd4769 | 101 | KEEP (*crtbegin.o(.dtors)) |
mbed_official | 82:0b31dbcd4769 | 102 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) |
mbed_official | 82:0b31dbcd4769 | 103 | KEEP (*(SORT(.dtors.*))) |
mbed_official | 82:0b31dbcd4769 | 104 | KEEP (*(.dtors)) |
mbed_official | 82:0b31dbcd4769 | 105 | __DTOR_END__ = .; |
mbed_official | 82:0b31dbcd4769 | 106 | } > m_text |
mbed_official | 82:0b31dbcd4769 | 107 | |
mbed_official | 82:0b31dbcd4769 | 108 | .preinit_array : |
mbed_official | 82:0b31dbcd4769 | 109 | { |
mbed_official | 82:0b31dbcd4769 | 110 | PROVIDE_HIDDEN (__preinit_array_start = .); |
mbed_official | 82:0b31dbcd4769 | 111 | KEEP (*(.preinit_array*)) |
mbed_official | 82:0b31dbcd4769 | 112 | PROVIDE_HIDDEN (__preinit_array_end = .); |
mbed_official | 82:0b31dbcd4769 | 113 | } > m_text |
mbed_official | 82:0b31dbcd4769 | 114 | .init_array : |
mbed_official | 82:0b31dbcd4769 | 115 | { |
mbed_official | 82:0b31dbcd4769 | 116 | PROVIDE_HIDDEN (__init_array_start = .); |
mbed_official | 82:0b31dbcd4769 | 117 | KEEP (*(SORT(.init_array.*))) |
mbed_official | 82:0b31dbcd4769 | 118 | KEEP (*(.init_array*)) |
mbed_official | 82:0b31dbcd4769 | 119 | PROVIDE_HIDDEN (__init_array_end = .); |
mbed_official | 82:0b31dbcd4769 | 120 | } > m_text |
mbed_official | 82:0b31dbcd4769 | 121 | .fini_array : |
mbed_official | 82:0b31dbcd4769 | 122 | { |
mbed_official | 82:0b31dbcd4769 | 123 | PROVIDE_HIDDEN (__fini_array_start = .); |
mbed_official | 82:0b31dbcd4769 | 124 | KEEP (*(SORT(.fini_array.*))) |
mbed_official | 82:0b31dbcd4769 | 125 | KEEP (*(.fini_array*)) |
mbed_official | 82:0b31dbcd4769 | 126 | PROVIDE_HIDDEN (__fini_array_end = .); |
mbed_official | 82:0b31dbcd4769 | 127 | |
mbed_official | 82:0b31dbcd4769 | 128 | ___ROM_AT = .; |
mbed_official | 82:0b31dbcd4769 | 129 | } > m_text |
mbed_official | 82:0b31dbcd4769 | 130 | |
mbed_official | 82:0b31dbcd4769 | 131 | /* reserve MTB memory at the beginning of m_data */ |
mbed_official | 82:0b31dbcd4769 | 132 | .mtb : /* MTB buffer address as defined by the hardware */ |
mbed_official | 82:0b31dbcd4769 | 133 | { |
mbed_official | 82:0b31dbcd4769 | 134 | . = ALIGN(8); |
mbed_official | 82:0b31dbcd4769 | 135 | _mtb_start = .; |
mbed_official | 82:0b31dbcd4769 | 136 | KEEP(*(.mtb_buf)) /* need to KEEP Micro Trace Buffer as not referenced by application */ |
mbed_official | 82:0b31dbcd4769 | 137 | . = ALIGN(8); |
mbed_official | 82:0b31dbcd4769 | 138 | _mtb_end = .; |
mbed_official | 82:0b31dbcd4769 | 139 | } > m_data |
mbed_official | 82:0b31dbcd4769 | 140 | |
mbed_official | 82:0b31dbcd4769 | 141 | /* Initialized data sections goes into RAM, load LMA copy after code */ |
mbed_official | 82:0b31dbcd4769 | 142 | .data : AT(___ROM_AT) |
mbed_official | 82:0b31dbcd4769 | 143 | { |
mbed_official | 82:0b31dbcd4769 | 144 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 145 | __sinit__ = .; |
mbed_official | 82:0b31dbcd4769 | 146 | _sdata = .; /* create a global symbol at data start */ |
mbed_official | 82:0b31dbcd4769 | 147 | *(.data) /* .data sections */ |
mbed_official | 82:0b31dbcd4769 | 148 | *(.data*) /* .data* sections */ |
mbed_official | 82:0b31dbcd4769 | 149 | |
mbed_official | 82:0b31dbcd4769 | 150 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 151 | _edata = .; /* define a global symbol at data end */ |
mbed_official | 82:0b31dbcd4769 | 152 | } > m_data |
mbed_official | 82:0b31dbcd4769 | 153 | |
mbed_official | 82:0b31dbcd4769 | 154 | ___data_size = _edata - _sdata; |
mbed_official | 82:0b31dbcd4769 | 155 | |
mbed_official | 82:0b31dbcd4769 | 156 | /* Uninitialized data section */ |
mbed_official | 82:0b31dbcd4769 | 157 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 158 | .bss : |
mbed_official | 82:0b31dbcd4769 | 159 | { |
mbed_official | 82:0b31dbcd4769 | 160 | /* This is used by the startup in order to initialize the .bss section */ |
mbed_official | 82:0b31dbcd4769 | 161 | __START_BSS = .; |
mbed_official | 82:0b31dbcd4769 | 162 | PROVIDE ( __bss_start__ = __START_BSS ); |
mbed_official | 82:0b31dbcd4769 | 163 | *(.bss) |
mbed_official | 82:0b31dbcd4769 | 164 | *(.bss*) |
mbed_official | 82:0b31dbcd4769 | 165 | *(COMMON) |
mbed_official | 82:0b31dbcd4769 | 166 | |
mbed_official | 82:0b31dbcd4769 | 167 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 168 | __END_BSS = .; |
mbed_official | 82:0b31dbcd4769 | 169 | PROVIDE ( __bss_end__ = __END_BSS ); |
mbed_official | 82:0b31dbcd4769 | 170 | } > m_data |
mbed_official | 82:0b31dbcd4769 | 171 | |
mbed_official | 82:0b31dbcd4769 | 172 | _romp_at = ___ROM_AT + SIZEOF(.data); |
mbed_official | 82:0b31dbcd4769 | 173 | .romp : AT(_romp_at) |
mbed_official | 82:0b31dbcd4769 | 174 | { |
mbed_official | 82:0b31dbcd4769 | 175 | __S_romp = _romp_at; |
mbed_official | 82:0b31dbcd4769 | 176 | LONG(___ROM_AT); |
mbed_official | 82:0b31dbcd4769 | 177 | LONG(_sdata); |
mbed_official | 82:0b31dbcd4769 | 178 | LONG(___data_size); |
mbed_official | 82:0b31dbcd4769 | 179 | LONG(0); |
mbed_official | 82:0b31dbcd4769 | 180 | LONG(0); |
mbed_official | 82:0b31dbcd4769 | 181 | LONG(0); |
mbed_official | 82:0b31dbcd4769 | 182 | } > m_data |
mbed_official | 82:0b31dbcd4769 | 183 | |
mbed_official | 82:0b31dbcd4769 | 184 | /* User_heap_stack section, used to check that there is enough RAM left */ |
mbed_official | 82:0b31dbcd4769 | 185 | ._user_heap_stack : |
mbed_official | 82:0b31dbcd4769 | 186 | { |
mbed_official | 82:0b31dbcd4769 | 187 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 188 | PROVIDE ( end = . ); |
mbed_official | 82:0b31dbcd4769 | 189 | PROVIDE ( _end = . ); |
mbed_official | 82:0b31dbcd4769 | 190 | __heap_addr = .; |
mbed_official | 82:0b31dbcd4769 | 191 | . = . + __heap_size; |
mbed_official | 82:0b31dbcd4769 | 192 | . = . + __stack_size; |
mbed_official | 82:0b31dbcd4769 | 193 | . = ALIGN(4); |
mbed_official | 82:0b31dbcd4769 | 194 | } > m_data |
mbed_official | 82:0b31dbcd4769 | 195 | |
mbed_official | 82:0b31dbcd4769 | 196 | .ARM.attributes 0 : { *(.ARM.attributes) } |
mbed_official | 82:0b31dbcd4769 | 197 | } |