[34] | 1 | #include <asm/config.h> |
---|
| 2 | #include <asm/page.h> |
---|
| 3 | #include <asm/percpu.h> |
---|
| 4 | |
---|
| 5 | /* Script for -z combreloc: combine and sort reloc sections */ |
---|
| 6 | OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", |
---|
| 7 | "elf64-powerpc") |
---|
| 8 | OUTPUT_ARCH(powerpc:common64) |
---|
| 9 | ENTRY(_start) |
---|
| 10 | SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); |
---|
| 11 | /* Do we need any of these for elf? |
---|
| 12 | __DYNAMIC = 0; */ |
---|
| 13 | PHDRS |
---|
| 14 | { |
---|
| 15 | text PT_LOAD; |
---|
| 16 | } |
---|
| 17 | SECTIONS |
---|
| 18 | { |
---|
| 19 | . = 0x00400000; |
---|
| 20 | PROVIDE(_text = .); |
---|
| 21 | PROVIDE(_stext = .); |
---|
| 22 | /* Read-only sections, merged into text segment: */ |
---|
| 23 | .interp : { *(.interp) } :text |
---|
| 24 | .hash : { *(.hash) } |
---|
| 25 | .dynsym : { *(.dynsym) } |
---|
| 26 | .dynstr : { *(.dynstr) } |
---|
| 27 | .gnu.version : { *(.gnu.version) } |
---|
| 28 | .gnu.version_d : { *(.gnu.version_d) } |
---|
| 29 | .gnu.version_r : { *(.gnu.version_r) } |
---|
| 30 | .rel.dyn : |
---|
| 31 | { |
---|
| 32 | *(.rel.init) |
---|
| 33 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) |
---|
| 34 | *(.rel.fini) |
---|
| 35 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) |
---|
| 36 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) |
---|
| 37 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) |
---|
| 38 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) |
---|
| 39 | *(.rel.ctors) |
---|
| 40 | *(.rel.dtors) |
---|
| 41 | *(.rel.got) |
---|
| 42 | *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) |
---|
| 43 | *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) |
---|
| 44 | *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) |
---|
| 45 | *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) |
---|
| 46 | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) |
---|
| 47 | } |
---|
| 48 | .rela.dyn : |
---|
| 49 | { |
---|
| 50 | *(.rela.init) |
---|
| 51 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
---|
| 52 | *(.rela.fini) |
---|
| 53 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
---|
| 54 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
---|
| 55 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
---|
| 56 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
---|
| 57 | *(.rela.ctors) |
---|
| 58 | *(.rela.dtors) |
---|
| 59 | *(.rela.got) |
---|
| 60 | *(.rela.toc) |
---|
| 61 | *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) |
---|
| 62 | *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) |
---|
| 63 | *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) |
---|
| 64 | *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) |
---|
| 65 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
---|
| 66 | } |
---|
| 67 | .rel.plt : { *(.rel.plt) } |
---|
| 68 | .rela.plt : { *(.rela.plt) } |
---|
| 69 | .rela.tocbss : { *(.rela.tocbss) } |
---|
| 70 | .init : |
---|
| 71 | { |
---|
| 72 | KEEP (*(.init)) |
---|
| 73 | } =0x60000000 |
---|
| 74 | .text : |
---|
| 75 | { |
---|
| 76 | *(.text .stub .text.* .gnu.linkonce.t.*) |
---|
| 77 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
| 78 | *(.gnu.warning) |
---|
| 79 | *(.sfpr .glink) |
---|
| 80 | } =0x60000000 |
---|
| 81 | .fini : |
---|
| 82 | { |
---|
| 83 | KEEP (*(.fini)) |
---|
| 84 | } =0x60000000 |
---|
| 85 | PROVIDE (__etext = .); |
---|
| 86 | PROVIDE (_etext = .); |
---|
| 87 | PROVIDE (etext = .); |
---|
| 88 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } |
---|
| 89 | .rodata1 : { *(.rodata1) } |
---|
| 90 | .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } |
---|
| 91 | .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } |
---|
| 92 | .eh_frame_hdr : { *(.eh_frame_hdr) } |
---|
| 93 | /* Adjust the address for the data segment. We want to adjust up to |
---|
| 94 | the same address within the page on the next page up. */ |
---|
| 95 | . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000); |
---|
| 96 | /* Ensure the __preinit_array_start label is properly aligned. We |
---|
| 97 | could instead move the label definition inside the section, but |
---|
| 98 | the linker would then create the section even if it turns out to |
---|
| 99 | be empty, which isn't pretty. */ |
---|
| 100 | . = ALIGN(64 / 8); |
---|
| 101 | PROVIDE (__preinit_array_start = .); |
---|
| 102 | .preinit_array : { *(.preinit_array) } |
---|
| 103 | PROVIDE (__preinit_array_end = .); |
---|
| 104 | PROVIDE (__init_array_start = .); |
---|
| 105 | .init_array : { *(.init_array) } |
---|
| 106 | PROVIDE (__init_array_end = .); |
---|
| 107 | PROVIDE (__fini_array_start = .); |
---|
| 108 | .fini_array : { *(.fini_array) } |
---|
| 109 | PROVIDE (__fini_array_end = .); |
---|
| 110 | .data : |
---|
| 111 | { |
---|
| 112 | *(.data .gnu.linkonce.d.*) |
---|
| 113 | SORT(CONSTRUCTORS) |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | . = ALIGN(4096); |
---|
| 117 | __init_begin = .; |
---|
| 118 | _sinittext = .; |
---|
| 119 | .init.text : { *(.init.text) } : text |
---|
| 120 | _einittext = .; |
---|
| 121 | .init.data : { *(.init.data) } : text |
---|
| 122 | . = ALIGN(32); |
---|
| 123 | __setup_start = .; |
---|
| 124 | .init.setup : { *(.init.setup) } : text |
---|
| 125 | __setup_end = .; |
---|
| 126 | __initcall_start = .; |
---|
| 127 | .initcall.init : { *(.initcall1.init) } : text |
---|
| 128 | __initcall_end = .; |
---|
| 129 | __init_hcall_start = .; |
---|
| 130 | .init_hcall.init : { *(.init_hcall.init) } : text |
---|
| 131 | __init_hcall_end = .; |
---|
| 132 | __builtin_cmdline : { *(__builtin_cmdline) } : text |
---|
| 133 | . = ALIGN(4096); |
---|
| 134 | __init_end = .; |
---|
| 135 | |
---|
| 136 | __per_cpu_start = .; |
---|
| 137 | .data.percpu : { *(.data.percpu) } |
---|
| 138 | __per_cpu_data_end = .; |
---|
| 139 | . = __per_cpu_start + (NR_CPUS << PERCPU_SHIFT); |
---|
| 140 | . = ALIGN(STACK_SIZE); |
---|
| 141 | __per_cpu_end = .; |
---|
| 142 | |
---|
| 143 | .data1 : { *(.data1) } |
---|
| 144 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } |
---|
| 145 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } |
---|
| 146 | .eh_frame : { KEEP (*(.eh_frame)) } |
---|
| 147 | .gcc_except_table : { *(.gcc_except_table) } |
---|
| 148 | .toc1 ALIGN(8) : { *(.toc1) } |
---|
| 149 | .opd ALIGN(8) : { KEEP (*(.opd)) } |
---|
| 150 | .dynamic : { *(.dynamic) } |
---|
| 151 | .ctors : |
---|
| 152 | { |
---|
| 153 | /* gcc uses crtbegin.o to find the start of |
---|
| 154 | the constructors, so we make sure it is |
---|
| 155 | first. Because this is a wildcard, it |
---|
| 156 | doesn't matter if the user does not |
---|
| 157 | actually link against crtbegin.o; the |
---|
| 158 | linker won't look for a file to match a |
---|
| 159 | wildcard. The wildcard also means that it |
---|
| 160 | doesn't matter which directory crtbegin.o |
---|
| 161 | is in. */ |
---|
| 162 | KEEP (*crtbegin*.o(.ctors)) |
---|
| 163 | /* We don't want to include the .ctor section from |
---|
| 164 | from the crtend.o file until after the sorted ctors. |
---|
| 165 | The .ctor section from the crtend file contains the |
---|
| 166 | end of ctors marker and it must be last */ |
---|
| 167 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) |
---|
| 168 | KEEP (*(SORT(.ctors.*))) |
---|
| 169 | KEEP (*(.ctors)) |
---|
| 170 | } |
---|
| 171 | .dtors : |
---|
| 172 | { |
---|
| 173 | KEEP (*crtbegin*.o(.dtors)) |
---|
| 174 | KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) |
---|
| 175 | KEEP (*(SORT(.dtors.*))) |
---|
| 176 | KEEP (*(.dtors)) |
---|
| 177 | } |
---|
| 178 | .jcr : { KEEP (*(.jcr)) } |
---|
| 179 | .got ALIGN(8) : { *(.got .toc) } |
---|
| 180 | /* We want the small data sections together, so single-instruction offsets |
---|
| 181 | can access them all, and initialized data all before uninitialized, so |
---|
| 182 | we can shorten the on-disk segment size. */ |
---|
| 183 | .sdata : |
---|
| 184 | { |
---|
| 185 | *(.sdata .sdata.* .gnu.linkonce.s.*) |
---|
| 186 | } |
---|
| 187 | _edata = .; |
---|
| 188 | PROVIDE (edata = .); |
---|
| 189 | __bss_start = .; |
---|
| 190 | .tocbss ALIGN(8) : { *(.tocbss)} |
---|
| 191 | .sbss : |
---|
| 192 | { |
---|
| 193 | PROVIDE (__sbss_start = .); |
---|
| 194 | PROVIDE (___sbss_start = .); |
---|
| 195 | *(.dynsbss) |
---|
| 196 | *(.sbss .sbss.* .gnu.linkonce.sb.*) |
---|
| 197 | *(.scommon) |
---|
| 198 | PROVIDE (__sbss_end = .); |
---|
| 199 | PROVIDE (___sbss_end = .); |
---|
| 200 | } |
---|
| 201 | .plt : { *(.plt) } |
---|
| 202 | .bss : |
---|
| 203 | { |
---|
| 204 | *(.dynbss) |
---|
| 205 | *(.bss .bss.* .gnu.linkonce.b.*) |
---|
| 206 | *(COMMON) |
---|
| 207 | /* Align here to ensure that the .bss section occupies space up to |
---|
| 208 | _end. Align after .bss to ensure correct alignment even if the |
---|
| 209 | .bss section disappears because there are no input sections. */ |
---|
| 210 | . = ALIGN(64 / 8); |
---|
| 211 | } |
---|
| 212 | . = ALIGN(64 / 8); |
---|
| 213 | _end = .; |
---|
| 214 | PROVIDE (end = .); |
---|
| 215 | . = DATA_SEGMENT_END (.); |
---|
| 216 | /* Stabs debugging sections. */ |
---|
| 217 | .stab 0 : { *(.stab) } |
---|
| 218 | .stabstr 0 : { *(.stabstr) } |
---|
| 219 | .stab.excl 0 : { *(.stab.excl) } |
---|
| 220 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
| 221 | .stab.index 0 : { *(.stab.index) } |
---|
| 222 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
| 223 | .comment 0 : { *(.comment) } |
---|
| 224 | /* DWARF debug sections. |
---|
| 225 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
| 226 | of the section so we begin them at 0. */ |
---|
| 227 | /* DWARF 1 */ |
---|
| 228 | .debug 0 : { *(.debug) } |
---|
| 229 | .line 0 : { *(.line) } |
---|
| 230 | /* GNU DWARF 1 extensions */ |
---|
| 231 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 232 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 233 | /* DWARF 1.1 and DWARF 2 */ |
---|
| 234 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 235 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 236 | /* DWARF 2 */ |
---|
| 237 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
---|
| 238 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 239 | .debug_line 0 : { *(.debug_line) } |
---|
| 240 | .debug_frame 0 : { *(.debug_frame) } |
---|
| 241 | .debug_str 0 : { *(.debug_str) } |
---|
| 242 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 243 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 244 | /* SGI/MIPS DWARF 2 extensions */ |
---|
| 245 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 246 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 247 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 248 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
| 249 | /DISCARD/ : { *(.note.GNU-stack) } |
---|
| 250 | } |
---|