[574fb67] | 1 | /** |
---|
| 2 | * @file |
---|
| 3 | * |
---|
| 4 | * Derived from internal linker script of GNU ld (GNU Binutils) 2.18 for elf32ppc emulation. |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
---|
| 8 | OUTPUT_ARCH(powerpc) |
---|
| 9 | ENTRY(start) |
---|
| 10 | |
---|
| 11 | INCLUDE linkcmds.memory |
---|
| 12 | |
---|
| 13 | SECTIONS |
---|
| 14 | { |
---|
| 15 | .text : { |
---|
| 16 | /* |
---|
| 17 | * BSP: Start of text section |
---|
| 18 | */ |
---|
| 19 | bsp_section_text_start = .; |
---|
| 20 | |
---|
| 21 | /* |
---|
| 22 | * BSP: System startup entry |
---|
| 23 | */ |
---|
| 24 | KEEP (*(.entry)) |
---|
| 25 | |
---|
| 26 | /* |
---|
| 27 | * BSP: Moved into .text from .init |
---|
| 28 | */ |
---|
| 29 | KEEP (*(.init)) |
---|
| 30 | |
---|
| 31 | *(.text .stub .text.* .gnu.linkonce.t.*) |
---|
| 32 | KEEP (*(.text.*personality*)) |
---|
| 33 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
| 34 | *(.gnu.warning) |
---|
| 35 | *(.glink) |
---|
| 36 | |
---|
| 37 | /* |
---|
| 38 | * BSP: Special FreeBSD sysctl sections |
---|
| 39 | */ |
---|
| 40 | . = ALIGN (16); |
---|
| 41 | __start_set_sysctl_set = .; |
---|
| 42 | *(set_sysctl_*); |
---|
| 43 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 44 | *(set_domain_*); |
---|
| 45 | *(set_pseudo_*); |
---|
| 46 | |
---|
| 47 | /* |
---|
| 48 | * BSP: Moved into .text from .* |
---|
| 49 | */ |
---|
| 50 | *(.rodata .rodata.* .gnu.linkonce.r.*) |
---|
| 51 | *(.rodata1) |
---|
| 52 | *(.interp) |
---|
| 53 | *(.note.gnu.build-id) |
---|
| 54 | *(.hash) |
---|
| 55 | *(.gnu.hash) |
---|
| 56 | *(.dynsym) |
---|
| 57 | *(.dynstr) |
---|
| 58 | *(.gnu.version) |
---|
| 59 | *(.gnu.version_d) |
---|
| 60 | *(.gnu.version_r) |
---|
| 61 | *(.eh_frame_hdr) |
---|
| 62 | |
---|
| 63 | /* |
---|
| 64 | * BSP: Magic PPC stuff |
---|
| 65 | */ |
---|
| 66 | *(.PPC.*) |
---|
| 67 | |
---|
| 68 | /* |
---|
| 69 | * BSP: Required by cpukit/score/src/threadhandler.c |
---|
| 70 | */ |
---|
| 71 | PROVIDE (_fini = .); |
---|
| 72 | |
---|
| 73 | /* |
---|
| 74 | * BSP: Moved into .text from .fini |
---|
| 75 | */ |
---|
| 76 | KEEP (*(.fini)) |
---|
| 77 | |
---|
| 78 | . = ALIGN (bsp_section_align); |
---|
| 79 | |
---|
| 80 | PROVIDE (__etext = .); |
---|
| 81 | PROVIDE (_etext = .); |
---|
| 82 | PROVIDE (etext = .); |
---|
| 83 | } > ROM =0 |
---|
| 84 | |
---|
| 85 | .sdata2 : { |
---|
| 86 | PROVIDE (_SDA2_BASE_ = 32768); |
---|
| 87 | |
---|
| 88 | *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) |
---|
| 89 | |
---|
| 90 | . = ALIGN (bsp_section_align); |
---|
| 91 | } > ROM =0 |
---|
| 92 | |
---|
| 93 | .sbss2 : { |
---|
| 94 | *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) |
---|
| 95 | |
---|
| 96 | . = ALIGN (bsp_section_align); |
---|
| 97 | |
---|
| 98 | /* |
---|
| 99 | * BSP: End of text section |
---|
| 100 | */ |
---|
| 101 | bsp_section_text_end = .; |
---|
| 102 | } > ROM =0 |
---|
| 103 | |
---|
| 104 | .data : AT (bsp_section_text_end) { |
---|
| 105 | /* |
---|
| 106 | * BSP: Start of data section |
---|
| 107 | */ |
---|
| 108 | bsp_section_data_start = .; |
---|
| 109 | |
---|
| 110 | /* |
---|
| 111 | * BSP: Reserve space for exception handler |
---|
| 112 | */ |
---|
| 113 | . = . + 0x180; |
---|
| 114 | |
---|
| 115 | /* |
---|
| 116 | * BSP: Moved into .data from .ctors |
---|
| 117 | */ |
---|
| 118 | /* gcc uses crtbegin.o to find the start of |
---|
| 119 | the constructors, so we make sure it is |
---|
| 120 | first. Because this is a wildcard, it |
---|
| 121 | doesn't matter if the user does not |
---|
| 122 | actually link against crtbegin.o; the |
---|
| 123 | linker won't look for a file to match a |
---|
| 124 | wildcard. The wildcard also means that it |
---|
| 125 | doesn't matter which directory crtbegin.o |
---|
| 126 | is in. */ |
---|
| 127 | KEEP (*crtbegin.o(.ctors)) |
---|
| 128 | KEEP (*crtbegin?.o(.ctors)) |
---|
| 129 | /* We don't want to include the .ctor section from |
---|
| 130 | the crtend.o file until after the sorted ctors. |
---|
| 131 | The .ctor section from the crtend file contains the |
---|
| 132 | end of ctors marker and it must be last */ |
---|
| 133 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) |
---|
| 134 | KEEP (*(SORT(.ctors.*))) |
---|
| 135 | KEEP (*(.ctors)) |
---|
| 136 | |
---|
| 137 | /* |
---|
| 138 | * BSP: Moved into .data from .dtors |
---|
| 139 | */ |
---|
| 140 | KEEP (*crtbegin.o(.dtors)) |
---|
| 141 | KEEP (*crtbegin?.o(.dtors)) |
---|
| 142 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) |
---|
| 143 | KEEP (*(SORT(.dtors.*))) |
---|
| 144 | KEEP (*(.dtors)) |
---|
| 145 | |
---|
| 146 | /* |
---|
| 147 | * BSP: Moved into .data from .* |
---|
| 148 | */ |
---|
| 149 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
| 150 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
| 151 | *(.data1) |
---|
| 152 | KEEP (*(.eh_frame)) |
---|
| 153 | *(.gcc_except_table .gcc_except_table.*) |
---|
| 154 | KEEP (*(.jcr)) |
---|
| 155 | *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) |
---|
| 156 | *(.fixup) |
---|
| 157 | *(.got1) |
---|
| 158 | *(.got2) |
---|
| 159 | *(.dynamic) |
---|
| 160 | *(.got) |
---|
| 161 | *(.plt) |
---|
| 162 | PROVIDE_HIDDEN (__preinit_array_start = .); |
---|
| 163 | KEEP (*(.preinit_array)) |
---|
| 164 | PROVIDE_HIDDEN (__preinit_array_end = .); |
---|
| 165 | PROVIDE_HIDDEN (__init_array_start = .); |
---|
| 166 | KEEP (*(SORT(.init_array.*))) |
---|
| 167 | KEEP (*(.init_array)) |
---|
| 168 | PROVIDE_HIDDEN (__init_array_end = .); |
---|
| 169 | PROVIDE_HIDDEN (__fini_array_start = .); |
---|
| 170 | KEEP (*(.fini_array)) |
---|
| 171 | KEEP (*(SORT(.fini_array.*))) |
---|
| 172 | PROVIDE_HIDDEN (__fini_array_end = .); |
---|
| 173 | |
---|
| 174 | *(.data .data.* .gnu.linkonce.d.*) |
---|
| 175 | KEEP (*(.gnu.linkonce.d.*personality*)) |
---|
| 176 | SORT(CONSTRUCTORS) |
---|
| 177 | |
---|
| 178 | . = ALIGN (bsp_section_align); |
---|
| 179 | } > RAM |
---|
| 180 | |
---|
| 181 | .sdata : { |
---|
| 182 | PROVIDE (_SDA_BASE_ = 32768); |
---|
| 183 | *(.sdata .sdata.* .gnu.linkonce.s.*) |
---|
| 184 | |
---|
| 185 | . = ALIGN (bsp_section_align); |
---|
| 186 | |
---|
| 187 | _edata = .; |
---|
| 188 | PROVIDE (edata = .); |
---|
| 189 | |
---|
| 190 | /* |
---|
| 191 | * BSP: End of data section |
---|
| 192 | */ |
---|
| 193 | bsp_section_data_end = .; |
---|
| 194 | } > RAM |
---|
| 195 | |
---|
| 196 | .sbss : { |
---|
| 197 | /* |
---|
| 198 | * BSP: Start of bss section |
---|
| 199 | */ |
---|
| 200 | bsp_section_bss_start = .; |
---|
| 201 | |
---|
| 202 | __bss_start = .; |
---|
| 203 | |
---|
| 204 | PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .); |
---|
| 205 | *(.scommon) |
---|
| 206 | *(.dynsbss) |
---|
| 207 | *(.sbss .sbss.* .gnu.linkonce.sb.*) |
---|
| 208 | PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); |
---|
| 209 | |
---|
| 210 | . = ALIGN (bsp_section_align); |
---|
| 211 | } > RAM |
---|
| 212 | |
---|
| 213 | .bss : { |
---|
| 214 | *(COMMON) |
---|
| 215 | *(.dynbss) |
---|
| 216 | *(.bss .bss.* .gnu.linkonce.b.*) |
---|
| 217 | |
---|
| 218 | . = ALIGN (bsp_section_align); |
---|
| 219 | |
---|
| 220 | __end = .; |
---|
| 221 | _end = .; |
---|
| 222 | PROVIDE (end = .); |
---|
| 223 | |
---|
| 224 | /* |
---|
| 225 | * BSP: End of bss section |
---|
| 226 | */ |
---|
| 227 | bsp_section_bss_end = .; |
---|
| 228 | } > RAM |
---|
| 229 | |
---|
| 230 | /* Stabs debugging sections. */ |
---|
| 231 | .stab 0 : { *(.stab) } |
---|
| 232 | .stabstr 0 : { *(.stabstr) } |
---|
| 233 | .stab.excl 0 : { *(.stab.excl) } |
---|
| 234 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
| 235 | .stab.index 0 : { *(.stab.index) } |
---|
| 236 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
| 237 | .comment 0 : { *(.comment) } |
---|
| 238 | /* DWARF debug sections. |
---|
| 239 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
| 240 | of the section so we begin them at 0. */ |
---|
| 241 | /* DWARF 1 */ |
---|
| 242 | .debug 0 : { *(.debug) } |
---|
| 243 | .line 0 : { *(.line) } |
---|
| 244 | /* GNU DWARF 1 extensions */ |
---|
| 245 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 246 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 247 | /* DWARF 1.1 and DWARF 2 */ |
---|
| 248 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 249 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 250 | /* DWARF 2 */ |
---|
| 251 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
---|
| 252 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 253 | .debug_line 0 : { *(.debug_line) } |
---|
| 254 | .debug_frame 0 : { *(.debug_frame) } |
---|
| 255 | .debug_str 0 : { *(.debug_str) } |
---|
| 256 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 257 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 258 | /* SGI/MIPS DWARF 2 extensions */ |
---|
| 259 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 260 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 261 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 262 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
| 263 | /* DWARF 3 */ |
---|
| 264 | .debug_pubtypes 0 : { *(.debug_pubtypes) } |
---|
| 265 | .debug_ranges 0 : { *(.debug_ranges) } |
---|
| 266 | .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } |
---|
| 267 | |
---|
| 268 | /DISCARD/ : { |
---|
| 269 | *(.note.GNU-stack) *(.gnu_debuglink) |
---|
| 270 | } |
---|
| 271 | |
---|
| 272 | /* |
---|
| 273 | * BSP: Catch all unknown sections |
---|
| 274 | */ |
---|
| 275 | .nirvana : { |
---|
| 276 | *(*) |
---|
| 277 | } > NIRVANA |
---|
| 278 | } |
---|