[5edbffe] | 1 | /* |
---|
| 2 | * This file contains directives for the GNU linker which are specific |
---|
| 3 | * to the MPC8260ADS Board |
---|
| 4 | * |
---|
| 5 | * $Id$ |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", |
---|
| 9 | "elf32-powerpc") |
---|
| 10 | OUTPUT_ARCH(powerpc) |
---|
| 11 | SEARCH_DIR(/usr/local/rtems/powerpc-rtems/lib); |
---|
| 12 | |
---|
| 13 | ENTRY(start) |
---|
| 14 | |
---|
| 15 | /* |
---|
| 16 | * Declare some sizes. |
---|
| 17 | * XXX: The assignment of ". += XyzSize;" fails in older gld's if the |
---|
| 18 | * number used there is not constant. If this happens to you, edit |
---|
| 19 | * the lines marked XXX below to use a constant value. |
---|
| 20 | */ |
---|
| 21 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x400000; /* 4M Heap */ |
---|
| 22 | StackSize = DEFINED(StackSize) ? StackSize : 0x8000; |
---|
| 23 | WorkSpaceSize = DEFINED(WorkSpaceSize) ? WorkSpaceSize : 0x80000; /* 512k */ |
---|
| 24 | RamDiskSize = DEFINED(RamDiskSize) ? RamDiskSize : 0x0800000; /* 8M ram disk */ |
---|
| 25 | |
---|
| 26 | MEMORY |
---|
| 27 | { |
---|
| 28 | ram : org = 0x0, l = 16M |
---|
| 29 | dpram : org = 0x04700000, l = 128K |
---|
| 30 | flash : org = 0xff800000, l = 8M |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | SECTIONS |
---|
| 35 | { |
---|
| 36 | |
---|
| 37 | /* |
---|
| 38 | * The stack will live in this area - between the vectors and |
---|
| 39 | * the text section. |
---|
| 40 | */ |
---|
| 41 | |
---|
| 42 | .text 0x10000: |
---|
| 43 | { |
---|
| 44 | _textbase = .; |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | text.start = .; |
---|
| 48 | |
---|
| 49 | /* Entry point is the .entry section */ |
---|
| 50 | *(.entry) |
---|
| 51 | *(.entry2) |
---|
| 52 | |
---|
| 53 | /* Actual Code */ |
---|
| 54 | *(.text) |
---|
| 55 | *(.text.*) |
---|
| 56 | |
---|
| 57 | |
---|
[85c92574] | 58 | *(.rodata*) |
---|
[5edbffe] | 59 | *(.rodata1) |
---|
| 60 | |
---|
| 61 | /* C++ constructors/destructors */ |
---|
| 62 | *(.gnu.linkonce.t*) |
---|
| 63 | |
---|
| 64 | /* Initialization and finalization code. |
---|
| 65 | * |
---|
| 66 | * Various files can provide initialization and finalization functions. |
---|
| 67 | * The bodies of these functions are in .init and .fini sections. We |
---|
| 68 | * accumulate the bodies here, and prepend function prologues from |
---|
| 69 | * ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked |
---|
| 70 | * first; ecrtn.o must be linked last. Because these are wildcards, it |
---|
| 71 | * doesn't matter if the user does not actually link against ecrti.o and |
---|
| 72 | * ecrtn.o; the linker won't look for a file to match a wildcard. The |
---|
| 73 | * wildcard also means that it doesn't matter which directory ecrti.o |
---|
| 74 | * and ecrtn.o are in. |
---|
| 75 | */ |
---|
| 76 | PROVIDE (_init = .); |
---|
| 77 | *ecrti.o(.init) |
---|
| 78 | *(.init) |
---|
| 79 | *ecrtn.o(.init) |
---|
| 80 | |
---|
| 81 | PROVIDE (_fini = .); |
---|
| 82 | *ecrti.o(.fini) |
---|
| 83 | *(.fini) |
---|
| 84 | *ecrtn.o(.init) |
---|
| 85 | |
---|
| 86 | /* |
---|
| 87 | * C++ constructors and destructors for static objects. |
---|
| 88 | * PowerPC EABI does not use crtstuff yet, so we build "old-style" |
---|
| 89 | * constructor and destructor lists that begin with the list lenght |
---|
| 90 | * end terminate with a NULL entry. |
---|
| 91 | */ |
---|
| 92 | |
---|
| 93 | PROVIDE (__CTOR_LIST__ = .); |
---|
| 94 | /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */ |
---|
| 95 | *crtbegin.o(.ctors) |
---|
| 96 | *(.ctors) |
---|
| 97 | *crtend.o(.ctors) |
---|
| 98 | LONG(0) |
---|
| 99 | PROVIDE (__CTOR_END__ = .); |
---|
| 100 | |
---|
| 101 | PROVIDE (__DTOR_LIST__ = .); |
---|
| 102 | /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */ |
---|
| 103 | *crtbegin.o(.dtors) |
---|
| 104 | *(.dtors) |
---|
| 105 | *crtend.o(.dtors) |
---|
| 106 | LONG(0) |
---|
| 107 | PROVIDE (__DTOR_END__ = .); |
---|
| 108 | |
---|
| 109 | /* Exception frame info */ |
---|
| 110 | *(.eh_frame) |
---|
| 111 | |
---|
| 112 | /* Miscellaneous read-only data */ |
---|
| 113 | _rodata_start = . ; |
---|
| 114 | *(.gnu.linkonce.r*) |
---|
| 115 | *(.lit) |
---|
| 116 | *(.shdata) |
---|
| 117 | *(.rodata) |
---|
| 118 | *(.rodata1) |
---|
| 119 | *(.descriptors) |
---|
| 120 | *(rom_ver) |
---|
| 121 | _erodata = .; |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | /* Various possible names for the end of the .text section */ |
---|
| 125 | etext = ALIGN(0x10); |
---|
| 126 | _etext = .; |
---|
| 127 | _endtext = .; |
---|
| 128 | text.end = .; |
---|
| 129 | PROVIDE (etext = .); |
---|
| 130 | PROVIDE (__etext = .); |
---|
| 131 | |
---|
| 132 | } > ram |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | PROVIDE (__EXCEPT_START__ = .); |
---|
| 136 | .gcc_except_table : { *(.gcc_except_table) } >RAM |
---|
| 137 | PROVIDE (__EXCEPT_END__ = .); |
---|
| 138 | __GOT_START__ = .; |
---|
| 139 | .got : |
---|
| 140 | { |
---|
| 141 | s.got = .; |
---|
| 142 | *(.got.plt) *(.got) |
---|
| 143 | } > ram |
---|
| 144 | __GOT_END__ = .; |
---|
| 145 | |
---|
| 146 | .got1 : { *(.got1) } >ram |
---|
| 147 | PROVIDE (__GOT2_START__ = .); |
---|
| 148 | PROVIDE (_GOT2_START_ = .); |
---|
| 149 | .got2 : { *(.got2) } >ram |
---|
| 150 | PROVIDE (__GOT2_END__ = .); |
---|
| 151 | PROVIDE (_GOT2_END_ = .); |
---|
| 152 | |
---|
| 153 | PROVIDE (__FIXUP_START__ = .); |
---|
| 154 | PROVIDE (_FIXUP_START_ = .); |
---|
| 155 | .fixup : { *(.fixup) } >ram |
---|
| 156 | PROVIDE (_FIXUP_END_ = .); |
---|
| 157 | PROVIDE (__FIXUP_END__ = .); |
---|
| 158 | |
---|
| 159 | PROVIDE (__SDATA2_START__ = .); |
---|
[85c92574] | 160 | .sdata2 : { *(.sdata2) *(.gnu.linkonce.s2.*) } >ram |
---|
| 161 | .sbss2 : { *(.sbss2) *(.gnu.linkonce.sb2.*) } >ram |
---|
[5edbffe] | 162 | PROVIDE (__SBSS2_END__ = .); |
---|
| 163 | |
---|
| 164 | .sbss2 : { *(.sbss2) } >ram |
---|
| 165 | PROVIDE (__SBSS2_END__ = .); |
---|
| 166 | |
---|
| 167 | __SBSS_START__ = .; |
---|
| 168 | .bss : |
---|
| 169 | { |
---|
| 170 | bss.start = .; |
---|
| 171 | *(.bss) *(.sbss) *(COMMON) |
---|
| 172 | . = ALIGN(4); |
---|
| 173 | bss.end = .; |
---|
| 174 | } > ram |
---|
| 175 | __SBSS_END__ = .; |
---|
| 176 | |
---|
| 177 | |
---|
| 178 | |
---|
| 179 | |
---|
| 180 | |
---|
| 181 | /* R/W Data */ |
---|
| 182 | .data ( . ) : |
---|
| 183 | { |
---|
| 184 | . = ALIGN (4); |
---|
| 185 | |
---|
| 186 | data.start = .; |
---|
| 187 | |
---|
| 188 | *(.data) |
---|
| 189 | *(.data1) |
---|
| 190 | *(.gnu.linkonce.d.*) |
---|
| 191 | PROVIDE (__SDATA_START__ = .); |
---|
| 192 | *(.sdata) |
---|
[85c92574] | 193 | *(.gnu.linkonce.s.*) |
---|
[5edbffe] | 194 | data.end = .; |
---|
| 195 | } > ram |
---|
| 196 | |
---|
| 197 | data.size = data.end - data.start; |
---|
| 198 | bss.size = bss.end - bss.start; |
---|
| 199 | text.size = text.end - text.start; |
---|
| 200 | |
---|
| 201 | PROVIDE(_end = data.end); |
---|
| 202 | |
---|
| 203 | .gzipmalloc : { |
---|
| 204 | . = ALIGN (16); |
---|
| 205 | _startmalloc = .; |
---|
| 206 | } >ram |
---|
| 207 | |
---|
| 208 | |
---|
| 209 | /* |
---|
| 210 | * Interrupt stack setup |
---|
| 211 | */ |
---|
| 212 | IntrStack_start = ALIGN(0x10); |
---|
| 213 | . += 0x4000; |
---|
| 214 | intrStack = .; |
---|
| 215 | PROVIDE(intrStackPtr = intrStack); |
---|
| 216 | |
---|
| 217 | |
---|
| 218 | _HeapStart = .; |
---|
| 219 | __HeapStart = .; |
---|
| 220 | . += HeapSize; |
---|
| 221 | _HeapEnd = .; |
---|
| 222 | __HeapEnd = .; |
---|
| 223 | |
---|
| 224 | clear_end = .; |
---|
| 225 | |
---|
| 226 | |
---|
| 227 | _WorkspaceBase = .; |
---|
| 228 | __WorkspaceBase = .; |
---|
| 229 | . += WorkSpaceSize; |
---|
| 230 | |
---|
| 231 | |
---|
| 232 | _RamDiskBase = .; |
---|
| 233 | __RamDiskBase = .; |
---|
| 234 | . += RamDiskSize; |
---|
| 235 | _RamDiskEnd = .; |
---|
| 236 | __RamDiskEnd = .; |
---|
| 237 | PROVIDE( _RamDiskSize = _RamDiskEnd - _RamDiskBase ); |
---|
| 238 | |
---|
| 239 | /* Sections for compressed .text and .data */ |
---|
| 240 | /* after the .datarom section is an int specifying */ |
---|
| 241 | /* the length of the following compressed image */ |
---|
| 242 | /* Executes once then could get overwritten */ |
---|
| 243 | .textrom 0x100000 : |
---|
| 244 | { |
---|
| 245 | *(.textrom) |
---|
| 246 | _endloader = .; |
---|
| 247 | } > ram |
---|
| 248 | |
---|
| 249 | .datarom : |
---|
| 250 | { |
---|
| 251 | _dr_start = .; |
---|
| 252 | *(.datarom) |
---|
| 253 | _dr_end = .; |
---|
| 254 | } > ram |
---|
| 255 | dr_len = _dr_end - _dr_start; |
---|
| 256 | |
---|
| 257 | .dpram : |
---|
| 258 | { |
---|
| 259 | m8260 = .; |
---|
| 260 | _m8260 = .; |
---|
| 261 | . += (128 * 1024); |
---|
| 262 | } > dpram |
---|
| 263 | |
---|
| 264 | |
---|
| 265 | /* the reset vector is at 0xfff00000 which is */ |
---|
| 266 | /* located at offset 0x400000 from the base */ |
---|
| 267 | /* of flash */ |
---|
| 268 | .bootrom 0xFFF00000 : |
---|
| 269 | { |
---|
| 270 | *(.bootrom) |
---|
| 271 | _endboot = .; |
---|
| 272 | } > flash |
---|
| 273 | |
---|
| 274 | |
---|
| 275 | .line 0 : { *(.line) } |
---|
| 276 | .debug 0 : { *(.debug) } |
---|
| 277 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 278 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 279 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 280 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 281 | .debug_aregion 0 : { *(.debug_aregion) } |
---|
| 282 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 283 | .stab 0 : { *(.stab) } |
---|
| 284 | .stabstr 0 : { *(.stabstr) } |
---|
| 285 | } |
---|