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