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:
emilmont
Date:
Fri Jun 14 17:49:17 2013 +0100
Revision:
10:3bc89ef62ce7
Unify mbed library sources

Who changed what in which revision?

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