1 |
27 |
unneback |
//===========================================================================
|
2 |
|
|
//
|
3 |
|
|
// MLT linker script for MIPS TX49
|
4 |
|
|
//
|
5 |
|
|
//===========================================================================
|
6 |
|
|
//####ECOSGPLCOPYRIGHTBEGIN####
|
7 |
|
|
// -------------------------------------------
|
8 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
9 |
|
|
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
|
10 |
|
|
//
|
11 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
12 |
|
|
// the terms of the GNU General Public License as published by the Free
|
13 |
|
|
// Software Foundation; either version 2 or (at your option) any later version.
|
14 |
|
|
//
|
15 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
|
16 |
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
17 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
18 |
|
|
// for more details.
|
19 |
|
|
//
|
20 |
|
|
// You should have received a copy of the GNU General Public License along
|
21 |
|
|
// with eCos; if not, write to the Free Software Foundation, Inc.,
|
22 |
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
23 |
|
|
//
|
24 |
|
|
// As a special exception, if other files instantiate templates or use macros
|
25 |
|
|
// or inline functions from this file, or you compile this file and link it
|
26 |
|
|
// with other works to produce a work based on this file, this file does not
|
27 |
|
|
// by itself cause the resulting work to be covered by the GNU General Public
|
28 |
|
|
// License. However the source code for this file must still be made available
|
29 |
|
|
// in accordance with section (3) of the GNU General Public License.
|
30 |
|
|
//
|
31 |
|
|
// This exception does not invalidate any other reasons why a work based on
|
32 |
|
|
// this file might be covered by the GNU General Public License.
|
33 |
|
|
//
|
34 |
|
|
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
35 |
|
|
// at http://sources.redhat.com/ecos/ecos-license/
|
36 |
|
|
// -------------------------------------------
|
37 |
|
|
//####ECOSGPLCOPYRIGHTEND####
|
38 |
|
|
//===========================================================================
|
39 |
|
|
|
40 |
|
|
#include
|
41 |
|
|
|
42 |
|
|
OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips",
|
43 |
|
|
"elf32-littlemips")
|
44 |
|
|
/* The preprocessor defines mips, but we know we're mips :-) */
|
45 |
|
|
#undef mips
|
46 |
|
|
OUTPUT_ARCH(mips:4900)
|
47 |
|
|
|
48 |
|
|
STARTUP(vectors.o)
|
49 |
|
|
ENTRY(reset_vector)
|
50 |
|
|
#if defined(EXTRAS) && defined(CYGPKG_IO)
|
51 |
|
|
INPUT(extras.o)
|
52 |
|
|
#endif
|
53 |
|
|
#if (__GNUC__ >= 3)
|
54 |
|
|
GROUP(libtarget.a libgcc.a libsupc++.a)
|
55 |
|
|
#else
|
56 |
|
|
GROUP(libtarget.a libgcc.a)
|
57 |
|
|
#endif
|
58 |
|
|
|
59 |
|
|
/* FIXME: The MLT should pass in the required alignment since it must be
|
60 |
|
|
* the same as the VMA's alignment. As a result of this bug, all the REF4955
|
61 |
|
|
* ROM mlt files have alignment 8, when some should have alignment 4
|
62 |
|
|
* (902557-CR)
|
63 |
|
|
*/
|
64 |
|
|
#define ALIGN_LMA 8
|
65 |
|
|
#define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
|
66 |
|
|
#define LMA_EQ_VMA
|
67 |
|
|
#define FORCE_OUTPUT . = .
|
68 |
|
|
|
69 |
|
|
#define SECTIONS_BEGIN
|
70 |
|
|
|
71 |
|
|
#if defined(CYG_HAL_STARTUP_RAM)
|
72 |
|
|
|
73 |
|
|
/* this version for RAM startup */
|
74 |
|
|
#define SECTION_rom_vectors(_region_, _vma_, _lma_) \
|
75 |
|
|
.rom_vectors _vma_ : _lma_ \
|
76 |
|
|
{ KEEP (*(.utlb_vector)) \
|
77 |
|
|
. = ALIGN(0x80); KEEP(*(.other_vector)) \
|
78 |
|
|
/* debug and reset vector not used in RAM version */ \
|
79 |
|
|
KEEP(*(.debug_vector)) \
|
80 |
|
|
KEEP (*(.reset_vector)) } \
|
81 |
|
|
> _region_
|
82 |
|
|
|
83 |
|
|
#elif defined(CYG_HAL_STARTUP_ROM)
|
84 |
|
|
|
85 |
|
|
/* this version for ROM startup */
|
86 |
|
|
#define SECTION_rom_vectors(_region_, _vma_, _lma_) \
|
87 |
|
|
.rom_vectors _vma_ : _lma_ \
|
88 |
|
|
{ KEEP (*(.reset_vector)) \
|
89 |
|
|
. = ALIGN(0x100); KEEP (*(.utlb_vector)) \
|
90 |
|
|
. = ALIGN(0x80); KEEP(*(.other_vector)) \
|
91 |
|
|
. = ALIGN(0x100); KEEP(*(.debug_vector)) } \
|
92 |
|
|
> _region_
|
93 |
|
|
|
94 |
|
|
#endif /* ROM startup version of ROM vectors */
|
95 |
|
|
|
96 |
|
|
#define SECTION_ROMISC(_region_, _vma_, _lma_) \
|
97 |
|
|
.interp _vma_ : _lma_ { *(.interp) } > _region_ \
|
98 |
|
|
.hash : FOLLOWING(.interp) { *(.hash) } > _region_ \
|
99 |
|
|
.dynsym : FOLLOWING(.hash) { *(.dynsym) } > _region_ \
|
100 |
|
|
.dynstr : FOLLOWING(.dynsym) { *(.dynstr) } > _region_ \
|
101 |
|
|
.gnu.version : FOLLOWING(.dynstr) { *(.gnu.version) } > _region_ \
|
102 |
|
|
.gnu.version_d : FOLLOWING(.gnu.version) { *(.gnu.version_d) } > _region_ \
|
103 |
|
|
.gnu.version_r : FOLLOWING(.gnu.version_d) { *(.gnu.version_r) } > _region_ \
|
104 |
|
|
.plt : FOLLOWING(.gnu.version_r) { *(.plt) } > _region_
|
105 |
|
|
|
106 |
|
|
#define SECTION_RELOCS(_region_, _vma_, _lma_) \
|
107 |
|
|
.rel.text : \
|
108 |
|
|
{ \
|
109 |
|
|
*(.rel.text) \
|
110 |
|
|
*(.rel.text.*) \
|
111 |
|
|
*(.rel.gnu.linkonce.t*) \
|
112 |
|
|
} > _region_ \
|
113 |
|
|
.rela.text : \
|
114 |
|
|
{ \
|
115 |
|
|
*(.rela.text) \
|
116 |
|
|
*(.rela.text.*) \
|
117 |
|
|
*(.rela.gnu.linkonce.t*) \
|
118 |
|
|
} > _region_ \
|
119 |
|
|
.rel.data : \
|
120 |
|
|
{ \
|
121 |
|
|
*(.rel.data) \
|
122 |
|
|
*(.rel.data.*) \
|
123 |
|
|
*(.rel.gnu.linkonce.d*) \
|
124 |
|
|
} > _region_ \
|
125 |
|
|
.rela.data : \
|
126 |
|
|
{ \
|
127 |
|
|
*(.rela.data) \
|
128 |
|
|
*(.rela.data.*) \
|
129 |
|
|
*(.rela.gnu.linkonce.d*) \
|
130 |
|
|
} > _region_ \
|
131 |
|
|
.rel.rodata : \
|
132 |
|
|
{ \
|
133 |
|
|
*(.rel.rodata) \
|
134 |
|
|
*(.rel.rodata.*) \
|
135 |
|
|
*(.rel.gnu.linkonce.r*) \
|
136 |
|
|
} > _region_ \
|
137 |
|
|
.rela.rodata : \
|
138 |
|
|
{ \
|
139 |
|
|
*(.rela.rodata) \
|
140 |
|
|
*(.rela.rodata.*) \
|
141 |
|
|
*(.rela.gnu.linkonce.r*) \
|
142 |
|
|
} > _region_ \
|
143 |
|
|
.rel.got : { *(.rel.got) } > _region_ \
|
144 |
|
|
.rela.got : { *(.rela.got) } > _region_ \
|
145 |
|
|
.rel.ctors : { *(.rel.ctors) } > _region_ \
|
146 |
|
|
.rela.ctors : { *(.rela.ctors) } > _region_ \
|
147 |
|
|
.rel.dtors : { *(.rel.dtors) } > _region_ \
|
148 |
|
|
.rela.dtors : { *(.rela.dtors) } > _region_ \
|
149 |
|
|
.rel.init : { *(.rel.init) } > _region_ \
|
150 |
|
|
.rela.init : { *(.rela.init) } > _region_ \
|
151 |
|
|
.rel.fini : { *(.rel.fini) } > _region_ \
|
152 |
|
|
.rela.fini : { *(.rela.fini) } > _region_ \
|
153 |
|
|
.rel.bss : { *(.rel.bss) } > _region_ \
|
154 |
|
|
.rela.bss : { *(.rela.bss) } > _region_ \
|
155 |
|
|
.rel.plt : { *(.rel.plt) } > _region_ \
|
156 |
|
|
.rela.plt : { *(.rela.plt) } > _region_ \
|
157 |
|
|
.rel.dyn : { *(.rel.dyn) } > _region_
|
158 |
|
|
|
159 |
|
|
#define SECTION_init(_region_, _vma_, _lma_) \
|
160 |
|
|
.init _vma_ : _lma_ \
|
161 |
|
|
{ \
|
162 |
|
|
FORCE_OUTPUT; KEEP (*(.init)) \
|
163 |
|
|
} > _region_ =0
|
164 |
|
|
|
165 |
|
|
#define SECTION_text(_region_, _vma_, _lma_) \
|
166 |
|
|
.text _vma_ : _lma_ \
|
167 |
|
|
{ \
|
168 |
|
|
_stext = .; _ftext = . ; \
|
169 |
|
|
*(.text) \
|
170 |
|
|
*(.text.*) \
|
171 |
|
|
*(.stub) \
|
172 |
|
|
*(.gnu.warning) \
|
173 |
|
|
*(.gnu.linkonce.t*) \
|
174 |
|
|
*(.mips16.fn.*) *(.mips16.call.*) \
|
175 |
|
|
} > _region_ =0 \
|
176 |
|
|
_etext = .; PROVIDE (etext = .);
|
177 |
|
|
|
178 |
|
|
#define SECTION_fini(_region_, _vma_, _lma_) \
|
179 |
|
|
.fini _vma_ : _lma_ \
|
180 |
|
|
{ \
|
181 |
|
|
FORCE_OUTPUT; KEEP (*(.fini)) \
|
182 |
|
|
} > _region_ =0
|
183 |
|
|
|
184 |
|
|
#define SECTION_rodata(_region_, _vma_, _lma_) \
|
185 |
|
|
.rodata _vma_ : _lma_ \
|
186 |
|
|
{ \
|
187 |
|
|
FORCE_OUTPUT; *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) \
|
188 |
|
|
} > _region_
|
189 |
|
|
|
190 |
|
|
#define SECTION_rodata1(_region_, _vma_, _lma_) \
|
191 |
|
|
.rodata1 _vma_ : _lma_ \
|
192 |
|
|
{ \
|
193 |
|
|
FORCE_OUTPUT; *(.rodata1) *(.rodata1.*) \
|
194 |
|
|
} > _region_
|
195 |
|
|
|
196 |
|
|
#define SECTION_vsr_table(_region_, _vma_, _lma_) \
|
197 |
|
|
.vsr_table _vma_ : _lma_ \
|
198 |
|
|
{ \
|
199 |
|
|
FORCE_OUTPUT; *(.vsr_table) \
|
200 |
|
|
} > _region_
|
201 |
|
|
|
202 |
|
|
#define SECTION_data(_region_, _vma_, _lma_) \
|
203 |
|
|
.data _vma_ : _lma_ \
|
204 |
|
|
{ \
|
205 |
|
|
__ram_data_start = ABSOLUTE (.); _fdata = . ; \
|
206 |
|
|
*(.data) *(.data.*) *(.gnu.linkonce.d*) \
|
207 |
|
|
. = ALIGN (8); \
|
208 |
|
|
SORT(CONSTRUCTORS) \
|
209 |
|
|
} > _region_ \
|
210 |
|
|
__rom_data_start = LOADADDR(.data);
|
211 |
|
|
|
212 |
|
|
#define SECTION_data1(_region_, _vma_, _lma_) \
|
213 |
|
|
.data1 _vma_ : _lma_ \
|
214 |
|
|
{ \
|
215 |
|
|
FORCE_OUTPUT; *(.data1) *(.data1.*) \
|
216 |
|
|
} > _region_
|
217 |
|
|
|
218 |
|
|
#define SECTION_eh_frame(_region_, _vma_, _lma_) \
|
219 |
|
|
.eh_frame _vma_ : _lma_ \
|
220 |
|
|
{ \
|
221 |
|
|
FORCE_OUTPUT; *(.eh_frame) \
|
222 |
|
|
} > _region_
|
223 |
|
|
|
224 |
|
|
#define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
|
225 |
|
|
.gcc_except_table _vma_ : _lma_ \
|
226 |
|
|
{ \
|
227 |
|
|
FORCE_OUTPUT; *(.gcc_except_table) \
|
228 |
|
|
} > _region_
|
229 |
|
|
|
230 |
|
|
|
231 |
|
|
/* FIXME: We shouldn't need to define __CTOR_LIST__/__CTOR_END__
|
232 |
|
|
and __DTOR_LIST__/__DTOR_END__ except by the PROVIDE lines.
|
233 |
|
|
However this doesn't work for old (99r1-era) toolchains, so
|
234 |
|
|
leave it for now. */
|
235 |
|
|
|
236 |
|
|
/* The KEEP(*_ctors.o(.ctors)) rule is included to prevent
|
237 |
|
|
constructors from libgcc.a from turning up in the image.
|
238 |
|
|
They are NULL anyway. */
|
239 |
|
|
|
240 |
|
|
#define SECTION_ctors(_region_, _vma_, _lma_) \
|
241 |
|
|
.ctors _vma_ : _lma_ \
|
242 |
|
|
{ \
|
243 |
|
|
FORCE_OUTPUT; \
|
244 |
|
|
KEEP (*crtbegin.o(.ctors)) \
|
245 |
|
|
KEEP (*_ctors.o(.ctors)) \
|
246 |
|
|
__CTOR_LIST__ = .; \
|
247 |
|
|
PROVIDE (__CTOR_LIST__ = .); \
|
248 |
|
|
KEEP (*(.ctors)); \
|
249 |
|
|
KEEP (*(SORT(.ctors.*))) \
|
250 |
|
|
__CTOR_END__ = .; \
|
251 |
|
|
PROVIDE (__CTOR_END__ = .); \
|
252 |
|
|
} > _region_
|
253 |
|
|
|
254 |
|
|
#define SECTION_dtors(_region_, _vma_, _lma_) \
|
255 |
|
|
.dtors _vma_ : _lma_ \
|
256 |
|
|
{ \
|
257 |
|
|
FORCE_OUTPUT; \
|
258 |
|
|
KEEP (*crtbegin.o(.dtors)) \
|
259 |
|
|
__DTOR_LIST__ = .; \
|
260 |
|
|
PROVIDE (__DTOR_LIST__ = .); \
|
261 |
|
|
KEEP (*(SORT(.dtors.*))) \
|
262 |
|
|
__DTOR_END__ = .; \
|
263 |
|
|
KEEP (*(.dtors)); \
|
264 |
|
|
PROVIDE (__DTOR_END__ = .); \
|
265 |
|
|
} > _region_
|
266 |
|
|
|
267 |
|
|
#define SECTION_devtab(_region_, _vma_, _lma_) \
|
268 |
|
|
.devtab _vma_ : _lma_ \
|
269 |
|
|
{ \
|
270 |
|
|
FORCE_OUTPUT; \
|
271 |
|
|
KEEP(*( SORT (.ecos.table.*))) ; \
|
272 |
|
|
} > _region_
|
273 |
|
|
|
274 |
|
|
#define SECTION_got(_region_, _vma_, _lma_) \
|
275 |
|
|
_gp = ALIGN(16) + 0x7ff0; \
|
276 |
|
|
.got _vma_ : _lma_ \
|
277 |
|
|
{ \
|
278 |
|
|
FORCE_OUTPUT; *(.got.plt) *(.got) \
|
279 |
|
|
} > _region_
|
280 |
|
|
|
281 |
|
|
#define SECTION_dynamic(_region_, _vma_, _lma_) \
|
282 |
|
|
.dynamic _vma_ : _lma_ \
|
283 |
|
|
{ \
|
284 |
|
|
FORCE_OUTPUT; *(.dynamic) \
|
285 |
|
|
} > _region_
|
286 |
|
|
|
287 |
|
|
/* We want the small data sections together, so single-instruction offsets
|
288 |
|
|
can access them all, and initialized data all before uninitialized, so
|
289 |
|
|
we can shorten the on-disk segment size. */
|
290 |
|
|
|
291 |
|
|
#define SECTION_sdata(_region_, _vma_, _lma_) \
|
292 |
|
|
.sdata _vma_ : _lma_ \
|
293 |
|
|
{ \
|
294 |
|
|
FORCE_OUTPUT; *(.sdata) *(.sdata.*) *(.gnu.linkonce.s*) \
|
295 |
|
|
} > _region_
|
296 |
|
|
|
297 |
|
|
#define SECTION_lit8(_region_, _vma_, _lma_) \
|
298 |
|
|
.lit8 _vma_ : _lma_ \
|
299 |
|
|
{ \
|
300 |
|
|
FORCE_OUTPUT; *(.lit8) \
|
301 |
|
|
} > _region_
|
302 |
|
|
|
303 |
|
|
#define SECTION_lit4(_region_, _vma_, _lma_) \
|
304 |
|
|
.lit4 : FOLLOWING(.lit8) \
|
305 |
|
|
{ \
|
306 |
|
|
FORCE_OUTPUT; *(.lit4) \
|
307 |
|
|
} > _region_ \
|
308 |
|
|
__ram_data_end = .; _edata = . ; \
|
309 |
|
|
PROVIDE (edata = .);
|
310 |
|
|
|
311 |
|
|
#define SECTION_sbss(_region_, _vma_, _lma_) \
|
312 |
|
|
__bss_start = .; _fbss = .; \
|
313 |
|
|
.sbss _vma_ : _lma_ \
|
314 |
|
|
{ \
|
315 |
|
|
FORCE_OUTPUT; *(.dynsbss) *(.sbss) *(.sbss.*) *(.scommon) \
|
316 |
|
|
} > _region_
|
317 |
|
|
|
318 |
|
|
#define SECTION_bss(_region_, _vma_, _lma_) \
|
319 |
|
|
.bss _vma_ : _lma_ \
|
320 |
|
|
{ \
|
321 |
|
|
*(.dynbss) *(.bss) *(.bss.*) *(COMMON) \
|
322 |
|
|
} > _region_ \
|
323 |
|
|
__bss_end = .;
|
324 |
|
|
|
325 |
|
|
/* The /DISCARD/ section ensures that the output will not contain a
|
326 |
|
|
* .mdebug section as it confuses GDB. This is a workaround for CR 100804.
|
327 |
|
|
*/
|
328 |
|
|
|
329 |
|
|
#define SECTIONS_END . = ALIGN(4); _end = .; PROVIDE (end = .); \
|
330 |
|
|
/* Stabs debugging sections. */ \
|
331 |
|
|
.stab 0 : { *(.stab) } \
|
332 |
|
|
.stabstr 0 : { *(.stabstr) } \
|
333 |
|
|
.stab.excl 0 : { *(.stab.excl) } \
|
334 |
|
|
.stab.exclstr 0 : { *(.stab.exclstr) } \
|
335 |
|
|
.stab.index 0 : { *(.stab.index) } \
|
336 |
|
|
.stab.indexstr 0 : { *(.stab.indexstr) } \
|
337 |
|
|
.comment 0 : { *(.comment) } \
|
338 |
|
|
/* DWARF debug sections. \
|
339 |
|
|
Symbols in the DWARF debugging sections are relative to \
|
340 |
|
|
the beginning of the section so we begin them at 0. */ \
|
341 |
|
|
/* DWARF 1 */ \
|
342 |
|
|
.debug 0 : { *(.debug) } \
|
343 |
|
|
.line 0 : { *(.line) } \
|
344 |
|
|
/* GNU DWARF 1 extensions */ \
|
345 |
|
|
.debug_srcinfo 0 : { *(.debug_srcinfo) } \
|
346 |
|
|
.debug_sfnames 0 : { *(.debug_sfnames) } \
|
347 |
|
|
/* DWARF 1.1 and DWARF 2 */ \
|
348 |
|
|
.debug_aranges 0 : { *(.debug_aranges) } \
|
349 |
|
|
.debug_pubnames 0 : { *(.debug_pubnames) } \
|
350 |
|
|
/* DWARF 2 */ \
|
351 |
|
|
.debug_info 0 : { *(.debug_info) } \
|
352 |
|
|
.debug_abbrev 0 : { *(.debug_abbrev) } \
|
353 |
|
|
.debug_line 0 : { *(.debug_line) } \
|
354 |
|
|
.debug_frame 0 : { *(.debug_frame) } \
|
355 |
|
|
.debug_str 0 : { *(.debug_str) } \
|
356 |
|
|
.debug_loc 0 : { *(.debug_loc) } \
|
357 |
|
|
.debug_macinfo 0 : { *(.debug_macinfo) } \
|
358 |
|
|
/* SGI/MIPS DWARF 2 extensions */ \
|
359 |
|
|
.debug_weaknames 0 : { *(.debug_weaknames) } \
|
360 |
|
|
.debug_funcnames 0 : { *(.debug_funcnames) } \
|
361 |
|
|
.debug_typenames 0 : { *(.debug_typenames) } \
|
362 |
|
|
.debug_varnames 0 : { *(.debug_varnames) } \
|
363 |
|
|
/* These must appear regardless of . */ \
|
364 |
|
|
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } \
|
365 |
|
|
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } \
|
366 |
|
|
/DISCARD/ 0 : { *(.mdebug) }
|
367 |
|
|
|
368 |
|
|
#include CYGHWR_MEMORY_LAYOUT_LDI
|
369 |
|
|
|
370 |
|
|
// 0-0x200 reserved for vectors
|
371 |
|
|
hal_vsr_table = 0x80000200;
|
372 |
|
|
hal_virtual_vector_table = 0x80000300;
|