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

Fork of mbed by mbed official

Committer:
emilmont
Date:
Tue Nov 29 14:59:27 2011 +0000
Revision:
27:7110ebee3484
New Libraries 11.11

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 27:7110ebee3484 1 /* Linker script for mbed LPC1768
emilmont 27:7110ebee3484 2 *
emilmont 27:7110ebee3484 3 * Version:CodeSourcery Sourcery G++ Lite 2007q3-53
emilmont 27:7110ebee3484 4 * BugURL:https://support.codesourcery.com/GNUToolchain/
emilmont 27:7110ebee3484 5 *
emilmont 27:7110ebee3484 6 * Copyright 2007 CodeSourcery.
emilmont 27:7110ebee3484 7 *
emilmont 27:7110ebee3484 8 * The authors hereby grant permission to use, copy, modify, distribute,
emilmont 27:7110ebee3484 9 * and license this software and its documentation for any purpose, provided
emilmont 27:7110ebee3484 10 * that existing copyright notices are retained in all copies and that this
emilmont 27:7110ebee3484 11 * notice is included verbatim in any distributions. No written agreement,
emilmont 27:7110ebee3484 12 * license, or royalty fee is required for any of the authorized uses.
emilmont 27:7110ebee3484 13 * Modifications to this software may be copyrighted by their authors
emilmont 27:7110ebee3484 14 * and need not follow the licensing terms described here, provided that
emilmont 27:7110ebee3484 15 * the new terms are clearly indicated on the first page of each file where
emilmont 27:7110ebee3484 16 * they apply. */
emilmont 27:7110ebee3484 17 OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
emilmont 27:7110ebee3484 18 ENTRY(__cs3_reset_cortex_m)
emilmont 27:7110ebee3484 19 SEARCH_DIR(.)
emilmont 27:7110ebee3484 20
emilmont 27:7110ebee3484 21 /*
emilmont 27:7110ebee3484 22 ram ORIGIN: 8_byte_aligned(49 vect * 4 bytes) = 8_byte_aligned(0xC4) = 0xC8
emilmont 27:7110ebee3484 23 ram LENGTH: 32KB - 0xC8 = 0x7F38
emilmont 27:7110ebee3484 24 */
emilmont 27:7110ebee3484 25 MEMORY
emilmont 27:7110ebee3484 26 {
emilmont 27:7110ebee3484 27 rom (rx) : ORIGIN = 0x00000000, LENGTH = 512K
emilmont 27:7110ebee3484 28
emilmont 27:7110ebee3484 29 ram (rwx) : ORIGIN = 0x100000C8, LENGTH = 0x7F38
emilmont 27:7110ebee3484 30
emilmont 27:7110ebee3484 31 ram1(rwx) : ORIGIN = 0x2007C000, LENGTH = 16K
emilmont 27:7110ebee3484 32 ram2(rwx) : ORIGIN = 0x20080000, LENGTH = 16K
emilmont 27:7110ebee3484 33 }
emilmont 27:7110ebee3484 34
emilmont 27:7110ebee3484 35 /* These force the linker to search for particular symbols from
emilmont 27:7110ebee3484 36 * the start of the link process and thus ensure the user's
emilmont 27:7110ebee3484 37 * overrides are picked up
emilmont 27:7110ebee3484 38 */
emilmont 27:7110ebee3484 39 EXTERN(__cs3_reset_cortex_m)
emilmont 27:7110ebee3484 40 EXTERN(__cs3_interrupt_vector_cortex_m)
emilmont 27:7110ebee3484 41 EXTERN(__cs3_start_c main __cs3_stack __cs3_stack_size __cs3_heap_end)
emilmont 27:7110ebee3484 42
emilmont 27:7110ebee3484 43 PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
emilmont 27:7110ebee3484 44 PROVIDE(__cs3_stack_size = __cs3_region_start_ram + __cs3_region_size_ram - _end);
emilmont 27:7110ebee3484 45 PROVIDE(__cs3_heap_start = _end);
emilmont 27:7110ebee3484 46 PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
emilmont 27:7110ebee3484 47
emilmont 27:7110ebee3484 48 SECTIONS
emilmont 27:7110ebee3484 49 {
emilmont 27:7110ebee3484 50 .text :
emilmont 27:7110ebee3484 51 {
emilmont 27:7110ebee3484 52 CREATE_OBJECT_SYMBOLS
emilmont 27:7110ebee3484 53 __cs3_region_start_rom = .;
emilmont 27:7110ebee3484 54 *(.cs3.region-head.rom)
emilmont 27:7110ebee3484 55 __cs3_interrupt_vector = __cs3_interrupt_vector_cortex_m;
emilmont 27:7110ebee3484 56 *(.cs3.interrupt_vector)
emilmont 27:7110ebee3484 57 /* Make sure we pulled in an interrupt vector. */
emilmont 27:7110ebee3484 58 ASSERT (. != __cs3_interrupt_vector_cortex_m, "No interrupt vector");
emilmont 27:7110ebee3484 59 *(.rom)
emilmont 27:7110ebee3484 60 *(.rom.b)
emilmont 27:7110ebee3484 61
emilmont 27:7110ebee3484 62 __cs3_reset = __cs3_reset_cortex_m;
emilmont 27:7110ebee3484 63 *(.cs3.reset)
emilmont 27:7110ebee3484 64 /* Make sure we pulled in some reset code. */
emilmont 27:7110ebee3484 65 ASSERT (. != __cs3_reset, "No reset code");
emilmont 27:7110ebee3484 66
emilmont 27:7110ebee3484 67 *(.text .text.* .gnu.linkonce.t.*)
emilmont 27:7110ebee3484 68 *(.plt)
emilmont 27:7110ebee3484 69 *(.gnu.warning)
emilmont 27:7110ebee3484 70 *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
emilmont 27:7110ebee3484 71
emilmont 27:7110ebee3484 72 *(.rodata .rodata.* .gnu.linkonce.r.*)
emilmont 27:7110ebee3484 73
emilmont 27:7110ebee3484 74 *(.ARM.extab* .gnu.linkonce.armextab.*)
emilmont 27:7110ebee3484 75 *(.gcc_except_table)
emilmont 27:7110ebee3484 76 *(.eh_frame_hdr)
emilmont 27:7110ebee3484 77 *(.eh_frame)
emilmont 27:7110ebee3484 78
emilmont 27:7110ebee3484 79 . = ALIGN(4);
emilmont 27:7110ebee3484 80 KEEP(*(.init))
emilmont 27:7110ebee3484 81
emilmont 27:7110ebee3484 82 . = ALIGN(4);
emilmont 27:7110ebee3484 83 __preinit_array_start = .;
emilmont 27:7110ebee3484 84 KEEP (*(.preinit_array))
emilmont 27:7110ebee3484 85 __preinit_array_end = .;
emilmont 27:7110ebee3484 86
emilmont 27:7110ebee3484 87 . = ALIGN(4);
emilmont 27:7110ebee3484 88 __init_array_start = .;
emilmont 27:7110ebee3484 89 KEEP (*(SORT(.init_array.*)))
emilmont 27:7110ebee3484 90 KEEP (*(.init_array))
emilmont 27:7110ebee3484 91 __init_array_end = .;
emilmont 27:7110ebee3484 92
emilmont 27:7110ebee3484 93 . = ALIGN(0x4);
emilmont 27:7110ebee3484 94 KEEP (*crtbegin.o(.ctors))
emilmont 27:7110ebee3484 95 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
emilmont 27:7110ebee3484 96 KEEP (*(SORT(.ctors.*)))
emilmont 27:7110ebee3484 97 KEEP (*crtend.o(.ctors))
emilmont 27:7110ebee3484 98
emilmont 27:7110ebee3484 99 . = ALIGN(4);
emilmont 27:7110ebee3484 100 KEEP(*(.fini))
emilmont 27:7110ebee3484 101
emilmont 27:7110ebee3484 102 . = ALIGN(4);
emilmont 27:7110ebee3484 103 __fini_array_start = .;
emilmont 27:7110ebee3484 104 KEEP (*(.fini_array))
emilmont 27:7110ebee3484 105 KEEP (*(SORT(.fini_array.*)))
emilmont 27:7110ebee3484 106 __fini_array_end = .;
emilmont 27:7110ebee3484 107
emilmont 27:7110ebee3484 108 KEEP (*crtbegin.o(.dtors))
emilmont 27:7110ebee3484 109 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
emilmont 27:7110ebee3484 110 KEEP (*(SORT(.dtors.*)))
emilmont 27:7110ebee3484 111 KEEP (*crtend.o(.dtors))
emilmont 27:7110ebee3484 112
emilmont 27:7110ebee3484 113 . = ALIGN(4);
emilmont 27:7110ebee3484 114 __cs3_regions = .;
emilmont 27:7110ebee3484 115 LONG (0)
emilmont 27:7110ebee3484 116 LONG (__cs3_region_init_ram)
emilmont 27:7110ebee3484 117 LONG (__cs3_region_start_ram)
emilmont 27:7110ebee3484 118 LONG (__cs3_region_init_size_ram)
emilmont 27:7110ebee3484 119 LONG (__cs3_region_zero_size_ram)
emilmont 27:7110ebee3484 120 }
emilmont 27:7110ebee3484 121
emilmont 27:7110ebee3484 122 /* .ARM.exidx is sorted, so has to go in its own output section. */
emilmont 27:7110ebee3484 123 __exidx_start = .;
emilmont 27:7110ebee3484 124 .ARM.exidx :
emilmont 27:7110ebee3484 125 {
emilmont 27:7110ebee3484 126 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
emilmont 27:7110ebee3484 127 } >rom
emilmont 27:7110ebee3484 128 __exidx_end = .;
emilmont 27:7110ebee3484 129 .text.align :
emilmont 27:7110ebee3484 130 {
emilmont 27:7110ebee3484 131 . = ALIGN(8);
emilmont 27:7110ebee3484 132 _etext = .;
emilmont 27:7110ebee3484 133 } >rom
emilmont 27:7110ebee3484 134 __cs3_region_size_rom = LENGTH(rom);
emilmont 27:7110ebee3484 135 __cs3_region_num = 1;
emilmont 27:7110ebee3484 136
emilmont 27:7110ebee3484 137 .data :
emilmont 27:7110ebee3484 138 {
emilmont 27:7110ebee3484 139 __cs3_region_start_ram = .;
emilmont 27:7110ebee3484 140 *(.cs3.region-head.ram)
emilmont 27:7110ebee3484 141 KEEP(*(.jcr))
emilmont 27:7110ebee3484 142 *(.got.plt) *(.got)
emilmont 27:7110ebee3484 143 *(.shdata)
emilmont 27:7110ebee3484 144 *(.data .data.* .gnu.linkonce.d.*)
emilmont 27:7110ebee3484 145 *(.ram)
emilmont 27:7110ebee3484 146 . = ALIGN (8);
emilmont 27:7110ebee3484 147 _edata = .;
emilmont 27:7110ebee3484 148 } >ram AT>rom
emilmont 27:7110ebee3484 149 .bss :
emilmont 27:7110ebee3484 150 {
emilmont 27:7110ebee3484 151 *(.shbss)
emilmont 27:7110ebee3484 152 *(.bss .bss.* .gnu.linkonce.b.*)
emilmont 27:7110ebee3484 153 *(COMMON)
emilmont 27:7110ebee3484 154 *(.ram.b)
emilmont 27:7110ebee3484 155 . = ALIGN (8);
emilmont 27:7110ebee3484 156 _end = .;
emilmont 27:7110ebee3484 157 __end = .;
emilmont 27:7110ebee3484 158 } >ram AT>rom
emilmont 27:7110ebee3484 159 /* This used for USB RAM section */
emilmont 27:7110ebee3484 160 .usb_ram (NOLOAD):
emilmont 27:7110ebee3484 161 {
emilmont 27:7110ebee3484 162 *.o (USB_RAM)
emilmont 27:7110ebee3484 163 } > ram2
emilmont 27:7110ebee3484 164 .heap (NOLOAD) :
emilmont 27:7110ebee3484 165 {
emilmont 27:7110ebee3484 166 *(.heap)
emilmont 27:7110ebee3484 167 } >ram
emilmont 27:7110ebee3484 168 .stack (__cs3_stack - __cs3_stack_size) (NOLOAD):
emilmont 27:7110ebee3484 169 {
emilmont 27:7110ebee3484 170 *(.stack)
emilmont 27:7110ebee3484 171 _estack = .;
emilmont 27:7110ebee3484 172 PROVIDE(estack = .);
emilmont 27:7110ebee3484 173 } >ram
emilmont 27:7110ebee3484 174
emilmont 27:7110ebee3484 175 __cs3_region_init_ram = LOADADDR (.data);
emilmont 27:7110ebee3484 176 __cs3_region_init_size_ram = _edata - __cs3_region_start_ram;
emilmont 27:7110ebee3484 177 __cs3_region_zero_size_ram = _end - _edata;
emilmont 27:7110ebee3484 178 __cs3_region_size_ram = LENGTH(ram);
emilmont 27:7110ebee3484 179 __cs3_region_num = 1;
emilmont 27:7110ebee3484 180
emilmont 27:7110ebee3484 181 .stab 0 (NOLOAD) : { *(.stab) }
emilmont 27:7110ebee3484 182 .stabstr 0 (NOLOAD) : { *(.stabstr) }
emilmont 27:7110ebee3484 183 /* DWARF debug sections.
emilmont 27:7110ebee3484 184 * Symbols in the DWARF debugging sections are relative to the beginning
emilmont 27:7110ebee3484 185 * of the section so we begin them at 0. */
emilmont 27:7110ebee3484 186 /* DWARF 1 */
emilmont 27:7110ebee3484 187 .debug 0 : { *(.debug) }
emilmont 27:7110ebee3484 188 .line 0 : { *(.line) }
emilmont 27:7110ebee3484 189 /* GNU DWARF 1 extensions */
emilmont 27:7110ebee3484 190 .debug_srcinfo 0 : { *(.debug_srcinfo) }
emilmont 27:7110ebee3484 191 .debug_sfnames 0 : { *(.debug_sfnames) }
emilmont 27:7110ebee3484 192 /* DWARF 1.1 and DWARF 2 */
emilmont 27:7110ebee3484 193 .debug_aranges 0 : { *(.debug_aranges) }
emilmont 27:7110ebee3484 194 .debug_pubnames 0 : { *(.debug_pubnames) }
emilmont 27:7110ebee3484 195 /* DWARF 2 */
emilmont 27:7110ebee3484 196 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
emilmont 27:7110ebee3484 197 .debug_abbrev 0 : { *(.debug_abbrev) }
emilmont 27:7110ebee3484 198 .debug_line 0 : { *(.debug_line) }
emilmont 27:7110ebee3484 199 .debug_frame 0 : { *(.debug_frame) }
emilmont 27:7110ebee3484 200 .debug_str 0 : { *(.debug_str) }
emilmont 27:7110ebee3484 201 .debug_loc 0 : { *(.debug_loc) }
emilmont 27:7110ebee3484 202 .debug_macinfo 0 : { *(.debug_macinfo) }
emilmont 27:7110ebee3484 203 /* SGI/MIPS DWARF 2 extensions */
emilmont 27:7110ebee3484 204 .debug_weaknames 0 : { *(.debug_weaknames) }
emilmont 27:7110ebee3484 205 .debug_funcnames 0 : { *(.debug_funcnames) }
emilmont 27:7110ebee3484 206 .debug_typenames 0 : { *(.debug_typenames) }
emilmont 27:7110ebee3484 207 .debug_varnames 0 : { *(.debug_varnames) }
emilmont 27:7110ebee3484 208
emilmont 27:7110ebee3484 209 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
emilmont 27:7110ebee3484 210 .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
emilmont 27:7110ebee3484 211 /DISCARD/ : { *(.note.GNU-stack) }
emilmont 27:7110ebee3484 212 }