[572484f] | 1 | /* |
---|
| 2 | * This file contains directives for the GNU linker which are specific |
---|
| 3 | * to the Arcturus uC DIMM ColdFire 5282 |
---|
| 4 | * |
---|
| 5 | * COPYRIGHT (c) 1989-1999. |
---|
| 6 | * On-Line Applications Research Corporation (OAR). |
---|
| 7 | * |
---|
| 8 | * The license and distribution terms for this file may be |
---|
| 9 | * found in the file LICENSE in this distribution or at |
---|
| 10 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 11 | * |
---|
| 12 | * $Id$ |
---|
| 13 | */ |
---|
| 14 | |
---|
| 15 | /* |
---|
[0eff7b8] | 16 | * Declare some locations and sizes. |
---|
[572484f] | 17 | */ |
---|
| 18 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x0 ; |
---|
| 19 | _RamSize = DEFINED(_RamSize) ? _RamSize : 16M ; |
---|
| 20 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0 ; |
---|
[0eff7b8] | 21 | _FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x10000000 ; |
---|
[4fabd645] | 22 | _FlashSize = DEFINED(_FlashSize) ? _FlashSize : 4M ; |
---|
[572484f] | 23 | |
---|
| 24 | /* |
---|
| 25 | * Location of downloaded (from TFTP or flash) file |
---|
| 26 | */ |
---|
| 27 | _DownloadLocation = 0x40000; |
---|
| 28 | |
---|
| 29 | /* |
---|
| 30 | * System clock speed |
---|
| 31 | */ |
---|
| 32 | _CPUClockSpeed = DEFINED(_CPUClockSpeed) ? _CPUClockSpeed : 64000000 ; |
---|
| 33 | |
---|
| 34 | /* |
---|
| 35 | * Location of on-chip devices |
---|
| 36 | */ |
---|
| 37 | __IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000 ; |
---|
| 38 | __SRAMBASE = DEFINED(__SRAMBASE) ? __SRAMBASE : 0x20000000 ; |
---|
| 39 | |
---|
| 40 | ENTRY(start) |
---|
| 41 | MEMORY |
---|
| 42 | { |
---|
| 43 | ram : ORIGIN = 0, LENGTH = 16M |
---|
| 44 | sram : ORIGIN = 0x20000000, LENGTH = 64k |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | SECTIONS |
---|
| 48 | { |
---|
| 49 | |
---|
| 50 | _header_offset = 0; |
---|
| 51 | |
---|
| 52 | /* |
---|
| 53 | * Text, data and bss segments |
---|
| 54 | */ |
---|
| 55 | .text _DownloadLocation : { |
---|
| 56 | |
---|
| 57 | *(.text) |
---|
| 58 | *(.ram_code) |
---|
| 59 | |
---|
| 60 | /* |
---|
| 61 | * C++ constructors/destructors |
---|
| 62 | */ |
---|
| 63 | *(.gnu.linkonce.t.*) |
---|
| 64 | |
---|
| 65 | /* |
---|
| 66 | * Initialization and finalization code. |
---|
| 67 | * |
---|
| 68 | * Various files can provide initialization and finalization |
---|
| 69 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
| 70 | * body of these functions are in .init and .fini sections. We |
---|
| 71 | * accumulate the bodies here, and prepend function prologues |
---|
| 72 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
| 73 | * be linked first; crtn.o must be linked last. Because these |
---|
| 74 | * are wildcards, it doesn't matter if the user does not |
---|
| 75 | * actually link against crti.o and crtn.o; the linker won't |
---|
| 76 | * look for a file to match a wildcard. The wildcard also |
---|
| 77 | * means that it doesn't matter which directory crti.o and |
---|
| 78 | * crtn.o are in. |
---|
| 79 | */ |
---|
| 80 | PROVIDE (_init = .); |
---|
| 81 | *crti.o(.init) |
---|
| 82 | *(.init) |
---|
| 83 | *crtn.o(.init) |
---|
| 84 | PROVIDE (_fini = .); |
---|
| 85 | *crti.o(.fini) |
---|
| 86 | *(.fini) |
---|
| 87 | *crtn.o(.fini) |
---|
| 88 | |
---|
| 89 | /* |
---|
| 90 | * Special FreeBSD sysctl sections. |
---|
| 91 | */ |
---|
| 92 | . = ALIGN (16); |
---|
| 93 | __start_set_sysctl_set = .; |
---|
| 94 | *(set_sysctl_*); |
---|
| 95 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 96 | *(set_domain_*); |
---|
| 97 | *(set_pseudo_*); |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | /* |
---|
| 101 | * C++ constructors/destructors |
---|
| 102 | * |
---|
| 103 | * gcc uses crtbegin.o to find the start of the constructors |
---|
| 104 | * and destructors so we make sure it is first. Because this |
---|
| 105 | * is a wildcard, it doesn't matter if the user does not |
---|
| 106 | * actually link against crtbegin.o; the linker won't look for |
---|
| 107 | * a file to match a wildcard. The wildcard also means that |
---|
| 108 | * it doesn't matter which directory crtbegin.o is in. The |
---|
| 109 | * constructor and destructor list are terminated in |
---|
| 110 | * crtend.o. The same comments apply to it. |
---|
| 111 | */ |
---|
| 112 | . = ALIGN (16); |
---|
| 113 | *crtbegin.o(.ctors) |
---|
| 114 | *(.ctors) |
---|
| 115 | *crtend.o(.ctors) |
---|
| 116 | *crtbegin.o(.dtors) |
---|
| 117 | *(.dtors) |
---|
| 118 | *crtend.o(.dtors) |
---|
| 119 | |
---|
| 120 | /* |
---|
| 121 | * Exception frame info |
---|
| 122 | */ |
---|
| 123 | . = ALIGN (16); |
---|
| 124 | *(.eh_frame) |
---|
| 125 | |
---|
| 126 | /* |
---|
| 127 | * Read-only data |
---|
| 128 | */ |
---|
| 129 | . = ALIGN (16); |
---|
| 130 | _rodata_start = . ; |
---|
| 131 | *(.rodata*) |
---|
| 132 | *(.gnu.linkonce.r*) |
---|
| 133 | |
---|
| 134 | . = ALIGN (16); |
---|
| 135 | |
---|
| 136 | *(.console_gdb_xfer) |
---|
| 137 | *(.bootstrap_data) |
---|
| 138 | . = ALIGN(16); |
---|
| 139 | _estuff = .; |
---|
| 140 | PROVIDE (_etext = .); |
---|
| 141 | } >ram |
---|
| 142 | |
---|
| 143 | .data : { |
---|
| 144 | PROVIDE( _data_dest_start = . ); |
---|
| 145 | PROVIDE( _copy_start = .); |
---|
| 146 | *(.data) |
---|
| 147 | *(.gnu.linkonce.d*) |
---|
| 148 | *(.gcc_except_table) |
---|
| 149 | *(.jcr) |
---|
| 150 | . = ALIGN (16); |
---|
| 151 | PROVIDE (_edata = .); |
---|
| 152 | PROVIDE (_copy_end = .); |
---|
| 153 | PROVIDE (_data_dest_end = . ); |
---|
| 154 | } >ram |
---|
| 155 | |
---|
| 156 | _data_src_start = LOADADDR(.data); |
---|
| 157 | _data_src_end = _data_src_start + SIZEOF(.data); |
---|
| 158 | |
---|
| 159 | .bss : { |
---|
| 160 | _clear_start = .; |
---|
| 161 | *(.bss) |
---|
| 162 | *(COMMON) |
---|
| 163 | . = ALIGN (16); |
---|
| 164 | PROVIDE (end = .); |
---|
| 165 | _clear_end = .; |
---|
| 166 | |
---|
| 167 | _WorkspaceBase = .; |
---|
| 168 | } >ram |
---|
| 169 | /* Stabs debugging sections. */ |
---|
| 170 | .stab 0 : { *(.stab) } |
---|
| 171 | .stabstr 0 : { *(.stabstr) } |
---|
| 172 | .stab.excl 0 : { *(.stab.excl) } |
---|
| 173 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
| 174 | .stab.index 0 : { *(.stab.index) } |
---|
| 175 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
| 176 | .comment 0 : { *(.comment) } |
---|
| 177 | |
---|
| 178 | /* DWARF debug sections. |
---|
| 179 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
| 180 | of the section so we begin them at 0. */ |
---|
| 181 | /* DWARF 1 */ |
---|
| 182 | .debug 0 : { *(.debug) } |
---|
| 183 | .line 0 : { *(.line) } |
---|
| 184 | |
---|
| 185 | /* GNU DWARF 1 extensions */ |
---|
| 186 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 187 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 188 | |
---|
| 189 | /* DWARF 1.1 and DWARF 2 */ |
---|
| 190 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 191 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 192 | |
---|
| 193 | /* DWARF 2 */ |
---|
| 194 | .debug_info 0 : { *(.debug_info) } |
---|
| 195 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 196 | .debug_line 0 : { *(.debug_line) } |
---|
| 197 | .debug_frame 0 : { *(.debug_frame) } |
---|
| 198 | .debug_str 0 : { *(.debug_str) } |
---|
| 199 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 200 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 201 | |
---|
| 202 | /* SGI/MIPS DWARF 2 extensions */ |
---|
| 203 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 204 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 205 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 206 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
| 207 | /* These must appear regardless of . */ |
---|
| 208 | |
---|
| 209 | PROVIDE (end_of_all = .); |
---|
| 210 | } |
---|