]> git.sur5r.net Git - freertos/blob - Demo/ColdFire_MCF52233_Eclipse/RTOSDemo/m52233-rom.ld
Continue to develop demo.
[freertos] / Demo / ColdFire_MCF52233_Eclipse / RTOSDemo / m52233-rom.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 -lcs3unhosted -lcs3coldfire)
22
23 MEMORY
24 {
25   ram (rw) : ORIGIN = 0x20000000, LENGTH = 32K
26   vectorrom   (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400
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
42 PROVIDE(__cs3_heap_start = _end);
43 PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
44 PROVIDE(__cs3_region_num = (__cs3_regions_end - __cs3_regions) / 20);
45 PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
46
47 SECTIONS
48 {
49
50         .vectors_table :
51         {
52                 CREATE_OBJECT_SYMBOLS
53                 __cs3_region_start_rom = .;
54                 *(.cs3.region-head.rom)
55                 ASSERT (. == __cs3_region_start_rom, ".cs3.region-head.rom not permitted");
56                 __cs3_interrupt_vector = __cs3_interrupt_vector_coldfire;
57                 *(.cs3.interrupt_vector)
58                 /* Make sure we pulled in an interrupt vector.  */
59                 ASSERT (. != __cs3_interrupt_vector_coldfire, "No interrupt vector");
60         } > vectorrom
61
62         .cfmprotect :
63         {
64                 *(.cfmconfig)
65                 . = ALIGN (0x4);
66         } > cfmprotrom
67
68
69   .text :
70   {
71
72     PROVIDE(__cs3_reset_m52235evb = _start);
73     __cs3_reset = __cs3_reset_m52235evb;
74     *(.cs3.reset)
75
76     *(.text .text.* .gnu.linkonce.t.*)
77
78     . = ALIGN(0x4);
79     KEEP (*crtbegin.o(.jcr))
80     KEEP (*(EXCLUDE_FILE (*crtend.o) .jcr))
81     KEEP (*crtend.o(.jcr))
82
83     . = ALIGN(0x4);
84     *(.gcc_except_table .gcc_except_table.*)
85   } >rom
86   .eh_frame_hdr : ALIGN (4)
87   {
88     KEEP (*(.eh_frame_hdr))
89   } >rom
90   .eh_frame : ALIGN (4)
91   {
92     KEEP (*(.eh_frame))
93   } >rom
94   .rodata : ALIGN (4)
95   {
96     *(.rodata .rodata.* .gnu.linkonce.r.*)
97
98     . = ALIGN(4);
99     _init = .;
100     LONG (0x4e560000)   /* linkw %fp,#0 */
101     KEEP(*(.init))
102     SHORT (0x4e5e)      /* unlk %fp */
103     SHORT (0x4e75)      /* rts */
104
105     . = ALIGN(4);
106     __preinit_array_start = .;
107     KEEP (*(.preinit_array))
108     __preinit_array_end = .;
109
110     . = ALIGN(4);
111     __init_array_start = .;
112     KEEP (*(SORT(.init_array.*)))
113     KEEP (*(.init_array))
114     __init_array_end = .;
115
116     . = ALIGN(4);
117     _fini = .;
118     LONG (0x4e560000)   /* linkw %fp,#0 */
119     KEEP(*(.fini))
120     SHORT (0x4e5e)      /* unlk %fp */
121     SHORT (0x4e75)      /* rts */
122
123     . = ALIGN(4);
124     __fini_array_start = .;
125     KEEP (*(.fini_array))
126     KEEP (*(SORT(.fini_array.*)))
127     __fini_array_end = .;
128
129     . = ALIGN(0x4);
130     KEEP (*crtbegin.o(.ctors))
131     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
132     KEEP (*(SORT(.ctors.*)))
133     KEEP (*crtend.o(.ctors))
134
135     . = ALIGN(0x4);
136     KEEP (*crtbegin.o(.dtors))
137     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
138     KEEP (*(SORT(.dtors.*)))
139     KEEP (*crtend.o(.dtors))
140
141     *(.lit)
142
143     . = ALIGN(4);
144     __cs3_regions = .;
145     LONG (0)
146     LONG (__cs3_region_init_ram)
147     LONG (__cs3_region_start_ram)
148     LONG (__cs3_region_init_size_ram)
149     LONG (__cs3_region_zero_size_ram)
150     __cs3_regions_end = .;
151
152     . = ALIGN (8);
153     . = ALIGN (8);
154     *(.rom)
155     *(.rom.b)
156     _etext = .;
157   } >rom
158   /* __cs3_region_end_rom is deprecated */
159   __cs3_region_end_rom = __cs3_region_start_rom + LENGTH(rom);
160   __cs3_region_size_rom = LENGTH(rom);
161
162   .cs3.ipsbar :
163   {
164     __cs3_region_start_ipsbar = .;
165     *(.cs3.region-head.ipsbar)
166     . = ALIGN (8);
167   } >ipsbar
168   /* __cs3_region_end_ipsbar is deprecated */
169   __cs3_region_end_ipsbar = __cs3_region_start_ipsbar + LENGTH(ipsbar);
170   __cs3_region_size_ipsbar = LENGTH(ipsbar);
171
172   .data : ALIGN (8)
173   {
174     __cs3_region_start_ram = .;
175     *(.cs3.region-head.ram)
176     *(.got.plt) *(.got)
177     *(.shdata)
178     *(.data .data.* .gnu.linkonce.d.*)
179     . = ALIGN (8);
180     *(.ram)
181     _edata = .;
182   } >ram AT>rom
183   .bss :
184   {
185     *(.shbss)
186     *(.bss .bss.* .gnu.linkonce.b.*)
187     *(COMMON)
188     . = ALIGN (8);
189     *(.ram.b)
190     _end = .;
191     __end = .;
192   } >ram AT>rom
193   /* __cs3_region_end_ram is deprecated */
194   __cs3_region_end_ram = __cs3_region_start_ram + LENGTH(ram);
195   __cs3_region_size_ram = LENGTH(ram);
196   __cs3_region_init_ram = LOADADDR (.data);
197   __cs3_region_init_size_ram = _edata - ADDR (.data);
198   __cs3_region_zero_size_ram = _end - _edata;
199
200   .stab 0 (NOLOAD) : { *(.stab) }
201   .stabstr 0 (NOLOAD) : { *(.stabstr) }
202   /* DWARF debug sections.
203    * Symbols in the DWARF debugging sections are relative to the beginning
204    * of the section so we begin them at 0.  */
205   /* DWARF 1 */
206   .debug          0 : { *(.debug) }
207   .line           0 : { *(.line) }
208   /* GNU DWARF 1 extensions */
209   .debug_srcinfo  0 : { *(.debug_srcinfo) }
210   .debug_sfnames  0 : { *(.debug_sfnames) }
211   /* DWARF 1.1 and DWARF 2 */
212   .debug_aranges  0 : { *(.debug_aranges) }
213   .debug_pubnames 0 : { *(.debug_pubnames) }
214   /* DWARF 2 */
215   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
216   .debug_abbrev   0 : { *(.debug_abbrev) }
217   .debug_line     0 : { *(.debug_line) }
218   .debug_frame    0 : { *(.debug_frame) }
219   .debug_str      0 : { *(.debug_str) }
220   .debug_loc      0 : { *(.debug_loc) }
221   .debug_macinfo  0 : { *(.debug_macinfo) }
222   /* SGI/MIPS DWARF 2 extensions */
223   .debug_weaknames 0 : { *(.debug_weaknames) }
224   .debug_funcnames 0 : { *(.debug_funcnames) }
225   .debug_typenames 0 : { *(.debug_typenames) }
226   .debug_varnames  0 : { *(.debug_varnames) }
227 }