mbed library

Dependents:   Printf

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Fri Sep 12 16:41:52 2014 +0100
Revision:
89:552587b429a1
Parent:
TARGET_GHI_MBUINO/TOOLCHAIN_GCC_ARM/LPC11U24.ld@88:9327015d4013
Release 89 of the mbed library

Main changes:

- low power optimizations for Nordic targets
- code structure changes for Freescale K64F targets
- bug fixes in various backends

Who changed what in which revision?

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