mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
bogdanm
Date:
Mon Aug 05 14:12:34 2013 +0300
Revision:
13:0645d8841f51
Update mbed sources to revision 64

Who changed what in which revision?

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