]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/xmc1000_flash.ld
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS / Demo / CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC / Atollic_Specific / xmc1000_flash.ld
1 /*
2 *****************************************************************************
3 **
4 **  File        : xmc1000_flash.ld
5 **
6 **  Abstract    : Linker script for XMC1200-T038F0200 Device with
7 **                200KByte FLASH, 16KByte RAM
8 **
9 **                Set heap size, stack size and stack location according
10 **                to application requirements.
11 **
12 **  Target      : Infineon XMC1000 Microcontrollers
13 **
14 **  Environment : Atollic TrueSTUDIO(R)
15 **
16 **  Distribution: The file is distributed \93as is,\94 without any warranty
17 **                of any kind.
18 **
19 **  (c)Copyright Atollic AB.
20 **  You may use this file as-is or modify it according to the needs of your
21 **  project. This file may only be built (assembled or compiled and linked)
22 **  using the Atollic TrueSTUDIO(R) product. The use of this file together
23 **  with other tools than Atollic TrueSTUDIO(R) is not permitted.
24 **
25 *****************************************************************************
26 */
27
28 /* Entry Point */
29 ENTRY(Reset_Handler)
30
31 /* Highest address of the user mode stack */
32 _estack = 0x20004000;    /* end of 16K RAM */
33
34 /* Generate a link error if heap and stack don't fit into RAM */
35 _Min_Heap_Size = 0;      /* required amount of heap  */
36 _Min_Stack_Size = 0x200; /* required amount of stack */
37
38 /* Specify the memory areas */
39 MEMORY
40 {
41   FLASH (rx)     : ORIGIN = 0x10001000, LENGTH = 200K
42   RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 16K
43   MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
44 }
45
46 /* Define output sections */
47 SECTIONS
48 {
49   /* The startup code goes first into FLASH */
50   .isr_vector :
51   {
52     . = ALIGN(4);
53     KEEP(*(.isr_vector)) /* Startup code */
54     . = ALIGN(4);
55   } >FLASH
56
57   /* The program code and other data goes into FLASH */
58   .text :
59   {
60     . = ALIGN(4);
61     *(.text)           /* .text sections (code) */
62     *(.text*)          /* .text* sections (code) */
63     *(.XmcStartup);
64     *(.glue_7)         /* glue arm to thumb code */
65     *(.glue_7t)        /* glue thumb to arm code */
66     *(.eh_frame)
67
68     KEEP (*(.init))
69     KEEP (*(.fini))
70
71     . = ALIGN(4);
72     _etext = .;        /* define a global symbols at end of code */
73   } >FLASH
74
75   /* Constant data goes into FLASH */
76   .rodata :
77   {
78     . = ALIGN(4);
79     *(.rodata)         /* .rodata sections (constants, strings, etc.) */
80     *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
81     . = ALIGN(4);
82   } >FLASH
83   
84   .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
85   .ARM : {
86     __exidx_start = .;
87     *(.ARM.exidx*)
88     __exidx_end = .;
89   } >FLASH
90
91   .preinit_array     :
92   {
93     PROVIDE_HIDDEN (__preinit_array_start = .);
94     KEEP (*(.preinit_array*))
95     PROVIDE_HIDDEN (__preinit_array_end = .);
96   } >FLASH
97   .init_array :
98   {
99     PROVIDE_HIDDEN (__init_array_start = .);
100     KEEP (*(SORT(.init_array.*)))
101     KEEP (*(.init_array*))
102     PROVIDE_HIDDEN (__init_array_end = .);
103   } >FLASH
104   .fini_array :
105   {
106     PROVIDE_HIDDEN (__fini_array_start = .);
107     KEEP (*(SORT(.fini_array.*)))
108     KEEP (*(.fini_array*))
109     PROVIDE_HIDDEN (__fini_array_end = .);
110   } >FLASH
111
112   . = ALIGN(4);
113   eROData = . ;
114
115   /* Initialize XMC Veneer interrupt code */ 
116   VeneerLoadAddr = ABSOLUTE(eROData);
117   .VENEER_Code ABSOLUTE(0x2000000C) : 
118   {
119     VeneerStart = .;
120     KEEP(*(.XmcVeneerCode)) /* Keep the VeneerCode */
121     *(.XmcVeneerCode);
122     . = ALIGN(4);
123     VeneerEnd = .;
124     
125   } >RAM AT> FLASH
126
127   VeneerSize = ABSOLUTE(VeneerEnd) - ABSOLUTE(VeneerStart);
128
129   /* used by the startup to initialize data */
130   _sidata = LOADADDR(.data);
131
132   /* Initialized data sections goes into RAM, load LMA copy after code */
133   .data : 
134   {
135     . = ALIGN(4);
136     _sdata = .;        /* create a global symbol at data start */
137     *(.data)           /* .data sections */
138     *(.data*)          /* .data* sections */
139
140     . = ALIGN(4);
141     _edata = .;        /* define a global symbol at data end */
142   } >RAM AT> FLASH
143
144   /* Uninitialized data section */
145   . = ALIGN(4);
146   .bss :
147   {
148     /* This is used by the startup in order to initialize the .bss secion */
149     _sbss = .;         /* define a global symbol at bss start */
150     __bss_start__ = _sbss;
151     *(.bss)
152     *(.bss*)
153     *(COMMON)
154
155     . = ALIGN(4);
156     _ebss = .;         /* define a global symbol at bss end */
157     __bss_end__ = _ebss;
158   } >RAM
159
160   /* User_heap_stack section, used to check that there is enough RAM left */
161   ._user_heap_stack :
162   {
163     . = ALIGN(4);
164     PROVIDE ( end = . );
165     PROVIDE ( _end = . );
166     . = . + _Min_Heap_Size;
167     . = . + _Min_Stack_Size;
168     . = ALIGN(4);
169   } >RAM
170
171   /* MEMORY_bank1 section, code must be located here explicitly            */
172   /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
173   .memory_b1_text :
174   {
175     *(.mb1text)        /* .mb1text sections (code) */
176     *(.mb1text*)       /* .mb1text* sections (code)  */
177     *(.mb1rodata)      /* read-only data (constants) */
178     *(.mb1rodata*)
179   } >MEMORY_B1
180
181   /* Remove information from the standard libraries */
182   /DISCARD/ :
183   {
184     libc.a ( * )
185     libm.a ( * )
186     libgcc.a ( * )
187   }
188
189   .ARM.attributes 0 : { *(.ARM.attributes) }
190 }