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