version_2.0

Dependents:   cc3000_ping_demo_try_2

Fork of mbed by mbed official

Committer:
erezi
Date:
Wed Jun 25 06:08:49 2014 +0000
Revision:
86:4f9a848d74c7
Parent:
66:9c8f0e3462fb
version_2.0

Who changed what in which revision?

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