| 1 |
2 |
alfik |
/*
|
| 2 |
|
|
* linker.x - Linker script
|
| 3 |
|
|
*
|
| 4 |
|
|
* Machine generated for CPU 'nios2_qsys_0' in SOPC Builder design 'soc'
|
| 5 |
|
|
* SOPC Builder design path: ../../soc.sopcinfo
|
| 6 |
|
|
*
|
| 7 |
|
|
* Generated: Sun Aug 18 12:33:10 CEST 2013
|
| 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 |
|
|
reset : ORIGIN = 0x8000, LENGTH = 32
|
| 54 |
|
|
onchip_memory2_0 : ORIGIN = 0x8020, LENGTH = 32736
|
| 55 |
|
|
}
|
| 56 |
|
|
|
| 57 |
|
|
/* Define symbols for each memory base-address */
|
| 58 |
|
|
__alt_mem_onchip_memory2_0 = 0x8000;
|
| 59 |
|
|
|
| 60 |
|
|
OUTPUT_FORMAT( "elf32-littlenios2",
|
| 61 |
|
|
"elf32-littlenios2",
|
| 62 |
|
|
"elf32-littlenios2" )
|
| 63 |
|
|
OUTPUT_ARCH( nios2 )
|
| 64 |
|
|
ENTRY( _start )
|
| 65 |
|
|
|
| 66 |
|
|
/*
|
| 67 |
|
|
* The alt_load() facility is disabled. This typically happens when an
|
| 68 |
|
|
* external bootloader is provided or the application runs in place.
|
| 69 |
|
|
* The LMA (aka physical address) of each section defaults to its VMA.
|
| 70 |
|
|
*/
|
| 71 |
|
|
|
| 72 |
|
|
SECTIONS
|
| 73 |
|
|
{
|
| 74 |
|
|
|
| 75 |
|
|
/*
|
| 76 |
|
|
* Output sections associated with reset and exceptions (they have to be first)
|
| 77 |
|
|
*/
|
| 78 |
|
|
|
| 79 |
|
|
.entry :
|
| 80 |
|
|
{
|
| 81 |
|
|
KEEP (*(.entry))
|
| 82 |
|
|
} > reset
|
| 83 |
|
|
|
| 84 |
|
|
.exceptions :
|
| 85 |
|
|
{
|
| 86 |
|
|
PROVIDE (__ram_exceptions_start = ABSOLUTE(.));
|
| 87 |
|
|
. = ALIGN(0x20);
|
| 88 |
|
|
KEEP (*(.irq));
|
| 89 |
|
|
KEEP (*(.exceptions.entry.label));
|
| 90 |
|
|
KEEP (*(.exceptions.entry.user));
|
| 91 |
|
|
KEEP (*(.exceptions.entry));
|
| 92 |
|
|
KEEP (*(.exceptions.irqtest.user));
|
| 93 |
|
|
KEEP (*(.exceptions.irqtest));
|
| 94 |
|
|
KEEP (*(.exceptions.irqhandler.user));
|
| 95 |
|
|
KEEP (*(.exceptions.irqhandler));
|
| 96 |
|
|
KEEP (*(.exceptions.irqreturn.user));
|
| 97 |
|
|
KEEP (*(.exceptions.irqreturn));
|
| 98 |
|
|
KEEP (*(.exceptions.notirq.label));
|
| 99 |
|
|
KEEP (*(.exceptions.notirq.user));
|
| 100 |
|
|
KEEP (*(.exceptions.notirq));
|
| 101 |
|
|
KEEP (*(.exceptions.soft.user));
|
| 102 |
|
|
KEEP (*(.exceptions.soft));
|
| 103 |
|
|
KEEP (*(.exceptions.unknown.user));
|
| 104 |
|
|
KEEP (*(.exceptions.unknown));
|
| 105 |
|
|
KEEP (*(.exceptions.exit.label));
|
| 106 |
|
|
KEEP (*(.exceptions.exit.user));
|
| 107 |
|
|
KEEP (*(.exceptions.exit));
|
| 108 |
|
|
KEEP (*(.exceptions));
|
| 109 |
|
|
PROVIDE (__ram_exceptions_end = ABSOLUTE(.));
|
| 110 |
|
|
} > onchip_memory2_0
|
| 111 |
|
|
|
| 112 |
|
|
PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions));
|
| 113 |
|
|
|
| 114 |
|
|
.text :
|
| 115 |
|
|
{
|
| 116 |
|
|
/*
|
| 117 |
|
|
* All code sections are merged into the text output section, along with
|
| 118 |
|
|
* the read only data sections.
|
| 119 |
|
|
*
|
| 120 |
|
|
*/
|
| 121 |
|
|
|
| 122 |
|
|
PROVIDE (stext = ABSOLUTE(.));
|
| 123 |
|
|
|
| 124 |
|
|
*(.interp)
|
| 125 |
|
|
*(.hash)
|
| 126 |
|
|
*(.dynsym)
|
| 127 |
|
|
*(.dynstr)
|
| 128 |
|
|
*(.gnu.version)
|
| 129 |
|
|
*(.gnu.version_d)
|
| 130 |
|
|
*(.gnu.version_r)
|
| 131 |
|
|
*(.rel.init)
|
| 132 |
|
|
*(.rela.init)
|
| 133 |
|
|
*(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
|
| 134 |
|
|
*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
|
| 135 |
|
|
*(.rel.fini)
|
| 136 |
|
|
*(.rela.fini)
|
| 137 |
|
|
*(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
|
| 138 |
|
|
*(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
|
| 139 |
|
|
*(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
|
| 140 |
|
|
*(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
|
| 141 |
|
|
*(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
|
| 142 |
|
|
*(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
|
| 143 |
|
|
*(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
|
| 144 |
|
|
*(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
|
| 145 |
|
|
*(.rel.ctors)
|
| 146 |
|
|
*(.rela.ctors)
|
| 147 |
|
|
*(.rel.dtors)
|
| 148 |
|
|
*(.rela.dtors)
|
| 149 |
|
|
*(.rel.got)
|
| 150 |
|
|
*(.rela.got)
|
| 151 |
|
|
*(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
|
| 152 |
|
|
*(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
|
| 153 |
|
|
*(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
|
| 154 |
|
|
*(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
|
| 155 |
|
|
*(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
|
| 156 |
|
|
*(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
|
| 157 |
|
|
*(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
|
| 158 |
|
|
*(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
|
| 159 |
|
|
*(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
|
| 160 |
|
|
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
|
| 161 |
|
|
*(.rel.plt)
|
| 162 |
|
|
*(.rela.plt)
|
| 163 |
|
|
*(.rel.dyn)
|
| 164 |
|
|
|
| 165 |
|
|
KEEP (*(.init))
|
| 166 |
|
|
*(.plt)
|
| 167 |
|
|
*(.text .stub .text.* .gnu.linkonce.t.*)
|
| 168 |
|
|
|
| 169 |
|
|
/* .gnu.warning sections are handled specially by elf32.em. */
|
| 170 |
|
|
|
| 171 |
|
|
*(.gnu.warning.*)
|
| 172 |
|
|
KEEP (*(.fini))
|
| 173 |
|
|
PROVIDE (__etext = ABSOLUTE(.));
|
| 174 |
|
|
PROVIDE (_etext = ABSOLUTE(.));
|
| 175 |
|
|
PROVIDE (etext = ABSOLUTE(.));
|
| 176 |
|
|
|
| 177 |
|
|
*(.eh_frame_hdr)
|
| 178 |
|
|
/* Ensure the __preinit_array_start label is properly aligned. We
|
| 179 |
|
|
could instead move the label definition inside the section, but
|
| 180 |
|
|
the linker would then create the section even if it turns out to
|
| 181 |
|
|
be empty, which isn't pretty. */
|
| 182 |
|
|
. = ALIGN(4);
|
| 183 |
|
|
PROVIDE (__preinit_array_start = ABSOLUTE(.));
|
| 184 |
|
|
*(.preinit_array)
|
| 185 |
|
|
PROVIDE (__preinit_array_end = ABSOLUTE(.));
|
| 186 |
|
|
PROVIDE (__init_array_start = ABSOLUTE(.));
|
| 187 |
|
|
*(.init_array)
|
| 188 |
|
|
PROVIDE (__init_array_end = ABSOLUTE(.));
|
| 189 |
|
|
PROVIDE (__fini_array_start = ABSOLUTE(.));
|
| 190 |
|
|
*(.fini_array)
|
| 191 |
|
|
PROVIDE (__fini_array_end = ABSOLUTE(.));
|
| 192 |
|
|
SORT(CONSTRUCTORS)
|
| 193 |
|
|
KEEP (*(.eh_frame))
|
| 194 |
|
|
*(.gcc_except_table)
|
| 195 |
|
|
*(.dynamic)
|
| 196 |
|
|
PROVIDE (__CTOR_LIST__ = ABSOLUTE(.));
|
| 197 |
|
|
KEEP (*(.ctors))
|
| 198 |
|
|
KEEP (*(SORT(.ctors.*)))
|
| 199 |
|
|
PROVIDE (__CTOR_END__ = ABSOLUTE(.));
|
| 200 |
|
|
PROVIDE (__DTOR_LIST__ = ABSOLUTE(.));
|
| 201 |
|
|
KEEP (*(.dtors))
|
| 202 |
|
|
KEEP (*(SORT(.dtors.*)))
|
| 203 |
|
|
PROVIDE (__DTOR_END__ = ABSOLUTE(.));
|
| 204 |
|
|
KEEP (*(.jcr))
|
| 205 |
|
|
. = ALIGN(4);
|
| 206 |
|
|
} > onchip_memory2_0 = 0x3a880100 /* Nios II NOP instruction */
|
| 207 |
|
|
|
| 208 |
|
|
.rodata :
|
| 209 |
|
|
{
|
| 210 |
|
|
PROVIDE (__ram_rodata_start = ABSOLUTE(.));
|
| 211 |
|
|
. = ALIGN(4);
|
| 212 |
|
|
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
| 213 |
|
|
*(.rodata1)
|
| 214 |
|
|
. = ALIGN(4);
|
| 215 |
|
|
PROVIDE (__ram_rodata_end = ABSOLUTE(.));
|
| 216 |
|
|
} > onchip_memory2_0
|
| 217 |
|
|
|
| 218 |
|
|
PROVIDE (__flash_rodata_start = LOADADDR(.rodata));
|
| 219 |
|
|
|
| 220 |
|
|
.rwdata :
|
| 221 |
|
|
{
|
| 222 |
|
|
PROVIDE (__ram_rwdata_start = ABSOLUTE(.));
|
| 223 |
|
|
. = ALIGN(4);
|
| 224 |
|
|
*(.got.plt) *(.got)
|
| 225 |
|
|
*(.data1)
|
| 226 |
|
|
*(.data .data.* .gnu.linkonce.d.*)
|
| 227 |
|
|
|
| 228 |
|
|
_gp = ABSOLUTE(. + 0x8000);
|
| 229 |
|
|
PROVIDE(gp = _gp);
|
| 230 |
|
|
|
| 231 |
|
|
*(.rwdata .rwdata.*)
|
| 232 |
|
|
*(.sdata .sdata.* .gnu.linkonce.s.*)
|
| 233 |
|
|
*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
|
| 234 |
|
|
|
| 235 |
|
|
. = ALIGN(4);
|
| 236 |
|
|
_edata = ABSOLUTE(.);
|
| 237 |
|
|
PROVIDE (edata = ABSOLUTE(.));
|
| 238 |
|
|
PROVIDE (__ram_rwdata_end = ABSOLUTE(.));
|
| 239 |
|
|
} > onchip_memory2_0
|
| 240 |
|
|
|
| 241 |
|
|
PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata));
|
| 242 |
|
|
|
| 243 |
|
|
.bss :
|
| 244 |
|
|
{
|
| 245 |
|
|
__bss_start = ABSOLUTE(.);
|
| 246 |
|
|
PROVIDE (__sbss_start = ABSOLUTE(.));
|
| 247 |
|
|
PROVIDE (___sbss_start = ABSOLUTE(.));
|
| 248 |
|
|
|
| 249 |
|
|
*(.dynsbss)
|
| 250 |
|
|
*(.sbss .sbss.* .gnu.linkonce.sb.*)
|
| 251 |
|
|
*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
|
| 252 |
|
|
*(.scommon)
|
| 253 |
|
|
|
| 254 |
|
|
PROVIDE (__sbss_end = ABSOLUTE(.));
|
| 255 |
|
|
PROVIDE (___sbss_end = ABSOLUTE(.));
|
| 256 |
|
|
|
| 257 |
|
|
*(.dynbss)
|
| 258 |
|
|
*(.bss .bss.* .gnu.linkonce.b.*)
|
| 259 |
|
|
*(COMMON)
|
| 260 |
|
|
|
| 261 |
|
|
. = ALIGN(4);
|
| 262 |
|
|
__bss_end = ABSOLUTE(.);
|
| 263 |
|
|
} > onchip_memory2_0
|
| 264 |
|
|
|
| 265 |
|
|
/*
|
| 266 |
|
|
*
|
| 267 |
|
|
* One output section mapped to the associated memory device for each of
|
| 268 |
|
|
* the available memory devices. These are not used by default, but can
|
| 269 |
|
|
* be used by user applications by using the .section directive.
|
| 270 |
|
|
*
|
| 271 |
|
|
* The output section used for the heap is treated in a special way,
|
| 272 |
|
|
* i.e. the symbols "end" and "_end" are added to point to the heap start.
|
| 273 |
|
|
*
|
| 274 |
|
|
*/
|
| 275 |
|
|
|
| 276 |
|
|
.onchip_memory2_0 :
|
| 277 |
|
|
{
|
| 278 |
|
|
PROVIDE (_alt_partition_onchip_memory2_0_start = ABSOLUTE(.));
|
| 279 |
|
|
*(.onchip_memory2_0. onchip_memory2_0.*)
|
| 280 |
|
|
. = ALIGN(4);
|
| 281 |
|
|
PROVIDE (_alt_partition_onchip_memory2_0_end = ABSOLUTE(.));
|
| 282 |
|
|
_end = ABSOLUTE(.);
|
| 283 |
|
|
end = ABSOLUTE(.);
|
| 284 |
|
|
__alt_stack_base = ABSOLUTE(.);
|
| 285 |
|
|
} > onchip_memory2_0
|
| 286 |
|
|
|
| 287 |
|
|
PROVIDE (_alt_partition_onchip_memory2_0_load_addr = LOADADDR(.onchip_memory2_0));
|
| 288 |
|
|
|
| 289 |
|
|
/*
|
| 290 |
|
|
* Stabs debugging sections.
|
| 291 |
|
|
*
|
| 292 |
|
|
*/
|
| 293 |
|
|
|
| 294 |
|
|
.stab 0 : { *(.stab) }
|
| 295 |
|
|
.stabstr 0 : { *(.stabstr) }
|
| 296 |
|
|
.stab.excl 0 : { *(.stab.excl) }
|
| 297 |
|
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
| 298 |
|
|
.stab.index 0 : { *(.stab.index) }
|
| 299 |
|
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
| 300 |
|
|
.comment 0 : { *(.comment) }
|
| 301 |
|
|
/* DWARF debug sections.
|
| 302 |
|
|
Symbols in the DWARF debugging sections are relative to the beginning
|
| 303 |
|
|
of the section so we begin them at 0. */
|
| 304 |
|
|
/* DWARF 1 */
|
| 305 |
|
|
.debug 0 : { *(.debug) }
|
| 306 |
|
|
.line 0 : { *(.line) }
|
| 307 |
|
|
/* GNU DWARF 1 extensions */
|
| 308 |
|
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
| 309 |
|
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
| 310 |
|
|
/* DWARF 1.1 and DWARF 2 */
|
| 311 |
|
|
.debug_aranges 0 : { *(.debug_aranges) }
|
| 312 |
|
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
| 313 |
|
|
/* DWARF 2 */
|
| 314 |
|
|
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
| 315 |
|
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
| 316 |
|
|
.debug_line 0 : { *(.debug_line) }
|
| 317 |
|
|
.debug_frame 0 : { *(.debug_frame) }
|
| 318 |
|
|
.debug_str 0 : { *(.debug_str) }
|
| 319 |
|
|
.debug_loc 0 : { *(.debug_loc) }
|
| 320 |
|
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
| 321 |
|
|
/* SGI/MIPS DWARF 2 extensions */
|
| 322 |
|
|
.debug_weaknames 0 : { *(.debug_weaknames) }
|
| 323 |
|
|
.debug_funcnames 0 : { *(.debug_funcnames) }
|
| 324 |
|
|
.debug_typenames 0 : { *(.debug_typenames) }
|
| 325 |
|
|
.debug_varnames 0 : { *(.debug_varnames) }
|
| 326 |
|
|
|
| 327 |
|
|
/* Altera debug extensions */
|
| 328 |
|
|
.debug_alt_sim_info 0 : { *(.debug_alt_sim_info) }
|
| 329 |
|
|
}
|
| 330 |
|
|
|
| 331 |
|
|
/* provide a pointer for the stack */
|
| 332 |
|
|
|
| 333 |
|
|
/*
|
| 334 |
|
|
* Don't override this, override the __alt_stack_* symbols instead.
|
| 335 |
|
|
*/
|
| 336 |
|
|
__alt_data_end = 0x10000;
|
| 337 |
|
|
|
| 338 |
|
|
/*
|
| 339 |
|
|
* The next two symbols define the location of the default stack. You can
|
| 340 |
|
|
* override them to move the stack to a different memory.
|
| 341 |
|
|
*/
|
| 342 |
|
|
PROVIDE( __alt_stack_pointer = __alt_data_end );
|
| 343 |
|
|
PROVIDE( __alt_stack_limit = __alt_stack_base );
|
| 344 |
|
|
|
| 345 |
|
|
/*
|
| 346 |
|
|
* This symbol controls where the start of the heap is. If the stack is
|
| 347 |
|
|
* contiguous with the heap then the stack will contract as memory is
|
| 348 |
|
|
* allocated to the heap.
|
| 349 |
|
|
* Override this symbol to put the heap in a different memory.
|
| 350 |
|
|
*/
|
| 351 |
|
|
PROVIDE( __alt_heap_start = end );
|
| 352 |
|
|
PROVIDE( __alt_heap_limit = 0x10000 );
|