[3c6fe2e] | 1 | /* |
---|
| 2 | * This file contains directives for the GNU linker which are specific |
---|
| 3 | * to the 405GP/EX |
---|
| 4 | * This file is intended to be used together with dlentry.s |
---|
| 5 | * it will generate downloadable code |
---|
| 6 | * |
---|
| 7 | * Modifications for gen405 by Dennis Ehlin |
---|
| 8 | * Modifications for virtex by Keith, Greg, and Bob |
---|
| 9 | * Modifications for 405GP/EX by Michael Hamel |
---|
| 10 | */ |
---|
| 11 | |
---|
| 12 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
---|
| 13 | OUTPUT_ARCH(powerpc) |
---|
| 14 | ENTRY(download_entry) |
---|
[be7ee65] | 15 | EXTERN(__vectors) |
---|
[3c6fe2e] | 16 | |
---|
[284ed06a] | 17 | RamBase = DEFINED(RamBase) ? RamBase : 0; |
---|
| 18 | RamSize = DEFINED(RamSize) ? RamSize : 256M; |
---|
| 19 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
| 20 | |
---|
[3c6fe2e] | 21 | MEMORY { |
---|
| 22 | RAM : ORIGIN = 0, LENGTH = 256M |
---|
| 23 | /*FLASH : ORIGIN = 0xFFE00000, LENGTH = 16M*/ |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | SECTIONS |
---|
| 28 | { |
---|
| 29 | /* First 16K is occupied by exception vectors and anything else we want to put there */ |
---|
| 30 | .text 0x4000: |
---|
| 31 | { |
---|
| 32 | text.start = . ; |
---|
| 33 | *(.entry) |
---|
| 34 | *(.entry2) |
---|
| 35 | *(.text*) |
---|
| 36 | *(.rodata*) |
---|
| 37 | *(.rodata1) |
---|
[b618d8c] | 38 | KEEP (*(SORT(.rtemsroset.*))) |
---|
[3c6fe2e] | 39 | |
---|
| 40 | /* |
---|
| 41 | * Special FreeBSD sysctl sections. |
---|
| 42 | */ |
---|
| 43 | . = ALIGN (16); |
---|
| 44 | __start_set_sysctl_set = .; |
---|
| 45 | *(set_sysctl_*); |
---|
| 46 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 47 | *(set_domain_*); |
---|
| 48 | *(set_pseudo_*); |
---|
| 49 | |
---|
| 50 | /* C++ constructors/destructors */ |
---|
| 51 | *(.gnu.linkonce.t*) |
---|
| 52 | |
---|
| 53 | /* Initialization and finalization code. |
---|
| 54 | * |
---|
| 55 | * Various files can provide initialization and finalization functions. |
---|
| 56 | * The bodies of these functions are in .init and .fini sections. We |
---|
| 57 | * accumulate the bodies here, and prepend function prologues from |
---|
| 58 | * ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked |
---|
| 59 | * first; ecrtn.o must be linked last. Because these are wildcards, it |
---|
| 60 | * doesn't matter if the user does not actually link against ecrti.o and |
---|
| 61 | * ecrtn.o; the linker won't look for a file to match a wildcard. The |
---|
| 62 | * wildcard also means that it doesn't matter which directory ecrti.o |
---|
| 63 | * and ecrtn.o are in. |
---|
| 64 | */ |
---|
| 65 | PROVIDE (_init = .); |
---|
| 66 | *ecrti.o(.init) |
---|
| 67 | *(.init) |
---|
| 68 | *ecrtn.o(.init) |
---|
| 69 | |
---|
| 70 | PROVIDE (_fini = .); |
---|
| 71 | *ecrti.o(.fini) |
---|
| 72 | *(.fini) |
---|
| 73 | *ecrtn.o(.init) |
---|
| 74 | |
---|
| 75 | /* |
---|
| 76 | * C++ constructors and destructors for static objects. |
---|
| 77 | * PowerPC EABI does not use crtstuff yet, so we build "old-style" |
---|
[612297e8] | 78 | * constructor and destructor lists that begin with the list length |
---|
[3c6fe2e] | 79 | * end terminate with a NULL entry. |
---|
| 80 | */ |
---|
| 81 | |
---|
| 82 | PROVIDE (__CTOR_LIST__ = .); |
---|
| 83 | *crtbegin.o(.ctors) |
---|
| 84 | *(.ctors) |
---|
| 85 | *crtend.o(.ctors) |
---|
| 86 | LONG(0) |
---|
| 87 | PROVIDE (__CTOR_END__ = .); |
---|
| 88 | |
---|
| 89 | PROVIDE (__DTOR_LIST__ = .); |
---|
| 90 | *crtbegin.o(.dtors) |
---|
| 91 | *(.dtors) |
---|
| 92 | *crtend.o(.dtors) |
---|
| 93 | LONG(0) |
---|
| 94 | PROVIDE (__DTOR_END__ = .); |
---|
| 95 | |
---|
| 96 | /* Exception frame info */ |
---|
| 97 | *(.eh_frame) |
---|
| 98 | /* Miscellaneous read-only data */ |
---|
| 99 | _rodata_start = . ; |
---|
| 100 | *(.gnu.linkonce.r*) |
---|
| 101 | *(.lit) |
---|
| 102 | *(.shdata) |
---|
| 103 | *(.rodata) |
---|
| 104 | *(.rodata1) |
---|
| 105 | *(.descriptors) |
---|
| 106 | *(rom_ver) |
---|
| 107 | _erodata = .; |
---|
| 108 | |
---|
| 109 | PROVIDE (__EXCEPT_START__ = .); |
---|
| 110 | *(.gcc_except_table*) |
---|
| 111 | PROVIDE (__EXCEPT_END__ = .); |
---|
| 112 | __GOT_START__ = .; |
---|
| 113 | s.got = .; |
---|
| 114 | *(.got.plt) |
---|
| 115 | *(.got) |
---|
| 116 | *(.got1) |
---|
| 117 | PROVIDE (__GOT2_START__ = .); |
---|
| 118 | PROVIDE (_GOT2_START_ = .); |
---|
| 119 | *(.got2) |
---|
| 120 | PROVIDE (__GOT2_END__ = .); |
---|
| 121 | PROVIDE (_GOT2_END_ = .); |
---|
| 122 | |
---|
| 123 | PROVIDE (__FIXUP_START__ = .); |
---|
| 124 | PROVIDE (_FIXUP_START_ = .); |
---|
| 125 | *(.fixup) |
---|
| 126 | PROVIDE (_FIXUP_END_ = .); |
---|
| 127 | PROVIDE (__FIXUP_END__ = .); |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | /* Various possible names for the end of the .text section */ |
---|
| 131 | etext = ALIGN(0x10); |
---|
| 132 | _etext = .; |
---|
| 133 | |
---|
| 134 | *(.lit) |
---|
| 135 | *(.shdata) |
---|
| 136 | _endtext = ALIGN(0x10); |
---|
| 137 | text.end = .; |
---|
| 138 | text.size = text.end - text.start; |
---|
| 139 | } >RAM |
---|
| 140 | |
---|
| 141 | text.size = text.end - text.start; |
---|
| 142 | |
---|
[960fd85] | 143 | .tdata : { |
---|
| 144 | _TLS_Data_begin = .; |
---|
| 145 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
| 146 | _TLS_Data_end = .; |
---|
| 147 | } >RAM |
---|
| 148 | |
---|
| 149 | .tbss : { |
---|
| 150 | _TLS_BSS_begin = .; |
---|
| 151 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
| 152 | _TLS_BSS_end = .; |
---|
| 153 | } >RAM |
---|
| 154 | |
---|
| 155 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
[d60e760] | 156 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
| 157 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
[960fd85] | 158 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
| 159 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
[d60e760] | 160 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
[960fd85] | 161 | |
---|
[3c6fe2e] | 162 | .jcr : { KEEP (*(.jcr)) } >RAM |
---|
| 163 | |
---|
| 164 | .rel.dyn : { |
---|
| 165 | *(.rel.init) |
---|
| 166 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) |
---|
| 167 | *(.rel.fini) |
---|
| 168 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) |
---|
| 169 | *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) |
---|
| 170 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) |
---|
| 171 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) |
---|
| 172 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) |
---|
| 173 | *(.rel.ctors) |
---|
| 174 | *(.rel.dtors) |
---|
| 175 | *(.rel.got) |
---|
| 176 | *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) |
---|
| 177 | *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) |
---|
| 178 | *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) |
---|
| 179 | *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) |
---|
| 180 | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) |
---|
| 181 | } >RAM |
---|
| 182 | .rela.dyn : { |
---|
| 183 | *(.rela.init) |
---|
| 184 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
---|
| 185 | *(.rela.fini) |
---|
| 186 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
---|
| 187 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
---|
| 188 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
---|
| 189 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
---|
| 190 | *(.rela.ctors) |
---|
| 191 | *(.rela.dtors) |
---|
| 192 | *(.rela.got) |
---|
| 193 | *(.rela.got1) |
---|
| 194 | *(.rela.got2) |
---|
| 195 | *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) |
---|
| 196 | *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) |
---|
| 197 | *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) |
---|
| 198 | *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) |
---|
| 199 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
---|
| 200 | } >RAM |
---|
| 201 | |
---|
| 202 | |
---|
| 203 | /* Initialised large data */ |
---|
| 204 | .data ( . ) : |
---|
| 205 | { |
---|
| 206 | . = ALIGN (4); |
---|
| 207 | data.start = .; |
---|
| 208 | *(.data) |
---|
| 209 | *(.data1) |
---|
[b618d8c] | 210 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
[3c6fe2e] | 211 | *(.data.* .gnu.linkonce.d.*) |
---|
| 212 | data.end = .; |
---|
| 213 | } > RAM |
---|
| 214 | |
---|
| 215 | /* Initialised small data addressed as offsets from r13 */ |
---|
| 216 | .sdata : { |
---|
| 217 | . = ALIGN (4); |
---|
| 218 | PROVIDE (__SDATA_START__ = .); |
---|
| 219 | sdata.start = .; |
---|
| 220 | *(.sdata*) |
---|
| 221 | *(.gnu.linkonce.s.*) |
---|
| 222 | sdata.end = .; |
---|
| 223 | } > RAM |
---|
| 224 | |
---|
| 225 | /* Zeroed small data addressed as offsets from r13 */ |
---|
| 226 | .sbss : { |
---|
| 227 | . = ALIGN (4); |
---|
| 228 | PROVIDE(__SBSS_START__ = .); |
---|
| 229 | sbss.start = .; |
---|
[2787a05] | 230 | *(.sbss .sbss.* *.gnu.linkonce.sb.*); |
---|
[3c6fe2e] | 231 | sbss.end = .; |
---|
| 232 | } > RAM |
---|
| 233 | PROVIDE(__SBSS_END__ = .); |
---|
| 234 | |
---|
| 235 | /* Zeroed large data */ |
---|
| 236 | .bss : { |
---|
| 237 | . = ALIGN (4); |
---|
| 238 | bss.start = .; |
---|
| 239 | *(.bss .bss* .gnu.linkonce.b*) |
---|
| 240 | . = ALIGN(4); |
---|
| 241 | bss.end = .; |
---|
| 242 | } > RAM |
---|
| 243 | |
---|
| 244 | bss.size = bss.end - bss.start; |
---|
| 245 | sbss.size = sbss.end - sbss.start; |
---|
| 246 | |
---|
[715d616] | 247 | .rtemsstack (NOLOAD) : { |
---|
| 248 | *(SORT(.rtemsstack.*)) |
---|
| 249 | } >RAM |
---|
| 250 | |
---|
| 251 | WorkAreaBase = .; |
---|
[3c6fe2e] | 252 | |
---|
| 253 | /* Debugging information */ |
---|
| 254 | .line 0 : { *(.line) } |
---|
| 255 | .debug 0 : { *(.debug) } |
---|
| 256 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 257 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 258 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 259 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 260 | .debug_aregion 0 : { *(.debug_aregion) } |
---|
| 261 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 262 | .stab 0 : { *(.stab) } |
---|
| 263 | .stabstr 0 : { *(.stabstr) } |
---|
| 264 | } |
---|