Lines Matching refs:add

233       add('/* Linker Script Original v1.3 by Jeff Frohwein     */');
234 add('/* v1.0 - Original release */');
235 add('/* v1.1 - Added proper .data section support */');
236 add('/* v1.2 - Added support for c++ & iwram overlays */');
237 add('/* - Major contributions by Jason Wilkins. */');
238 add('/* v1.3 - .ewram section now can be used when */');
239 add('/* compiling for MULTIBOOT mode. This fixes */');
240 add('/* malloc() in DevKitAdvance which depends */');
241 add('/* on __eheap_start instead of end to define*/');
242 add('/* the starting location of heap space. */');
243 add('/* External global variable __gba_iwram_heap*/');
244 add('/* support added to allow labels end, _end, */');
245 add('/* & __end__ to point to end of iwram or */');
246 add('/* the end of ewram. */');
247 add('/* Additions by WinterMute */');
248 add('/* v1.4 - .sbss section added for unitialised */');
249 add('/* data in ewram */');
250 add('/* v1.5 - padding section added to stop EZF */');
251 add('/* stripping important data */');
252 add('');
253 add('/* This file is released into the public domain */');
254 add('/* for commercial or non-commercial use with no */');
255 add('/* restrictions placed upon it. */');
256 add('');
257 add('/* NOTE!!!: This linker script defines the RAM & */');
258 add('/* ROM start addresses. In order for it to work */');
259 add('/* properly, remove -Ttext and -Tbss linker */');
260 add('/* options from your makefile if they are */');
261 add('/* present. */');
262 add('');
263 add('/* You can use the following to view section */');
264 add('/* addresses in your .elf file: */');
265 add('/* objdump -h file.elf */');
266 add('/* Please note that empty sections may incorrectly*/');
267 add('/* list the lma address as the vma address for */');
268 add('/* some versions of objdump. */');
269 add('');
270 add('OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")');
271 add('OUTPUT_ARCH(arm)');
272 add('ENTRY(_start)');
273 add('/* SEARCH_DIR(/bin/arm); */');
274 add('');
275 add('/* The linker script function "var1 += var2;" sometimes */');
276 add('/* reports incorrect values in the *.map file but the */');
277 add('/* actual value it calculates is usually, if not always, */');
278 add('/* correct. If you leave out the ". = ALIGN(4);" at the */');
279 add('/* end of each section then the return value of SIZEOF() */');
280 add('/* is sometimes incorrect and "var1 += var2;" appears to */');
281 add('/* not work as well. "var1 += var2" style functions are */');
282 add('/* avoided below as a result. */');
283 add('');
284 add('MEMORY {');
285 add('');
286 add(' rom : ORIGIN = 0x08000000, LENGTH = 32M');
287 add(' iwram : ORIGIN = 0x03000000, LENGTH = 32K');
288 add(' ewram : ORIGIN = 0x02000000, LENGTH = 256K');
289 add('}');
290 add('');
291 add('__text_start = ORIGIN(rom);');
292 add('__eheap_end = ORIGIN(ewram) + LENGTH(ewram);');
293 add('__iwram_start = ORIGIN(iwram);');
294 add('__iwram_top = ORIGIN(iwram) + LENGTH(iwram);;');
295 add('__sp_irq = __iwram_top - 0x060;');
296 add('__sp_usr = __sp_irq - 0x0a0;');
297 add('__irq_flags = 0x03007ff8;');
298 add('');
299 add('SECTIONS');
300 add('{');
301 add(' . = __text_start;');
302 add(' .init :');
303 add(' {');
304 add(' KEEP (*(.init))');
305 add(' . = ALIGN(4);');
306 add(' } >rom =0xff');
307 add('');
308 add(' .plt :');
309 add(' {');
310 add(' *(.plt)');
311 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
312 add(' } >rom');
313 add('');
314 add(' .text : /* ALIGN (4): */');
315 add(' {');
316 add(' *(EXCLUDE_FILE (*.iwram*) .text)');
317 add(' *(.text .stub .text.* .gnu.linkonce.t.*)');
318 add(' KEEP (*(.text.*personality*))');
319 add(' /* .gnu.warning sections are handled specially by elf32.em. */');
320 add(' *(.gnu.warning)');
321 add(' *(.glue_7t) *(.glue_7) *(.vfp11_veneer)');
322 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
323 add(' } >rom = 0xff');
324 add('');
325 add(' __text_end = .;');
326 add(' .fini :');
327 add(' {');
328 add(' KEEP (*(.fini))');
329 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
330 add(' } >rom =0');
331 add('');
332 add(' .rodata :');
333 add(' {');
334 add(' *(.rodata)');
335 add(' *all.rodata*(*)');
336 add(' *(.roda)');
337 add(' *(.rodata.*)');
338 add(' *(.gnu.linkonce.r*)');
339 add(' SORT(CONSTRUCTORS)');
340 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
341 add(' } >rom = 0xff');
342 add(' .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >rom');
343 add(' __exidx_start = .;');
344 add(' .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } >rom');
345 add(' __exidx_end = .;');
346 add('');
347 add(' .ctors :');
348 add(' {');
349 add(' /* gcc uses crtbegin.o to find the start of the constructors, so');
350 add(' we make sure it is first. Because this is a wildcard, it');
351 add(' doesn''t matter if the user does not actually link against');
352 add(' crtbegin.o; the linker won''t look for a file to match a');
353 add(' wildcard. The wildcard also means that it doesn''t matter which');
354 add(' directory crtbegin.o is in. */');
355 add(' KEEP (*crtbegin.o(.ctors))');
356 add(' KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))');
357 add(' KEEP (*(SORT(.ctors.*)))');
358 add(' KEEP (*(.ctors))');
359 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
360 add(' } >rom = 0');
361 add('');
362 add(' .dtors :');
363 add(' {');
364 add(' KEEP (*crtbegin.o(.dtors))');
365 add(' KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))');
366 add(' KEEP (*(SORT(.dtors.*)))');
367 add(' KEEP (*(.dtors))');
368 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
369 add(' } >rom = 0');
370 add('');
371 add('');
372 add(' .eh_frame :');
373 add(' {');
374 add(' KEEP (*(.eh_frame))');
375 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
376 add(' } >rom = 0');
377 add('');
378 add(' .gcc_except_table :');
379 add(' {');
380 add(' *(.gcc_except_table)');
381 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
382 add(' } >rom = 0');
383 add('');
384 add(' __iwram_lma = .;');
385 add('');
386 add(' .iwram __iwram_start : AT (__iwram_lma)');
387 add(' {');
388 add(' __iwram_start = ABSOLUTE(.) ;');
389 add(' *(.iwram)');
390 add(' *iwram.*(.text)');
391 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
392 add(' __iwram_end = ABSOLUTE(.) ;');
393 add(' } >iwram = 0xff');
394 add('');
395 add(' __data_lma = __iwram_lma + SIZEOF(.iwram) ;');
396 add('');
397 add(' .bss ALIGN(4) (NOLOAD) :');
398 add(' {');
399 add(' __bss_start = ABSOLUTE(.);');
400 add(' __bss_start__ = ABSOLUTE(.);');
401 add(' *(.dynbss)');
402 add(' *(.gnu.linkonce.b*)');
403 add(' *(.bss*)');
404 add(' *(COMMON)');
405 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
406 add(' __bss_end = ABSOLUTE(.) ;');
407 add('');
408 add(' } AT>iwram');
409 add('');
410 add(' __bss_end__ = __bss_end ;');
411 add('');
412 add(' .data ALIGN(4) : AT (__data_lma)');
413 add(' {');
414 add(' __data_start = ABSOLUTE(.);');
415 add(' *(.data)');
416 add(' *(.data.*)');
417 add(' *(.gnu.linkonce.d*)');
418 add(' *(.fpc*)');
419 add(' CONSTRUCTORS');
420 add(' . = ALIGN(4);');
421 add(' } >iwram = 0xff');
422 add('');
423 add(' __preinit_lma = __data_lma + SIZEOF(.data);');
424 add('');
425 add(' PROVIDE (__preinit_array_start = .);');
426 add(' .preinit_array : AT (__preinit_lma) { KEEP (*(.preinit_array)) } >iwram');
427 add(' PROVIDE (__preinit_array_end = .);');
428 add('');
429 add(' __init_lma = __preinit_lma + SIZEOF(.preinit_array);');
430 add('');
431 add(' PROVIDE (__init_array_start = .);');
432 add(' .init_array : AT (__init_lma)');
433 add(' {');
434 add(' KEEP (*(SORT(.init_array.*)))');
435 add(' KEEP (*(.init_array))');
436 add(' } >iwram');
437 add(' PROVIDE (__init_array_end = .);');
438 add(' PROVIDE (__fini_array_start = .);');
439 add('');
440 add(' __fini_lma = __init_lma + SIZEOF(.init_array);');
441 add('');
442 add(' .fini_array : AT (__fini_lma)');
443 add(' {');
444 add(' KEEP (*(SORT(.fini_array.*)))');
445 add(' KEEP (*(.fini_array))');
446 add(' } >iwram');
447 add(' PROVIDE (__fini_array_end = .);');
448 add('');
449 add(' __jcr_lma = __fini_lma + SIZEOF(.fini_array);');
450 add(' .jcr : AT (__jcr_lma) { KEEP (*(.jcr)) } >iwram');
451 add('');
452 add(' __data_end = ABSOLUTE(.);');
453 add(' __iwram_overlay_lma = __jcr_lma + SIZEOF(.jcr);');
454 add('');
455 add(' __iwram_overlay_start = . ;');
456 add('');
457 add(' OVERLAY ALIGN(4) : NOCROSSREFS AT (__iwram_overlay_lma)');
458 add(' {');
459 add(' .iwram0 { *(.iwram0) . = ALIGN(4);}');
460 add(' .iwram1 { *(.iwram1) . = ALIGN(4);}');
461 add(' .iwram2 { *(.iwram2) . = ALIGN(4);}');
462 add(' .iwram3 { *(.iwram3) . = ALIGN(4);}');
463 add(' .iwram4 { *(.iwram4) . = ALIGN(4);}');
464 add(' .iwram5 { *(.iwram5) . = ALIGN(4);}');
465 add(' .iwram6 { *(.iwram6) . = ALIGN(4);}');
466 add(' .iwram7 { *(.iwram7) . = ALIGN(4);}');
467 add(' .iwram8 { *(.iwram8) . = ALIGN(4);}');
468 add(' .iwram9 { *(.iwram9) . = ALIGN(4);}');
469 add(' }>iwram = 0xff');
470 add('');
471 add(' __iwram_overlay_end = . ;');
472 add(' __ewram_lma = __iwram_overlay_lma + (__iwram_overlay_end - __iwram_overlay_start) ;');
473 add('');
474 add(' __iheap_start = . ;');
475 add('');
476 add(' __ewram_start = ORIGIN(ewram);');
477 add(' .ewram __ewram_start : AT (__ewram_lma)');
478 add(' {');
479 add(' *(.ewram)');
480 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
481 add(' }>ewram = 0xff');
482 add('');
483 add(' __pad_lma = __ewram_lma + SIZEOF(.ewram);');
484 add('');
485 add(' .sbss ALIGN(4)(NOLOAD):');
486 add(' {');
487 add(' __sbss_start = ABSOLUTE(.);');
488 add(' *(.sbss)');
489 add(' . = ALIGN(4);');
490 add(' __sbss_end = ABSOLUTE(.);');
491 add(' } AT>ewram');
492 add('');
493 add('');
494 add(' __ewram_end = __sbss_end ;');
495 add(' __eheap_start = __sbss_end;');
496 add(' __end__ = __sbss_end;');
497 add('');
498add(' /* EZF Advance strips trailing 0xff bytes, add a pad section so nothing important is removed…
499 add(' .pad ALIGN(4) : AT (__pad_lma)');
500 add(' {');
501 add(' LONG(0x52416b64)');
502 add(' LONG(0x4d)');
503 add(' . = ALIGN(4); /* REQUIRED. LD is flaky without it. */');
504 add(' } = 0xff');
505 add(' __rom_end__ = __pad_lma + SIZEOF(.pad);');
506 add('');
507 add('');
508 add(' /* Stabs debugging sections. */');
509 add(' .stab 0 : { *(.stab) }');
510 add(' .stabstr 0 : { *(.stabstr) }');
511 add(' .stab.excl 0 : { *(.stab.excl) }');
512 add(' .stab.exclstr 0 : { *(.stab.exclstr) }');
513 add(' .stab.index 0 : { *(.stab.index) }');
514 add(' .stab.indexstr 0 : { *(.stab.indexstr) }');
515 add(' .comment 0 : { *(.comment) }');
516 add(' /* DWARF debug sections.');
517 add(' Symbols in the DWARF debugging sections are relative to the beginning');
518 add(' of the section so we begin them at 0. */');
519 add(' /* DWARF 1 */');
520 add(' .debug 0 : { *(.debug) }');
521 add(' .line 0 : { *(.line) }');
522 add(' /* GNU DWARF 1 extensions */');
523 add(' .debug_srcinfo 0 : { *(.debug_srcinfo) }');
524 add(' .debug_sfnames 0 : { *(.debug_sfnames) }');
525 add(' /* DWARF 1.1 and DWARF 2 */');
526 add(' .debug_aranges 0 : { *(.debug_aranges) }');
527 add(' .debug_pubnames 0 : { *(.debug_pubnames) }');
528 add(' /* DWARF 2 */');
529 add(' .debug_info 0 : { *(.debug_info) }');
530 add(' .debug_abbrev 0 : { *(.debug_abbrev) }');
531 add(' .debug_line 0 : { *(.debug_line) }');
532 add(' .debug_frame 0 : { *(.debug_frame) }');
533 add(' .debug_str 0 : { *(.debug_str) }');
534 add(' .debug_loc 0 : { *(.debug_loc) }');
535 add(' .debug_macinfo 0 : { *(.debug_macinfo) }');
536 add(' /* SGI/MIPS DWARF 2 extensions */');
537 add(' .debug_weaknames 0 : { *(.debug_weaknames) }');
538 add(' .debug_funcnames 0 : { *(.debug_funcnames) }');
539 add(' .debug_typenames 0 : { *(.debug_typenames) }');
540 add(' .debug_varnames 0 : { *(.debug_varnames) }');
541 add(' .stack 0x80000 : { _stack = .; *(.stack) }');
542 add(' /* These must appear regardless of . */');
543 add(' .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }');
544 add(' .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }');
545 add(' /DISCARD/ : { *(.note.GNU-stack) }');
546 add('}');