| 1 | /* Linker script for the "SH3 Target System", also known as "the big box". */ |
|---|
| 2 | |
|---|
| 3 | /*STARTUP(crt0.o) */ |
|---|
| 4 | /*OUTPUT_ARCH(shl)*/ |
|---|
| 5 | SEARCH_DIR(.) |
|---|
| 6 | GROUP(-lc -lgcc) |
|---|
| 7 | __DYNAMIC = 0; |
|---|
| 8 | |
|---|
| 9 | MEMORY |
|---|
| 10 | { |
|---|
| 11 | ram (rwx) : ORIGIN = 0xc008000, LENGTH = 0x2000000 |
|---|
| 12 | } |
|---|
| 13 | |
|---|
| 14 | /* Put the stack up high. */ |
|---|
| 15 | /* (Commented out because it doesn't seem to work right) */ |
|---|
| 16 | /*PROVIDE (__stack = 0xc800000);*/ |
|---|
| 17 | |
|---|
| 18 | /* Initalize some symbols to be zero so we can reference them in the |
|---|
| 19 | crt0 without core dumping. These functions are all optional, but |
|---|
| 20 | we do this so we can have our crt0 always use them if they exist. |
|---|
| 21 | This is so BSPs work better when using the crt0 installed with gcc. |
|---|
| 22 | We have to initalize them twice, so we cover a.out (which prepends |
|---|
| 23 | an underscore) and coff object file formats. */ |
|---|
| 24 | |
|---|
| 25 | PROVIDE (hardware_init_hook = 0); |
|---|
| 26 | PROVIDE (_hardware_init_hook = 0); |
|---|
| 27 | PROVIDE (software_init_hook = 0); |
|---|
| 28 | PROVIDE (_software_init_hook = 0); |
|---|
| 29 | |
|---|
| 30 | /* Put everything in ram (of course). */ |
|---|
| 31 | |
|---|
| 32 | SECTIONS |
|---|
| 33 | { |
|---|
| 34 | .text : |
|---|
| 35 | { |
|---|
| 36 | *(.text) |
|---|
| 37 | . = ALIGN(0x4); |
|---|
| 38 | __CTOR_LIST__ = .; |
|---|
| 39 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
|---|
| 40 | ___ctors = .; |
|---|
| 41 | *(.ctors) |
|---|
| 42 | ___ctors_end = .; |
|---|
| 43 | LONG(0) |
|---|
| 44 | __CTOR_END__ = .; |
|---|
| 45 | __DTOR_LIST__ = .; |
|---|
| 46 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
|---|
| 47 | ___dtors = .; |
|---|
| 48 | *(.dtors) |
|---|
| 49 | ___dtors_end = .; |
|---|
| 50 | LONG(0) |
|---|
| 51 | __DTOR_END__ = .; |
|---|
| 52 | *(.rodata) |
|---|
| 53 | *(.gcc_except_table) |
|---|
| 54 | |
|---|
| 55 | _etext = .; |
|---|
| 56 | *(.lit) |
|---|
| 57 | } > ram |
|---|
| 58 | |
|---|
| 59 | .data BLOCK (0x4) : |
|---|
| 60 | { |
|---|
| 61 | *(.shdata) |
|---|
| 62 | *(.data) |
|---|
| 63 | _edata = .; |
|---|
| 64 | } > ram |
|---|
| 65 | |
|---|
| 66 | .bss BLOCK (0x4) : |
|---|
| 67 | { |
|---|
| 68 | __bss_start = . ; |
|---|
| 69 | *(.shbss) |
|---|
| 70 | *(.bss) |
|---|
| 71 | *(COMMON) |
|---|
| 72 | _end = ALIGN (0x8); |
|---|
| 73 | __end = _end; |
|---|
| 74 | } > ram |
|---|
| 75 | |
|---|
| 76 | /* I know, I know, stack sections are supposed to be useless; but |
|---|
| 77 | this actually worked for me, as opposed to the PROVIDE. */ |
|---|
| 78 | .stack 0xc800000 : |
|---|
| 79 | { |
|---|
| 80 | __stack = .; |
|---|
| 81 | } > ram |
|---|
| 82 | |
|---|
| 83 | .stab 0 (NOLOAD) : { *(.stab) } |
|---|
| 84 | .stabstr 0 (NOLOAD) : { *(.stabstr) } |
|---|
| 85 | |
|---|
| 86 | /* DWARF debug sections. |
|---|
| 87 | Symbols in the DWARF debugging sections are relative to |
|---|
| 88 | the beginning of the section so we begin them at 0. */ |
|---|
| 89 | /* DWARF 1 */ |
|---|
| 90 | .debug 0 : { *(.debug) } |
|---|
| 91 | .line 0 : { *(.line) } |
|---|
| 92 | /* GNU DWARF 1 extensions */ |
|---|
| 93 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
|---|
| 94 | .debug_sfnames 0 : { *(.debug_sfnames) } |
|---|
| 95 | /* DWARF 1.1 and DWARF 2 */ |
|---|
| 96 | .debug_aranges 0 : { *(.debug_aranges) } |
|---|
| 97 | .debug_pubnames 0 : { *(.debug_pubnames) } |
|---|
| 98 | /* DWARF 2 */ |
|---|
| 99 | .debug_info 0 : { *(.debug_info) } |
|---|
| 100 | .debug_abbrev 0 : { *(.debug_abbrev) } |
|---|
| 101 | .debug_line 0 : { *(.debug_line) } |
|---|
| 102 | .debug_frame 0 : { *(.debug_frame) } |
|---|
| 103 | .debug_str 0 : { *(.debug_str) } |
|---|
| 104 | .debug_loc 0 : { *(.debug_loc) } |
|---|
| 105 | .debug_macinfo 0 : { *(.debug_macinfo) } |
|---|
| 106 | .debug_ranges 0 : { *(.debug_ranges) } |
|---|
| 107 | /* SGI/MIPS DWARF 2 extensions */ |
|---|
| 108 | .debug_weaknames 0 : { *(.debug_weaknames) } |
|---|
| 109 | .debug_funcnames 0 : { *(.debug_funcnames) } |
|---|
| 110 | .debug_typenames 0 : { *(.debug_typenames) } |
|---|
| 111 | .debug_varnames 0 : { *(.debug_varnames) } |
|---|
| 112 | } |
|---|