]> git.sur5r.net Git - freertos/blob - Demo/ColdFire_MCF52233_Eclipse/RTOSDemo/m52235evb-rom-hosted.ld
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / ColdFire_MCF52233_Eclipse / RTOSDemo / m52235evb-rom-hosted.ld
1 /* Linker script for m52235evb
2  *
3  * Version:Sourcery G++ Lite 4.2-125
4  * BugURL:https://support.codesourcery.com/GNUToolchain/
5  *
6  *  Copyright 2007, 2008 CodeSourcery.
7  *
8  * The authors hereby grant permission to use, copy, modify, distribute,
9  * and license this software and its documentation for any purpose, provided
10  * that existing copyright notices are retained in all copies and that this
11  * notice is included verbatim in any distributions. No written agreement,
12  * license, or royalty fee is required for any of the authorized uses.
13  * Modifications to this software may be copyrighted by their authors
14  * and need not follow the licensing terms described here, provided that
15  * the new terms are clearly indicated on the first page of each file where
16  * they apply. */
17
18 OUTPUT_ARCH(m68k)
19 ENTRY(_start)
20 SEARCH_DIR(.)
21 GROUP(-lgcc -lc -lcs3 -lcs3hosted -lcs3coldfire)
22
23 MEMORY
24 {
25   ram (rw) : ORIGIN = 0x20000000, LENGTH = 32K\r
26   vectorrom   (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400\r
27   cfmprotrom  (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000020   
28   rom (rx) : ORIGIN = 0x00000420, LENGTH = 256K - 0x400 - 0x20
29   ipsbar (rw) : ORIGIN = 0x40000000, LENGTH = 2M
30 }
31
32 /* These force the linker to search for particular symbols from
33  * the start of the link process and thus ensure the user's
34  * overrides are picked up
35  */
36 EXTERN(__cs3_reset_m52235evb)
37 INCLUDE coldfire-names.inc
38 EXTERN(__cs3_interrupt_vector_coldfire)
39 EXTERN(__cs3_start_c main __cs3_stack __cs3_heap_end)
40 EXTERN(_start)
41 /* force exit to be picked up in a hosted or os environment */
42 EXTERN(exit atexit)
43
44 PROVIDE(__cs3_heap_start = _end);
45 PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
46 PROVIDE(__cs3_region_num = (__cs3_regions_end - __cs3_regions) / 20);
47 PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
48
49 SECTIONS
50 {
51 \r
52         .vectors_table :\r
53         {\r
54                 CREATE_OBJECT_SYMBOLS\r
55                 __cs3_region_start_rom = .;\r
56                 *(.cs3.region-head.rom)\r
57                 ASSERT (. == __cs3_region_start_rom, ".cs3.region-head.rom not permitted");\r
58                 __cs3_interrupt_vector = __cs3_interrupt_vector_coldfire;\r
59                 *(.cs3.interrupt_vector)\r
60                 /* Make sure we pulled in an interrupt vector.  */\r
61                 ASSERT (. != __cs3_interrupt_vector_coldfire, "No interrupt vector");\r
62         } > vectorrom\r
63 \r
64         .cfmprotect :\r
65         {\r
66                 *(.cfmconfig)\r
67                 . = ALIGN (0x4);\r
68         } > cfmprotrom\r
69 \r
70
71   .text :
72   {
73
74     PROVIDE(__cs3_reset_m52235evb = _start);
75     __cs3_reset = __cs3_reset_m52235evb;
76     *(.cs3.reset)
77
78     *(.text .text.* .gnu.linkonce.t.*)
79
80     . = ALIGN(0x4);
81     KEEP (*crtbegin.o(.jcr))
82     KEEP (*(EXCLUDE_FILE (*crtend.o) .jcr))
83     KEEP (*crtend.o(.jcr))
84
85     . = ALIGN(0x4);
86     *(.gcc_except_table .gcc_except_table.*)
87   } >rom
88   .eh_frame_hdr : ALIGN (4)
89   {
90     KEEP (*(.eh_frame_hdr))
91   } >rom
92   .eh_frame : ALIGN (4)
93   {
94     KEEP (*(.eh_frame))
95   } >rom
96   .rodata : ALIGN (4)
97   {
98     *(.rodata .rodata.* .gnu.linkonce.r.*)
99
100     . = ALIGN(4);
101     _init = .;
102     LONG (0x4e560000)   /* linkw %fp,#0 */
103     KEEP(*(.init))
104     SHORT (0x4e5e)      /* unlk %fp */
105     SHORT (0x4e75)      /* rts */
106
107     . = ALIGN(4);
108     __preinit_array_start = .;
109     KEEP (*(.preinit_array))
110     __preinit_array_end = .;
111
112     . = ALIGN(4);
113     __init_array_start = .;
114     KEEP (*(SORT(.init_array.*)))
115     KEEP (*(.init_array))
116     __init_array_end = .;
117
118     . = ALIGN(4);
119     _fini = .;
120     LONG (0x4e560000)   /* linkw %fp,#0 */
121     KEEP(*(.fini))
122     SHORT (0x4e5e)      /* unlk %fp */
123     SHORT (0x4e75)      /* rts */
124
125     . = ALIGN(4);
126     __fini_array_start = .;
127     KEEP (*(.fini_array))
128     KEEP (*(SORT(.fini_array.*)))
129     __fini_array_end = .;
130
131     . = ALIGN(0x4);
132     KEEP (*crtbegin.o(.ctors))
133     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
134     KEEP (*(SORT(.ctors.*)))
135     KEEP (*crtend.o(.ctors))
136
137     . = ALIGN(0x4);
138     KEEP (*crtbegin.o(.dtors))
139     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
140     KEEP (*(SORT(.dtors.*)))
141     KEEP (*crtend.o(.dtors))
142
143     *(.lit)
144
145     . = ALIGN(4);
146     __cs3_regions = .;
147     LONG (0)
148     LONG (__cs3_region_init_ram)
149     LONG (__cs3_region_start_ram)
150     LONG (__cs3_region_init_size_ram)
151     LONG (__cs3_region_zero_size_ram)
152     __cs3_regions_end = .;
153
154     . = ALIGN (8);
155     . = ALIGN (8);
156     *(.rom)
157     *(.rom.b)
158     _etext = .;
159   } >rom
160   /* __cs3_region_end_rom is deprecated */
161   __cs3_region_end_rom = __cs3_region_start_rom + LENGTH(rom);
162   __cs3_region_size_rom = LENGTH(rom);
163
164   .cs3.ipsbar :
165   {
166     __cs3_region_start_ipsbar = .;
167     *(.cs3.region-head.ipsbar)
168     . = ALIGN (8);
169   } >ipsbar
170   /* __cs3_region_end_ipsbar is deprecated */
171   __cs3_region_end_ipsbar = __cs3_region_start_ipsbar + LENGTH(ipsbar);
172   __cs3_region_size_ipsbar = LENGTH(ipsbar);
173
174   .data : ALIGN (8)
175   {
176     __cs3_region_start_ram = .;
177     *(.cs3.region-head.ram)
178     *(.got.plt) *(.got)
179     *(.shdata)
180     *(.data .data.* .gnu.linkonce.d.*)
181     . = ALIGN (8);
182     *(.ram)
183     _edata = .;
184   } >ram AT>rom
185   .bss :
186   {
187     *(.shbss)
188     *(.bss .bss.* .gnu.linkonce.b.*)
189     *(COMMON)
190     . = ALIGN (8);
191     *(.ram.b)
192     _end = .;
193     __end = .;
194   } >ram AT>rom
195   /* __cs3_region_end_ram is deprecated */
196   __cs3_region_end_ram = __cs3_region_start_ram + LENGTH(ram);
197   __cs3_region_size_ram = LENGTH(ram);
198   __cs3_region_init_ram = LOADADDR (.data);
199   __cs3_region_init_size_ram = _edata - ADDR (.data);
200   __cs3_region_zero_size_ram = _end - _edata;
201
202   .stab 0 (NOLOAD) : { *(.stab) }
203   .stabstr 0 (NOLOAD) : { *(.stabstr) }
204   /* DWARF debug sections.
205    * Symbols in the DWARF debugging sections are relative to the beginning
206    * of the section so we begin them at 0.  */
207   /* DWARF 1 */
208   .debug          0 : { *(.debug) }
209   .line           0 : { *(.line) }
210   /* GNU DWARF 1 extensions */
211   .debug_srcinfo  0 : { *(.debug_srcinfo) }
212   .debug_sfnames  0 : { *(.debug_sfnames) }
213   /* DWARF 1.1 and DWARF 2 */
214   .debug_aranges  0 : { *(.debug_aranges) }
215   .debug_pubnames 0 : { *(.debug_pubnames) }
216   /* DWARF 2 */
217   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
218   .debug_abbrev   0 : { *(.debug_abbrev) }
219   .debug_line     0 : { *(.debug_line) }
220   .debug_frame    0 : { *(.debug_frame) }
221   .debug_str      0 : { *(.debug_str) }
222   .debug_loc      0 : { *(.debug_loc) }
223   .debug_macinfo  0 : { *(.debug_macinfo) }
224   /* SGI/MIPS DWARF 2 extensions */
225   .debug_weaknames 0 : { *(.debug_weaknames) }
226   .debug_funcnames 0 : { *(.debug_funcnames) }
227   .debug_typenames 0 : { *(.debug_typenames) }
228   .debug_varnames  0 : { *(.debug_varnames) }
229 }