mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
shaoziyang
Date:
Sat Sep 13 14:25:46 2014 +0000
Revision:
323:9e901b0a5aa1
Parent:
13:0645d8841f51
test with CLOCK_SETUP = 0

Who changed what in which revision?

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