Library

Dependents:   OSCTest_2

Fork of mbed by gokmen ascioglu

Committer:
itotaka
Date:
Fri Oct 04 12:17:02 2013 +0000
Revision:
1:b749145a7bb1
Parent:
0:a8fa94490a0a
changed Max_Arg to 80

Who changed what in which revision?

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