1 | /* |
---|
2 | * This file contains GNU linker directives for an MCF5206eLITE |
---|
3 | * evaluation board. |
---|
4 | * |
---|
5 | * Variations in memory size and allocation can be made by |
---|
6 | * overriding some values with linker command-line arguments. |
---|
7 | * |
---|
8 | * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia |
---|
9 | * Author: Victor V. Vengerov <vvv@oktet.ru> |
---|
10 | * |
---|
11 | * This file based on work: |
---|
12 | * David Fiddes, D.J.Fiddes@hw.ac.uk |
---|
13 | * http://www.calm.hw.ac.uk/davidf/coldfire/ |
---|
14 | * |
---|
15 | * The license and distribution terms for this file may be |
---|
16 | * found in the file LICENSE in this distribution or at |
---|
17 | * |
---|
18 | * http://www.rtems.org/license/LICENSE. |
---|
19 | */ |
---|
20 | |
---|
21 | /* |
---|
22 | * Declare some sizes. |
---|
23 | * XXX: The assignment of ". += XyzSize;" fails in older gld's if the |
---|
24 | * number used there is not constant. If this happens to you, edit |
---|
25 | * the lines marked XXX below to use a constant value. |
---|
26 | */ |
---|
27 | |
---|
28 | /* |
---|
29 | * Declare system clock frequency. |
---|
30 | */ |
---|
31 | _SYS_CLOCK_FREQUENCY = DEFINED(_SYS_CLOCK_FREQUENCY) ? |
---|
32 | _SYS_CLOCK_FREQUENCY : 54000000; |
---|
33 | |
---|
34 | /* |
---|
35 | * Declare size of heap. |
---|
36 | * A heap size of 0 means "Use all available memory for the heap". |
---|
37 | * Initial stack located in on-chip SRAM and not declared there. |
---|
38 | */ |
---|
39 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
40 | RamBase = DEFINED(RamBase) ? RamBase : 0x30000000; |
---|
41 | RamSize = DEFINED(RamSize) ? RamSize : 0x00100000; |
---|
42 | RamEnd = RamBase + RamSize; |
---|
43 | |
---|
44 | /* |
---|
45 | * Setup the memory map of the MCF5206eLITE evaluation board |
---|
46 | * |
---|
47 | * The "rom" section is in USER Flash on the board |
---|
48 | * The "ram" section is placed in USER RAM starting at 10000h |
---|
49 | * |
---|
50 | */ |
---|
51 | MEMORY |
---|
52 | { |
---|
53 | ram : ORIGIN = 0x30000000, LENGTH = 0x00100000 |
---|
54 | rom : ORIGIN = 0xFFE20000, LENGTH = 128k |
---|
55 | } |
---|
56 | |
---|
57 | MBase = 0x10000000; |
---|
58 | |
---|
59 | ENTRY(start) |
---|
60 | STARTUP(start.o) |
---|
61 | |
---|
62 | /* Interrupt Vector table located at start of external static RAM */ |
---|
63 | _VBR = 0x30000000; |
---|
64 | |
---|
65 | SECTIONS |
---|
66 | { |
---|
67 | |
---|
68 | /* |
---|
69 | * Dynamic RAM |
---|
70 | */ |
---|
71 | ram : { |
---|
72 | RamBase = .; |
---|
73 | RamBase = .; |
---|
74 | /* Reserve space for interrupt table */ |
---|
75 | . += 0x400; |
---|
76 | } >ram |
---|
77 | |
---|
78 | /* |
---|
79 | * Text, data and bss segments |
---|
80 | */ |
---|
81 | .text : { |
---|
82 | CREATE_OBJECT_SYMBOLS |
---|
83 | *(.text*) |
---|
84 | |
---|
85 | /* |
---|
86 | * C++ constructors/destructors |
---|
87 | */ |
---|
88 | *(.gnu.linkonce.t.*) |
---|
89 | |
---|
90 | /* |
---|
91 | * Initialization and finalization code. |
---|
92 | */ |
---|
93 | . = ALIGN (16); |
---|
94 | PROVIDE (_init = .); |
---|
95 | *crti.o(.init) |
---|
96 | *(.init) |
---|
97 | *crtn.o(.init) |
---|
98 | . = ALIGN (16); |
---|
99 | PROVIDE (_fini = .); |
---|
100 | *crti.o(.fini) |
---|
101 | *(.fini) |
---|
102 | *crtn.o(.fini) |
---|
103 | |
---|
104 | /* |
---|
105 | * Special FreeBSD sysctl sections. |
---|
106 | */ |
---|
107 | . = ALIGN (16); |
---|
108 | __start_set_sysctl_set = .; |
---|
109 | *(set_sysctl_*); |
---|
110 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
111 | *(set_domain_*); |
---|
112 | *(set_pseudo_*); |
---|
113 | |
---|
114 | /* |
---|
115 | * C++ constructors/destructors |
---|
116 | */ |
---|
117 | . = ALIGN (16); |
---|
118 | *crtbegin.o(.ctors) |
---|
119 | *(.ctors) |
---|
120 | *crtend.o(.ctors) |
---|
121 | *crtbegin.o(.dtors) |
---|
122 | *(.dtors) |
---|
123 | *crtend.o(.dtors) |
---|
124 | |
---|
125 | /* |
---|
126 | * Exception frame info |
---|
127 | */ |
---|
128 | . = ALIGN (16); |
---|
129 | *(.eh_frame) |
---|
130 | |
---|
131 | /* |
---|
132 | * Read-only data |
---|
133 | */ |
---|
134 | . = ALIGN (16); |
---|
135 | _rodata_start = .; |
---|
136 | *(.rodata*) |
---|
137 | KEEP (*(SORT(.rtemsroset.*))) |
---|
138 | *(.gnu.linkonce.r*) |
---|
139 | |
---|
140 | . = ALIGN (16); |
---|
141 | PROVIDE (etext = .); |
---|
142 | |
---|
143 | } > ram |
---|
144 | |
---|
145 | .tdata : { |
---|
146 | _TLS_Data_begin = .; |
---|
147 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
148 | _TLS_Data_end = .; |
---|
149 | } >ram |
---|
150 | |
---|
151 | .tbss : { |
---|
152 | _TLS_BSS_begin = .; |
---|
153 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
154 | _TLS_BSS_end = .; |
---|
155 | } >ram |
---|
156 | |
---|
157 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
158 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
159 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
160 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
161 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
162 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
163 | |
---|
164 | .data BLOCK (0x4) : { |
---|
165 | copy_start = .; |
---|
166 | *(.shdata) |
---|
167 | . = ALIGN (0x10); |
---|
168 | *(.data*) |
---|
169 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
170 | . = ALIGN (0x10); |
---|
171 | *(.gcc_exc) |
---|
172 | *(.gcc_except_table*) |
---|
173 | *(.jcr) |
---|
174 | . = ALIGN (0x10); |
---|
175 | *(.gnu.linkonce.d*) |
---|
176 | . = ALIGN (0x10); |
---|
177 | _edata = .; |
---|
178 | copy_end = .; |
---|
179 | } > ram |
---|
180 | |
---|
181 | .bss BLOCK (0x4) : |
---|
182 | { |
---|
183 | clear_start = . ; |
---|
184 | *(.shbss) |
---|
185 | *(.dynbss) |
---|
186 | *(.bss* .gnu.linkonce.b.*) |
---|
187 | *(COMMON) |
---|
188 | . = ALIGN(0x10); |
---|
189 | _end = .; |
---|
190 | |
---|
191 | clear_end = .; |
---|
192 | } > ram |
---|
193 | |
---|
194 | .noinit (NOLOAD) : { |
---|
195 | *(.noinit*) |
---|
196 | } >ram |
---|
197 | |
---|
198 | .rtemsstack (NOLOAD) : { |
---|
199 | *(SORT(.rtemsstack.*)) |
---|
200 | WorkAreaBase = .; |
---|
201 | } > ram |
---|
202 | |
---|
203 | .stab 0 (NOLOAD) : |
---|
204 | { |
---|
205 | *(.stab) |
---|
206 | } |
---|
207 | |
---|
208 | .stabstr 0 (NOLOAD) : |
---|
209 | { |
---|
210 | *(.stabstr) |
---|
211 | } |
---|
212 | |
---|
213 | } |
---|