]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/CMSIS/startup_gcc/debug-in-external-ram.ld
b2d614d31e48fd170ba6aef1816ed5f0734d6e08
[freertos] / Demo / CORTEX_A2F200_IAR_and_Keil / MicroSemi_Code / CMSIS / startup_gcc / debug-in-external-ram.ld
1 /*******************************************************************************
2  * (c) Copyright 2009 Actel Corporation.  All rights reserved.
3  * 
4  * SmartFusion/Cortex-M3 linker script for creating a SoftConsole downloadable
5  * debug image executing in SmartFusion development board external RAM.
6  *
7  * SVN $Revision: 2014 $
8  * SVN $Date: 2010-01-20 10:37:26 +0000 (Wed, 20 Jan 2010) $
9  */
10
11 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
12               "elf32-littlearm")
13 GROUP(-lc -lgcc -lm)
14 OUTPUT_ARCH(arm)
15 ENTRY(Reset_Handler)
16 SEARCH_DIR(.)
17 __DYNAMIC  =  0;
18
19 /*******************************************************************************
20  * Start of board customization.
21  *******************************************************************************/
22 MEMORY
23 {
24   /* SmartFusion internal eSRAM */
25   esram (rwx) : ORIGIN = 0x20000000, LENGTH = 64k
26   
27   /* SmartFusion development board external RAM */
28   external_ram (rwx) : ORIGIN = 0x70000000, LENGTH = 2M
29 }
30
31 RAM_START_ADDRESS = 0x70000000; /* Must be the same value MEMORY region ram ORIGIN above. */
32 RAM_SIZE = 64k;                                 /* Must be the same value MEMORY region ram LENGTH above. */
33 MAIN_STACK_SIZE = 8k;                   /* Cortex main stack size. */
34 PROCESS_STACK_SIZE      = 4k;           /* Cortex process stack size (only available with OS extensions).*/
35
36 /*******************************************************************************
37  * End of board customization.
38  *******************************************************************************/
39  
40 PROVIDE (__main_stack_start = RAM_START_ADDRESS + RAM_SIZE);
41 PROVIDE (__process_stack_start = __main_stack_start - MAIN_STACK_SIZE);
42 PROVIDE (_estack = __main_stack_start);
43 PROVIDE (__mirrored_nvm = 0);   /* Indicate to startup code that NVM is not mirrored to VMA address .text copy is required. */
44
45 SECTIONS
46 {
47   .init :
48   {
49     *(.isr_vector)
50     . = ALIGN(0x4);
51   } >esram
52   
53   .text :
54   {
55     CREATE_OBJECT_SYMBOLS
56     __text_load = LOADADDR(.text);
57     __text_start = .;
58     *(.text .text.* .gnu.linkonce.t.*)
59     *(.plt)
60     *(.gnu.warning)
61     *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
62
63     . = ALIGN(0x4);
64     /* These are for running static constructors and destructors under ELF.  */
65     KEEP (*crtbegin.o(.ctors))
66     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
67     KEEP (*(SORT(.ctors.*)))
68     KEEP (*crtend.o(.ctors))
69     KEEP (*crtbegin.o(.dtors))
70     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
71     KEEP (*(SORT(.dtors.*)))
72     KEEP (*crtend.o(.dtors))
73
74     *(.rodata .rodata.* .gnu.linkonce.r.*)
75
76     *(.ARM.extab* .gnu.linkonce.armextab.*)
77     *(.gcc_except_table) 
78     *(.eh_frame_hdr)
79     *(.eh_frame)
80
81     KEEP (*(.init))
82     KEEP (*(.fini))
83
84     PROVIDE_HIDDEN (__preinit_array_start = .);
85     KEEP (*(.preinit_array))
86     PROVIDE_HIDDEN (__preinit_array_end = .);
87     PROVIDE_HIDDEN (__init_array_start = .);
88     KEEP (*(SORT(.init_array.*)))
89     KEEP (*(.init_array))
90     PROVIDE_HIDDEN (__init_array_end = .);
91     PROVIDE_HIDDEN (__fini_array_start = .);
92     KEEP (*(.fini_array))
93     KEEP (*(SORT(.fini_array.*)))
94     PROVIDE_HIDDEN (__fini_array_end = .);
95   } >external_ram
96   /* .ARM.exidx is sorted, so has to go in its own output section.  */
97    __exidx_start = .;
98   .ARM.exidx :
99   {
100     *(.ARM.exidx* .gnu.linkonce.armexidx.*)
101   } >external_ram
102   __exidx_end = .;
103   _etext = .;
104   PROVIDE(__text_end = .);
105
106   .data :
107   {
108     __data_load = LOADADDR (.data);
109     _sidata = LOADADDR (.data);
110     __data_start = .;
111     _sdata = .;
112     KEEP(*(.jcr))
113     *(.got.plt) *(.got)
114     *(.shdata)
115     *(.data .data.* .gnu.linkonce.d.*)
116     . = ALIGN (4);
117     _edata = .;
118   } >external_ram 
119
120   .bss :
121   {
122     __bss_start__ = . ;
123     _sbss = .;
124     *(.shbss)
125     *(.bss .bss.* .gnu.linkonce.b.*)
126     *(COMMON)
127     . = ALIGN (8);
128     __bss_end__ = .;
129     _end = .;
130     __end = _end;
131     _ebss = .;
132     PROVIDE(end = .);
133   } >external_ram 
134
135   /* 
136    * The .stack section is only specified here in order for the linker to generate
137    * an error if the esram is full.
138    */
139   .stack :
140   {
141         . = ALIGN(4);
142     . += PROCESS_STACK_SIZE;
143     . = ALIGN(4);
144     . += MAIN_STACK_SIZE;
145     . = ALIGN(4);
146   } >external_ram
147   
148   .stab 0 (NOLOAD) :
149   {
150     *(.stab)
151   }
152
153   .stabstr 0 (NOLOAD) :
154   {
155     *(.stabstr)
156   }
157   /* DWARF debug sections.
158      Symbols in the DWARF debugging sections are relative to the beginning
159      of the section so we begin them at 0.  */
160   /* DWARF 1 */
161   .debug          0 : { *(.debug) }
162   .line           0 : { *(.line) }
163   /* GNU DWARF 1 extensions */
164   .debug_srcinfo  0 : { *(.debug_srcinfo) }
165   .debug_sfnames  0 : { *(.debug_sfnames) }
166   /* DWARF 1.1 and DWARF 2 */
167   .debug_aranges  0 : { *(.debug_aranges) }
168   .debug_pubnames 0 : { *(.debug_pubnames) }
169   /* DWARF 2 */
170   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
171   .debug_abbrev   0 : { *(.debug_abbrev) }
172   .debug_line     0 : { *(.debug_line) }
173   .debug_frame    0 : { *(.debug_frame) }
174   .debug_str      0 : { *(.debug_str) }
175   .debug_loc      0 : { *(.debug_loc) }
176   .debug_macinfo  0 : { *(.debug_macinfo) }
177   /* SGI/MIPS DWARF 2 extensions */
178   .debug_weaknames 0 : { *(.debug_weaknames) }
179   .debug_funcnames 0 : { *(.debug_funcnames) }
180   .debug_typenames 0 : { *(.debug_typenames) }
181   .debug_varnames  0 : { *(.debug_varnames) }
182   .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
183   .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
184   /DISCARD/ : { *(.note.GNU-stack) *(.isr_vector) }
185 }