[0074691a] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * MC68302 Linker command file |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[b2b4835] | 8 | /* |
---|
| 9 | * Declare some sizes. |
---|
| 10 | */ |
---|
[df49c60] | 11 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x0; |
---|
[b8c9883] | 12 | _RamSize = DEFINED(_RamSize) ? _RamSize : 1M; |
---|
| 13 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000; |
---|
| 14 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; |
---|
[b2b4835] | 15 | |
---|
[29387823] | 16 | /* |
---|
| 17 | * Memory map. |
---|
| 18 | */ |
---|
| 19 | RAM_BASE = DEFINED(RAM_BASE) ? RAM_BASE : 0x00000000; |
---|
| 20 | RAM_SIZE = DEFINED(RAM_SIZE) ? RAM_SIZE : 0x00100000; |
---|
| 21 | ROM_BASE = DEFINED(ROM_BASE) ? ROM_BASE : 0x00C00000; |
---|
| 22 | ROM_SIZE = DEFINED(ROM_SIZE) ? ROM_SIZE : 0x00100000; |
---|
| 23 | MC68302_BASE = DEFINED(MC68302_BASE) ? MC68302_BASE : 0x00700000; |
---|
| 24 | |
---|
[b2b4835] | 25 | /* |
---|
| 26 | * Declare on-board memory. |
---|
| 27 | */ |
---|
| 28 | MEMORY { |
---|
| 29 | ram : ORIGIN = 0x00000000, LENGTH = 1M |
---|
| 30 | } |
---|
[0074691a] | 31 | SECTIONS |
---|
| 32 | { |
---|
[29387823] | 33 | .vtable RAM_BASE : |
---|
[b2b4835] | 34 | { |
---|
| 35 | vtable_start = .; |
---|
| 36 | *(.vtable) |
---|
| 37 | evtable = .; |
---|
| 38 | } >ram |
---|
| 39 | |
---|
| 40 | /* |
---|
| 41 | * Text, data and bss segments |
---|
| 42 | */ |
---|
[29387823] | 43 | .text ROM_BASE : { |
---|
| 44 | /* |
---|
| 45 | * Needs to be first. 8K limit on CS0 at reset. |
---|
| 46 | */ |
---|
| 47 | *(.resettext); |
---|
| 48 | *cpuboot.o(.text) |
---|
| 49 | |
---|
| 50 | /* |
---|
| 51 | * The reset of the text is entered once CS0 is remapped. |
---|
| 52 | */ |
---|
[b2b4835] | 53 | *(.text) |
---|
| 54 | |
---|
| 55 | /* |
---|
| 56 | * C++ constructors/destructors |
---|
| 57 | */ |
---|
| 58 | *(.gnu.linkonce.t.*) |
---|
| 59 | |
---|
| 60 | /* |
---|
| 61 | * Initialization and finalization code. |
---|
| 62 | * |
---|
| 63 | * Various files can provide initialization and finalization |
---|
| 64 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
| 65 | * body of these functions are in .init and .fini sections. We |
---|
| 66 | * accumulate the bodies here, and prepend function prologues |
---|
| 67 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
| 68 | * be linked first; crtn.o must be linked last. Because these |
---|
| 69 | * are wildcards, it doesn't matter if the user does not |
---|
| 70 | * actually link against crti.o and crtn.o; the linker won't |
---|
| 71 | * look for a file to match a wildcard. The wildcard also |
---|
| 72 | * means that it doesn't matter which directory crti.o and |
---|
| 73 | * crtn.o are in. |
---|
| 74 | */ |
---|
| 75 | PROVIDE (_init = .); |
---|
| 76 | *crti.o(.init) |
---|
| 77 | *(.init) |
---|
| 78 | *crtn.o(.init) |
---|
| 79 | PROVIDE (_fini = .); |
---|
| 80 | *crti.o(.fini) |
---|
| 81 | *(.fini) |
---|
| 82 | *crtn.o(.fini) |
---|
| 83 | |
---|
[9c1133e] | 84 | /* |
---|
| 85 | * Special FreeBSD sysctl sections. |
---|
| 86 | */ |
---|
| 87 | . = ALIGN (16); |
---|
| 88 | __start_set_sysctl_set = .; |
---|
| 89 | *(set_sysctl_*); |
---|
| 90 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 91 | *(set_domain_*); |
---|
| 92 | *(set_pseudo_*); |
---|
| 93 | |
---|
[b2b4835] | 94 | /* |
---|
| 95 | * C++ constructors/destructors |
---|
| 96 | * |
---|
| 97 | * gcc uses crtbegin.o to find the start of the constructors |
---|
| 98 | * and destructors so we make sure it is first. Because this |
---|
| 99 | * is a wildcard, it doesn't matter if the user does not |
---|
| 100 | * actually link against crtbegin.o; the linker won't look for |
---|
| 101 | * a file to match a wildcard. The wildcard also means that |
---|
| 102 | * it doesn't matter which directory crtbegin.o is in. The |
---|
| 103 | * constructor and destructor list are terminated in |
---|
| 104 | * crtend.o. The same comments apply to it. |
---|
| 105 | */ |
---|
| 106 | . = ALIGN (16); |
---|
| 107 | *crtbegin.o(.ctors) |
---|
| 108 | *(.ctors) |
---|
| 109 | *crtend.o(.ctors) |
---|
| 110 | *crtbegin.o(.dtors) |
---|
| 111 | *(.dtors) |
---|
| 112 | *crtend.o(.dtors) |
---|
| 113 | |
---|
| 114 | /* |
---|
| 115 | * Exception frame info |
---|
| 116 | */ |
---|
| 117 | . = ALIGN (16); |
---|
| 118 | *(.eh_frame) |
---|
| 119 | |
---|
| 120 | /* |
---|
| 121 | * Read-only data |
---|
| 122 | */ |
---|
| 123 | . = ALIGN (16); |
---|
[85c92574] | 124 | _rodata_start = .; |
---|
| 125 | *(.rodata*) |
---|
[b2b4835] | 126 | *(.gnu.linkonce.r*) |
---|
| 127 | |
---|
| 128 | . = ALIGN (16); |
---|
| 129 | PROVIDE (_etext = .); |
---|
[29387823] | 130 | } >rom |
---|
| 131 | |
---|
| 132 | .data (ADDR(.vtable) + SIZEOF(.vtable)) : |
---|
| 133 | AT (ADDR(.text) + SIZEOF(.text)) { |
---|
[b2b4835] | 134 | PROVIDE (_copy_start = .); |
---|
| 135 | *(.data) |
---|
| 136 | *(.gnu.linkonce.d*) |
---|
| 137 | *(.gcc_except_table) |
---|
[85c92574] | 138 | *(.jcr) |
---|
[b2b4835] | 139 | . = ALIGN (16); |
---|
| 140 | PROVIDE (_edata = .); |
---|
| 141 | PROVIDE (_copy_end = .); |
---|
| 142 | } >ram |
---|
[29387823] | 143 | .bss (ADDR(.data) + SIZEOF(.data)) : { |
---|
[b8c9883] | 144 | _clear_start = .; |
---|
[b2b4835] | 145 | *(.bss) |
---|
| 146 | *(COMMON) |
---|
| 147 | . = ALIGN (16); |
---|
| 148 | PROVIDE (end = .); |
---|
| 149 | |
---|
[b8c9883] | 150 | . += _StackSize; |
---|
[b2b4835] | 151 | . = ALIGN (16); |
---|
[b8c9883] | 152 | _stack_init = .; |
---|
| 153 | _clear_end = .; |
---|
[b2b4835] | 154 | |
---|
[b8c9883] | 155 | _WorkspaceBase = .; |
---|
[b2b4835] | 156 | } >ram |
---|
[9f30a08b] | 157 | |
---|
| 158 | /* Stabs debugging sections. */ |
---|
| 159 | .stab 0 : { *(.stab) } |
---|
| 160 | .stabstr 0 : { *(.stabstr) } |
---|
| 161 | .stab.excl 0 : { *(.stab.excl) } |
---|
| 162 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
| 163 | .stab.index 0 : { *(.stab.index) } |
---|
| 164 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
| 165 | .comment 0 : { *(.comment) } |
---|
| 166 | |
---|
| 167 | /* DWARF debug sections. |
---|
| 168 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
| 169 | of the section so we begin them at 0. */ |
---|
| 170 | /* DWARF 1 */ |
---|
| 171 | .debug 0 : { *(.debug) } |
---|
| 172 | .line 0 : { *(.line) } |
---|
| 173 | |
---|
| 174 | /* GNU DWARF 1 extensions */ |
---|
| 175 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 176 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 177 | |
---|
| 178 | /* DWARF 1.1 and DWARF 2 */ |
---|
| 179 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 180 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 181 | |
---|
| 182 | /* DWARF 2 */ |
---|
| 183 | .debug_info 0 : { *(.debug_info) } |
---|
| 184 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 185 | .debug_line 0 : { *(.debug_line) } |
---|
| 186 | .debug_frame 0 : { *(.debug_frame) } |
---|
| 187 | .debug_str 0 : { *(.debug_str) } |
---|
| 188 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 189 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 190 | |
---|
| 191 | /* SGI/MIPS DWARF 2 extensions */ |
---|
| 192 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 193 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 194 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 195 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
| 196 | /* These must appear regardless of . */ |
---|
[0074691a] | 197 | } |
---|
| 198 | |
---|
| 199 | m302 = MC68302_BASE; |
---|
| 200 | _VBR = ADDR(.vtable); /* location of the VBR table (in RAM) */ |
---|
| 201 | |
---|