1 |
8 |
alfik |
/*
|
2 |
|
|
* linker.x - Linker script
|
3 |
|
|
*
|
4 |
|
|
* Machine generated for CPU 'nios2_qsys_0' in SOPC Builder design 'system'
|
5 |
|
|
* SOPC Builder design path: ../../system.sopcinfo
|
6 |
|
|
*
|
7 |
|
|
* Generated: Sat Aug 16 22:39:53 CEST 2014
|
8 |
|
|
*/
|
9 |
|
|
|
10 |
|
|
/*
|
11 |
|
|
* DO NOT MODIFY THIS FILE
|
12 |
|
|
*
|
13 |
|
|
* Changing this file will have subtle consequences
|
14 |
|
|
* which will almost certainly lead to a nonfunctioning
|
15 |
|
|
* system. If you do modify this file, be aware that your
|
16 |
|
|
* changes will be overwritten and lost when this file
|
17 |
|
|
* is generated again.
|
18 |
|
|
*
|
19 |
|
|
* DO NOT MODIFY THIS FILE
|
20 |
|
|
*/
|
21 |
|
|
|
22 |
|
|
/*
|
23 |
|
|
* License Agreement
|
24 |
|
|
*
|
25 |
|
|
* Copyright (c) 2008
|
26 |
|
|
* Altera Corporation, San Jose, California, USA.
|
27 |
|
|
* All rights reserved.
|
28 |
|
|
*
|
29 |
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
30 |
|
|
* copy of this software and associated documentation files (the "Software"),
|
31 |
|
|
* to deal in the Software without restriction, including without limitation
|
32 |
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
33 |
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
34 |
|
|
* Software is furnished to do so, subject to the following conditions:
|
35 |
|
|
*
|
36 |
|
|
* The above copyright notice and this permission notice shall be included in
|
37 |
|
|
* all copies or substantial portions of the Software.
|
38 |
|
|
*
|
39 |
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
40 |
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
41 |
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
42 |
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
43 |
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
44 |
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
45 |
|
|
* DEALINGS IN THE SOFTWARE.
|
46 |
|
|
*
|
47 |
|
|
* This agreement shall be governed in all respects by the laws of the State
|
48 |
|
|
* of California and by the laws of the United States of America.
|
49 |
|
|
*/
|
50 |
|
|
|
51 |
|
|
MEMORY
|
52 |
|
|
{
|
53 |
|
|
sdram : ORIGIN = 0x0, LENGTH = 134217728
|
54 |
|
|
reset : ORIGIN = 0x8008000, LENGTH = 32
|
55 |
|
|
onchip_memory2_0 : ORIGIN = 0x8008020, LENGTH = 32736
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
/* Define symbols for each memory base-address */
|
59 |
|
|
__alt_mem_sdram = 0x0;
|
60 |
|
|
__alt_mem_onchip_memory2_0 = 0x8008000;
|
61 |
|
|
|
62 |
|
|
OUTPUT_FORMAT( "elf32-littlenios2",
|
63 |
|
|
"elf32-littlenios2",
|
64 |
|
|
"elf32-littlenios2" )
|
65 |
|
|
OUTPUT_ARCH( nios2 )
|
66 |
|
|
ENTRY( _start )
|
67 |
|
|
|
68 |
|
|
/*
|
69 |
|
|
* The alt_load() facility is disabled. This typically happens when an
|
70 |
|
|
* external bootloader is provided or the application runs in place.
|
71 |
|
|
* The LMA (aka physical address) of each section defaults to its VMA.
|
72 |
|
|
*/
|
73 |
|
|
|
74 |
|
|
SECTIONS
|
75 |
|
|
{
|
76 |
|
|
|
77 |
|
|
/*
|
78 |
|
|
* Output sections associated with reset and exceptions (they have to be first)
|
79 |
|
|
*/
|
80 |
|
|
|
81 |
|
|
.entry :
|
82 |
|
|
{
|
83 |
|
|
KEEP (*(.entry))
|
84 |
|
|
} > reset
|
85 |
|
|
|
86 |
|
|
.exceptions :
|
87 |
|
|
{
|
88 |
|
|
PROVIDE (__ram_exceptions_start = ABSOLUTE(.));
|
89 |
|
|
. = ALIGN(0x20);
|
90 |
|
|
KEEP (*(.irq));
|
91 |
|
|
KEEP (*(.exceptions.entry.label));
|
92 |
|
|
KEEP (*(.exceptions.entry.user));
|
93 |
|
|
KEEP (*(.exceptions.entry.ecc_fatal));
|
94 |
|
|
KEEP (*(.exceptions.entry));
|
95 |
|
|
KEEP (*(.exceptions.irqtest.user));
|
96 |
|
|
KEEP (*(.exceptions.irqtest));
|
97 |
|
|
KEEP (*(.exceptions.irqhandler.user));
|
98 |
|
|
KEEP (*(.exceptions.irqhandler));
|
99 |
|
|
KEEP (*(.exceptions.irqreturn.user));
|
100 |
|
|
KEEP (*(.exceptions.irqreturn));
|
101 |
|
|
KEEP (*(.exceptions.notirq.label));
|
102 |
|
|
KEEP (*(.exceptions.notirq.user));
|
103 |
|
|
KEEP (*(.exceptions.notirq));
|
104 |
|
|
KEEP (*(.exceptions.soft.user));
|
105 |
|
|
KEEP (*(.exceptions.soft));
|
106 |
|
|
KEEP (*(.exceptions.unknown.user));
|
107 |
|
|
KEEP (*(.exceptions.unknown));
|
108 |
|
|
KEEP (*(.exceptions.exit.label));
|
109 |
|
|
KEEP (*(.exceptions.exit.user));
|
110 |
|
|
KEEP (*(.exceptions.exit));
|
111 |
|
|
KEEP (*(.exceptions));
|
112 |
|
|
PROVIDE (__ram_exceptions_end = ABSOLUTE(.));
|
113 |
|
|
} > onchip_memory2_0
|
114 |
|
|
|
115 |
|
|
PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions));
|
116 |
|
|
|
117 |
|
|
.text :
|
118 |
|
|
{
|
119 |
|
|
/*
|
120 |
|
|
* All code sections are merged into the text output section, along with
|
121 |
|
|
* the read only data sections.
|
122 |
|
|
*
|
123 |
|
|
*/
|
124 |
|
|
|
125 |
|
|
PROVIDE (stext = ABSOLUTE(.));
|
126 |
|
|
|
127 |
|
|
*(.interp)
|
128 |
|
|
*(.hash)
|
129 |
|
|
*(.dynsym)
|
130 |
|
|
*(.dynstr)
|
131 |
|
|
*(.gnu.version)
|
132 |
|
|
*(.gnu.version_d)
|
133 |
|
|
*(.gnu.version_r)
|
134 |
|
|
*(.rel.init)
|
135 |
|
|
*(.rela.init)
|
136 |
|
|
*(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
|
137 |
|
|
*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
|
138 |
|
|
*(.rel.fini)
|
139 |
|
|
*(.rela.fini)
|
140 |
|
|
*(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
|
141 |
|
|
*(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
|
142 |
|
|
*(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
|
143 |
|
|
*(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
|
144 |
|
|
*(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
|
145 |
|
|
*(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
|
146 |
|
|
*(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
|
147 |
|
|
*(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
|
148 |
|
|
*(.rel.ctors)
|
149 |
|
|
*(.rela.ctors)
|
150 |
|
|
*(.rel.dtors)
|
151 |
|
|
*(.rela.dtors)
|
152 |
|
|
*(.rel.got)
|
153 |
|
|
*(.rela.got)
|
154 |
|
|
*(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
|
155 |
|
|
*(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
|
156 |
|
|
*(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
|
157 |
|
|
*(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
|
158 |
|
|
*(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
|
159 |
|
|
*(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
|
160 |
|
|
*(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
|
161 |
|
|
*(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
|
162 |
|
|
*(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
|
163 |
|
|
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
|
164 |
|
|
*(.rel.plt)
|
165 |
|
|
*(.rela.plt)
|
166 |
|
|
*(.rel.dyn)
|
167 |
|
|
|
168 |
|
|
KEEP (*(.init))
|
169 |
|
|
*(.plt)
|
170 |
|
|
*(.text .stub .text.* .gnu.linkonce.t.*)
|
171 |
|
|
|
172 |
|
|
/* .gnu.warning sections are handled specially by elf32.em. */
|
173 |
|
|
|
174 |
|
|
*(.gnu.warning.*)
|
175 |
|
|
KEEP (*(.fini))
|
176 |
|
|
PROVIDE (__etext = ABSOLUTE(.));
|
177 |
|
|
PROVIDE (_etext = ABSOLUTE(.));
|
178 |
|
|
PROVIDE (etext = ABSOLUTE(.));
|
179 |
|
|
|
180 |
|
|
*(.eh_frame_hdr)
|
181 |
|
|
/* Ensure the __preinit_array_start label is properly aligned. We
|
182 |
|
|
could instead move the label definition inside the section, but
|
183 |
|
|
the linker would then create the section even if it turns out to
|
184 |
|
|
be empty, which isn't pretty. */
|
185 |
|
|
. = ALIGN(4);
|
186 |
|
|
PROVIDE (__preinit_array_start = ABSOLUTE(.));
|
187 |
|
|
*(.preinit_array)
|
188 |
|
|
PROVIDE (__preinit_array_end = ABSOLUTE(.));
|
189 |
|
|
PROVIDE (__init_array_start = ABSOLUTE(.));
|
190 |
|
|
*(.init_array)
|
191 |
|
|
PROVIDE (__init_array_end = ABSOLUTE(.));
|
192 |
|
|
PROVIDE (__fini_array_start = ABSOLUTE(.));
|
193 |
|
|
*(.fini_array)
|
194 |
|
|
PROVIDE (__fini_array_end = ABSOLUTE(.));
|
195 |
|
|
SORT(CONSTRUCTORS)
|
196 |
|
|
KEEP (*(.eh_frame))
|
197 |
|
|
*(.gcc_except_table .gcc_except_table.*)
|
198 |
|
|
*(.dynamic)
|
199 |
|
|
PROVIDE (__CTOR_LIST__ = ABSOLUTE(.));
|
200 |
|
|
KEEP (*(.ctors))
|
201 |
|
|
KEEP (*(SORT(.ctors.*)))
|
202 |
|
|
PROVIDE (__CTOR_END__ = ABSOLUTE(.));
|
203 |
|
|
PROVIDE (__DTOR_LIST__ = ABSOLUTE(.));
|
204 |
|
|
KEEP (*(.dtors))
|
205 |
|
|
KEEP (*(SORT(.dtors.*)))
|
206 |
|
|
PROVIDE (__DTOR_END__ = ABSOLUTE(.));
|
207 |
|
|
KEEP (*(.jcr))
|
208 |
|
|
. = ALIGN(4);
|
209 |
|
|
} > onchip_memory2_0 = 0x3a880100 /* NOP instruction (always in big-endian byte ordering) */
|
210 |
|
|
|
211 |
|
|
.rodata :
|
212 |
|
|
{
|
213 |
|
|
PROVIDE (__ram_rodata_start = ABSOLUTE(.));
|
214 |
|
|
. = ALIGN(4);
|
215 |
|
|
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
216 |
|
|
*(.rodata1)
|
217 |
|
|
. = ALIGN(4);
|
218 |
|
|
PROVIDE (__ram_rodata_end = ABSOLUTE(.));
|
219 |
|
|
} > onchip_memory2_0
|
220 |
|
|
|
221 |
|
|
PROVIDE (__flash_rodata_start = LOADADDR(.rodata));
|
222 |
|
|
|
223 |
|
|
.rwdata :
|
224 |
|
|
{
|
225 |
|
|
PROVIDE (__ram_rwdata_start = ABSOLUTE(.));
|
226 |
|
|
. = ALIGN(4);
|
227 |
|
|
*(.got.plt) *(.got)
|
228 |
|
|
*(.data1)
|
229 |
|
|
*(.data .data.* .gnu.linkonce.d.*)
|
230 |
|
|
|
231 |
|
|
_gp = ABSOLUTE(. + 0x8000);
|
232 |
|
|
PROVIDE(gp = _gp);
|
233 |
|
|
|
234 |
|
|
*(.rwdata .rwdata.*)
|
235 |
|
|
*(.sdata .sdata.* .gnu.linkonce.s.*)
|
236 |
|
|
*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
|
237 |
|
|
|
238 |
|
|
. = ALIGN(4);
|
239 |
|
|
_edata = ABSOLUTE(.);
|
240 |
|
|
PROVIDE (edata = ABSOLUTE(.));
|
241 |
|
|
PROVIDE (__ram_rwdata_end = ABSOLUTE(.));
|
242 |
|
|
} > onchip_memory2_0
|
243 |
|
|
|
244 |
|
|
PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata));
|
245 |
|
|
|
246 |
|
|
.bss :
|
247 |
|
|
{
|
248 |
|
|
__bss_start = ABSOLUTE(.);
|
249 |
|
|
PROVIDE (__sbss_start = ABSOLUTE(.));
|
250 |
|
|
PROVIDE (___sbss_start = ABSOLUTE(.));
|
251 |
|
|
|
252 |
|
|
*(.dynsbss)
|
253 |
|
|
*(.sbss .sbss.* .gnu.linkonce.sb.*)
|
254 |
|
|
*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
|
255 |
|
|
*(.scommon)
|
256 |
|
|
|
257 |
|
|
PROVIDE (__sbss_end = ABSOLUTE(.));
|
258 |
|
|
PROVIDE (___sbss_end = ABSOLUTE(.));
|
259 |
|
|
|
260 |
|
|
*(.dynbss)
|
261 |
|
|
*(.bss .bss.* .gnu.linkonce.b.*)
|
262 |
|
|
*(COMMON)
|
263 |
|
|
|
264 |
|
|
. = ALIGN(4);
|
265 |
|
|
__bss_end = ABSOLUTE(.);
|
266 |
|
|
} > onchip_memory2_0
|
267 |
|
|
|
268 |
|
|
/*
|
269 |
|
|
*
|
270 |
|
|
* One output section mapped to the associated memory device for each of
|
271 |
|
|
* the available memory devices. These are not used by default, but can
|
272 |
|
|
* be used by user applications by using the .section directive.
|
273 |
|
|
*
|
274 |
|
|
* The output section used for the heap is treated in a special way,
|
275 |
|
|
* i.e. the symbols "end" and "_end" are added to point to the heap start.
|
276 |
|
|
*
|
277 |
|
|
*/
|
278 |
|
|
|
279 |
|
|
.sdram :
|
280 |
|
|
{
|
281 |
|
|
PROVIDE (_alt_partition_sdram_start = ABSOLUTE(.));
|
282 |
|
|
*(.sdram .sdram. sdram.*)
|
283 |
|
|
. = ALIGN(4);
|
284 |
|
|
PROVIDE (_alt_partition_sdram_end = ABSOLUTE(.));
|
285 |
|
|
} > sdram
|
286 |
|
|
|
287 |
|
|
PROVIDE (_alt_partition_sdram_load_addr = LOADADDR(.sdram));
|
288 |
|
|
|
289 |
|
|
.onchip_memory2_0 :
|
290 |
|
|
{
|
291 |
|
|
PROVIDE (_alt_partition_onchip_memory2_0_start = ABSOLUTE(.));
|
292 |
|
|
*(.onchip_memory2_0 .onchip_memory2_0. onchip_memory2_0.*)
|
293 |
|
|
. = ALIGN(4);
|
294 |
|
|
PROVIDE (_alt_partition_onchip_memory2_0_end = ABSOLUTE(.));
|
295 |
|
|
_end = ABSOLUTE(.);
|
296 |
|
|
end = ABSOLUTE(.);
|
297 |
|
|
__alt_stack_base = ABSOLUTE(.);
|
298 |
|
|
} > onchip_memory2_0
|
299 |
|
|
|
300 |
|
|
PROVIDE (_alt_partition_onchip_memory2_0_load_addr = LOADADDR(.onchip_memory2_0));
|
301 |
|
|
|
302 |
|
|
/*
|
303 |
|
|
* Stabs debugging sections.
|
304 |
|
|
*
|
305 |
|
|
*/
|
306 |
|
|
|
307 |
|
|
.stab 0 : { *(.stab) }
|
308 |
|
|
.stabstr 0 : { *(.stabstr) }
|
309 |
|
|
.stab.excl 0 : { *(.stab.excl) }
|
310 |
|
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
311 |
|
|
.stab.index 0 : { *(.stab.index) }
|
312 |
|
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
313 |
|
|
.comment 0 : { *(.comment) }
|
314 |
|
|
/* DWARF debug sections.
|
315 |
|
|
Symbols in the DWARF debugging sections are relative to the beginning
|
316 |
|
|
of the section so we begin them at 0. */
|
317 |
|
|
/* DWARF 1 */
|
318 |
|
|
.debug 0 : { *(.debug) }
|
319 |
|
|
.line 0 : { *(.line) }
|
320 |
|
|
/* GNU DWARF 1 extensions */
|
321 |
|
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
322 |
|
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
323 |
|
|
/* DWARF 1.1 and DWARF 2 */
|
324 |
|
|
.debug_aranges 0 : { *(.debug_aranges) }
|
325 |
|
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
326 |
|
|
/* DWARF 2 */
|
327 |
|
|
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
328 |
|
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
329 |
|
|
.debug_line 0 : { *(.debug_line) }
|
330 |
|
|
.debug_frame 0 : { *(.debug_frame) }
|
331 |
|
|
.debug_str 0 : { *(.debug_str) }
|
332 |
|
|
.debug_loc 0 : { *(.debug_loc) }
|
333 |
|
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
334 |
|
|
/* SGI/MIPS DWARF 2 extensions */
|
335 |
|
|
.debug_weaknames 0 : { *(.debug_weaknames) }
|
336 |
|
|
.debug_funcnames 0 : { *(.debug_funcnames) }
|
337 |
|
|
.debug_typenames 0 : { *(.debug_typenames) }
|
338 |
|
|
.debug_varnames 0 : { *(.debug_varnames) }
|
339 |
|
|
|
340 |
|
|
/* Altera debug extensions */
|
341 |
|
|
.debug_alt_sim_info 0 : { *(.debug_alt_sim_info) }
|
342 |
|
|
}
|
343 |
|
|
|
344 |
|
|
/* provide a pointer for the stack */
|
345 |
|
|
|
346 |
|
|
/*
|
347 |
|
|
* Don't override this, override the __alt_stack_* symbols instead.
|
348 |
|
|
*/
|
349 |
|
|
__alt_data_end = 0x8010000;
|
350 |
|
|
|
351 |
|
|
/*
|
352 |
|
|
* The next two symbols define the location of the default stack. You can
|
353 |
|
|
* override them to move the stack to a different memory.
|
354 |
|
|
*/
|
355 |
|
|
PROVIDE( __alt_stack_pointer = __alt_data_end );
|
356 |
|
|
PROVIDE( __alt_stack_limit = __alt_stack_base );
|
357 |
|
|
|
358 |
|
|
/*
|
359 |
|
|
* This symbol controls where the start of the heap is. If the stack is
|
360 |
|
|
* contiguous with the heap then the stack will contract as memory is
|
361 |
|
|
* allocated to the heap.
|
362 |
|
|
* Override this symbol to put the heap in a different memory.
|
363 |
|
|
*/
|
364 |
|
|
PROVIDE( __alt_heap_start = end );
|
365 |
|
|
PROVIDE( __alt_heap_limit = 0x8010000 );
|