[c257ec4e] | 1 | /* |
---|
| 2 | * This file contains GNU linker directives for a generic MC68360 board. |
---|
| 3 | * Variations in memory size and allocation can be made by |
---|
| 4 | * overriding some values with linker command-line arguments. |
---|
| 5 | * |
---|
| 6 | * Saskatchewan Accelerator Laboratory |
---|
| 7 | * University of Saskatchewan |
---|
| 8 | * Saskatoon, Saskatchewan, CANADA |
---|
| 9 | * eric@skatter.usask.ca |
---|
| 10 | * |
---|
| 11 | * $Id$ |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | /* |
---|
| 15 | * Declare some sizes. |
---|
[c0ebf02] | 16 | * A heap size of 0 means `use all available memory for the heap'. |
---|
[c257ec4e] | 17 | */ |
---|
[df49c60] | 18 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x0; |
---|
| 19 | _RamSize = DEFINED(_RamSize) ? _RamSize : 64M; |
---|
[c0ebf02] | 20 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0; |
---|
| 21 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; |
---|
[c257ec4e] | 22 | |
---|
| 23 | /* |
---|
| 24 | * Declare on-board memory. |
---|
| 25 | */ |
---|
| 26 | MEMORY { |
---|
| 27 | ram : ORIGIN = 0x00000000, LENGTH = 64M |
---|
| 28 | rom : ORIGIN = 0x0F000000, LENGTH = 1M |
---|
| 29 | dpram : ORIGIN = 0x0E000000, LENGTH = 8k |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | /* |
---|
| 33 | * Load objects |
---|
| 34 | */ |
---|
| 35 | SECTIONS { |
---|
| 36 | /* |
---|
| 37 | * Boot PROM |
---|
| 38 | */ |
---|
| 39 | rom : { |
---|
| 40 | _RomBase = .; |
---|
| 41 | } >rom |
---|
| 42 | |
---|
| 43 | /* |
---|
| 44 | * Dynamic RAM |
---|
| 45 | */ |
---|
| 46 | ram : { |
---|
| 47 | _RamBase = .; |
---|
| 48 | } >ram |
---|
| 49 | |
---|
| 50 | /* |
---|
| 51 | * Text, data and bss segments |
---|
| 52 | */ |
---|
| 53 | .text : { |
---|
| 54 | *(.text) |
---|
| 55 | |
---|
[b2b4835] | 56 | /* |
---|
| 57 | * C++ constructors/destructors |
---|
| 58 | */ |
---|
[01c36de] | 59 | *(.gnu.linkonce.t.*) |
---|
| 60 | |
---|
[b2b4835] | 61 | /* |
---|
| 62 | * Initialization and finalization code. |
---|
| 63 | */ |
---|
| 64 | PROVIDE (_init = .); |
---|
| 65 | *crti.o(.init) |
---|
| 66 | *(.init) |
---|
| 67 | *crtn.o(.init) |
---|
| 68 | PROVIDE (_fini = .); |
---|
| 69 | *crti.o(.fini) |
---|
| 70 | *(.fini) |
---|
| 71 | *crtn.o(.fini) |
---|
[f86ec42] | 72 | |
---|
[9c1133e] | 73 | /* |
---|
| 74 | * Special FreeBSD sysctl sections. |
---|
| 75 | */ |
---|
| 76 | . = ALIGN (16); |
---|
| 77 | __start_set_sysctl_set = .; |
---|
| 78 | *(set_sysctl_*); |
---|
| 79 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 80 | *(set_domain_*); |
---|
| 81 | *(set_pseudo_*); |
---|
| 82 | |
---|
[c257ec4e] | 83 | /* |
---|
[b2b4835] | 84 | * C++ constructors/destructors |
---|
[c257ec4e] | 85 | */ |
---|
[b2b4835] | 86 | . = ALIGN (16); |
---|
| 87 | *crtbegin.o(.ctors) |
---|
[c257ec4e] | 88 | *(.ctors) |
---|
[b2b4835] | 89 | *crtend.o(.ctors) |
---|
| 90 | *crtbegin.o(.dtors) |
---|
[c257ec4e] | 91 | *(.dtors) |
---|
[b2b4835] | 92 | *crtend.o(.dtors) |
---|
| 93 | |
---|
| 94 | /* |
---|
| 95 | * Exception frame info |
---|
| 96 | */ |
---|
| 97 | . = ALIGN (16); |
---|
| 98 | *(.eh_frame) |
---|
[c257ec4e] | 99 | |
---|
[b2b4835] | 100 | /* |
---|
| 101 | * Read-only data |
---|
| 102 | */ |
---|
| 103 | . = ALIGN (16); |
---|
[01c36de] | 104 | _rodata_start = . ; |
---|
[85c92574] | 105 | *(.rodata*) |
---|
[01c36de] | 106 | *(.gnu.linkonce.r*) |
---|
| 107 | |
---|
[0af1b73f] | 108 | . = ALIGN (16); |
---|
[b2b4835] | 109 | PROVIDE (etext = .); |
---|
| 110 | } >ram |
---|
[c257ec4e] | 111 | .data : { |
---|
[c0ebf02] | 112 | _copy_start = .; |
---|
[c257ec4e] | 113 | *(.data) |
---|
[01c36de] | 114 | *(.gnu.linkonce.d*) |
---|
| 115 | *(.gcc_except_table) |
---|
[85c92574] | 116 | *(.jcr) |
---|
[c257ec4e] | 117 | . = ALIGN (16); |
---|
[c0ebf02] | 118 | PROVIDE (edata = .); |
---|
| 119 | _copy_end = .; |
---|
[c257ec4e] | 120 | } >ram |
---|
| 121 | .bss : { |
---|
| 122 | M68Kvec = .; |
---|
| 123 | . += (256 * 4); |
---|
[c0ebf02] | 124 | _clear_start = .; |
---|
[5f0fdeb] | 125 | *(.dynbss) |
---|
| 126 | *(.bss .bss.* .gnu.linkonce.b.*) |
---|
[c257ec4e] | 127 | *(COMMON) |
---|
| 128 | . = ALIGN (16); |
---|
[b2b4835] | 129 | PROVIDE (end = .); |
---|
| 130 | |
---|
[c0ebf02] | 131 | . += _StackSize; |
---|
[c257ec4e] | 132 | . = ALIGN (16); |
---|
[c0ebf02] | 133 | _stack_init = .; |
---|
| 134 | _clear_end = .; |
---|
[c257ec4e] | 135 | |
---|
| 136 | _WorkspaceBase = .; |
---|
| 137 | } >ram |
---|
| 138 | |
---|
| 139 | /* |
---|
| 140 | * On-chip memory/peripherals |
---|
| 141 | */ |
---|
| 142 | dpram : { |
---|
| 143 | m360 = .; |
---|
| 144 | . += (8 * 1024); |
---|
| 145 | } >dpram |
---|
[9f30a08b] | 146 | |
---|
| 147 | /* Stabs debugging sections. */ |
---|
| 148 | .stab 0 : { *(.stab) } |
---|
| 149 | .stabstr 0 : { *(.stabstr) } |
---|
| 150 | .stab.excl 0 : { *(.stab.excl) } |
---|
| 151 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
| 152 | .stab.index 0 : { *(.stab.index) } |
---|
| 153 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
| 154 | .comment 0 : { *(.comment) } |
---|
| 155 | |
---|
| 156 | /* DWARF debug sections. |
---|
| 157 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
| 158 | of the section so we begin them at 0. */ |
---|
| 159 | /* DWARF 1 */ |
---|
| 160 | .debug 0 : { *(.debug) } |
---|
| 161 | .line 0 : { *(.line) } |
---|
| 162 | |
---|
| 163 | /* GNU DWARF 1 extensions */ |
---|
| 164 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 165 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 166 | |
---|
| 167 | /* DWARF 1.1 and DWARF 2 */ |
---|
| 168 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 169 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 170 | |
---|
| 171 | /* DWARF 2 */ |
---|
| 172 | .debug_info 0 : { *(.debug_info) } |
---|
| 173 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 174 | .debug_line 0 : { *(.debug_line) } |
---|
| 175 | .debug_frame 0 : { *(.debug_frame) } |
---|
| 176 | .debug_str 0 : { *(.debug_str) } |
---|
| 177 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 178 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 179 | |
---|
| 180 | /* SGI/MIPS DWARF 2 extensions */ |
---|
| 181 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 182 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 183 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 184 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
| 185 | /* These must appear regardless of . */ |
---|
[c257ec4e] | 186 | } |
---|