ldscript.mips.mips64 revision 217612
1/*- 2 * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of the Juniper Networks, Inc. nor the names of its 14 * contributors may be used to endorse or promote products derived from 15 * this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 30 * $FreeBSD: head/sys/conf/ldscript.mips.mips64 217612 2011-01-19 22:15:12Z jmallett $ 31 */ 32 33OUTPUT_ARCH(mips) 34ENTRY(_start) 35SEARCH_DIR(/usr/lib); 36/* Do we need any of these for elf? 37 __DYNAMIC = 0; 38PROVIDE (_DYNAMIC = 0); 39*/ 40SECTIONS 41{ 42 /* Read-only sections, merged into text segment: */ 43 . = KERNLOADADDR + SIZEOF_HEADERS; 44 .interp : { *(.interp) } 45 .hash : { *(.hash) } 46 .dynsym : { *(.dynsym) } 47 .dynstr : { *(.dynstr) } 48 .gnu.version : { *(.gnu.version) } 49 .gnu.version_d : { *(.gnu.version_d) } 50 .gnu.version_r : { *(.gnu.version_r) } 51 .rel.init : { *(.rel.init) } 52 .rela.init : { *(.rela.init) } 53 .rel.text : 54 { 55 *(.rel.text) 56 *(.rel.text.*) 57 *(.rel.gnu.linkonce.t.*) 58 } 59 .rela.text : 60 { 61 *(.rela.text) 62 *(.rela.text.*) 63 *(.rela.gnu.linkonce.t.*) 64 } 65 .rel.fini : { *(.rel.fini) } 66 .rela.fini : { *(.rela.fini) } 67 .rel.rodata : 68 { 69 *(.rel.rodata) 70 *(.rel.rodata.*) 71 *(.rel.gnu.linkonce.r.*) 72 } 73 .rela.rodata : 74 { 75 *(.rela.rodata) 76 *(.rela.rodata.*) 77 *(.rela.gnu.linkonce.r.*) 78 } 79 .rel.data : 80 { 81 *(.rel.data) 82 *(.rel.data.*) 83 *(.rel.gnu.linkonce.d.*) 84 } 85 .rela.data : 86 { 87 *(.rela.data) 88 *(.rela.data.*) 89 *(.rela.gnu.linkonce.d.*) 90 } 91 .rel.ctors : { *(.rel.ctors) } 92 .rela.ctors : { *(.rela.ctors) } 93 .rel.dtors : { *(.rel.dtors) } 94 .rela.dtors : { *(.rela.dtors) } 95 .rel.got : { *(.rel.got) } 96 .rela.got : { *(.rela.got) } 97 .rel.sdata : 98 { 99 *(.rel.sdata) 100 *(.rel.sdata.*) 101 *(.rel.gnu.linkonce.s.*) 102 } 103 .rela.sdata : 104 { 105 *(.rela.sdata) 106 *(.rela.sdata.*) 107 *(.rela.gnu.linkonce.s.*) 108 } 109 .rel.sbss : 110 { 111 *(.rel.sbss) 112 *(.rel.sbss.*) 113 *(.rel.gnu.linkonce.sb.*) 114 } 115 .rela.sbss : 116 { 117 *(.rela.sbss) 118 *(.rela.sbss.*) 119 *(.rel.gnu.linkonce.sb.*) 120 } 121 .rel.sdata2 : 122 { 123 *(.rel.sdata2) 124 *(.rel.sdata2.*) 125 *(.rel.gnu.linkonce.s2.*) 126 } 127 .rela.sdata2 : 128 { 129 *(.rela.sdata2) 130 *(.rela.sdata2.*) 131 *(.rela.gnu.linkonce.s2.*) 132 } 133 .rel.sbss2 : 134 { 135 *(.rel.sbss2) 136 *(.rel.sbss2.*) 137 *(.rel.gnu.linkonce.sb2.*) 138 } 139 .rela.sbss2 : 140 { 141 *(.rela.sbss2) 142 *(.rela.sbss2.*) 143 *(.rela.gnu.linkonce.sb2.*) 144 } 145 .rel.bss : 146 { 147 *(.rel.bss) 148 *(.rel.bss.*) 149 *(.rel.gnu.linkonce.b.*) 150 } 151 .rela.bss : 152 { 153 *(.rela.bss) 154 *(.rela.bss.*) 155 *(.rela.gnu.linkonce.b.*) 156 } 157 .rel.plt : { *(.rel.plt) } 158 .rela.plt : { *(.rela.plt) } 159 .init : 160 { 161 KEEP (*(.init)) 162 } =0x1000000 163 .text : 164 { 165 *(.trap) 166 *(.text) 167 *(.text.*) 168 *(.stub) 169 /* .gnu.warning sections are handled specially by elf64.em. */ 170 *(.gnu.warning) 171 *(.gnu.linkonce.t.*) 172 } =0x1000000 173 .fini : 174 { 175 KEEP (*(.fini)) 176 } =0x1000000 177 PROVIDE (__etext = .); 178 PROVIDE (_etext = .); 179 PROVIDE (etext = .); 180 .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } 181 .rodata1 : { *(.rodata1) } 182 .reginfo : { *(.reginfo) } 183 .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } 184 .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } 185 . = ALIGN(0x2000) + (. & (0x2000 - 1)); 186 .data : 187 { 188 *(.data) 189 *(.data.*) 190 *(.gnu.linkonce.d.*) 191 SORT(CONSTRUCTORS) 192 } 193 .data1 : { *(.data1) } 194 .eh_frame : { KEEP (*(.eh_frame)) } 195 .gcc_except_table : { *(.gcc_except_table) } 196 .ctors : 197 { 198 /* gcc uses crtbegin.o to find the start of 199 the constructors, so we make sure it is 200 first. Because this is a wildcard, it 201 doesn't matter if the user does not 202 actually link against crtbegin.o; the 203 linker won't look for a file to match a 204 wildcard. The wildcard also means that it 205 doesn't matter which directory crtbegin.o 206 is in. */ 207 KEEP (*crtbegin.o(.ctors)) 208 /* We don't want to include the .ctor section from 209 from the crtend.o file until after the sorted ctors. 210 The .ctor section from the crtend file contains the 211 end of ctors marker and it must be last */ 212 KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) 213 KEEP (*(SORT(.ctors.*))) 214 KEEP (*(.ctors)) 215 } 216 .dtors : 217 { 218 KEEP (*crtbegin.o(.dtors)) 219 KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) 220 KEEP (*(SORT(.dtors.*))) 221 KEEP (*(.dtors)) 222 } 223 .plt : { *(.plt) } 224 _gp = ALIGN(16) + 0x7ff0; 225 .got : { *(.got.plt) *(.got) } 226 .dynamic : { *(.dynamic) } 227 /* We want the small data sections together, so single-instruction offsets 228 can access them all, and initialized data all before uninitialized, so 229 we can shorten the on-disk segment size. */ 230 .sdata : 231 { 232 *(.sdata) 233 *(.sdata.*) 234 *(.gnu.linkonce.s.*) 235 } 236 _edata = .; 237 PROVIDE (edata = .); 238 __bss_start = .; 239 .sbss : 240 { 241 PROVIDE (__sbss_start = .); 242 PROVIDE (___sbss_start = .); 243 *(.dynsbss) 244 *(.sbss) 245 *(.sbss.*) 246 *(.gnu.linkonce.sb.*) 247 *(.scommon) 248 PROVIDE (__sbss_end = .); 249 PROVIDE (___sbss_end = .); 250 } 251 .bss : 252 { 253 *(.dynbss) 254 *(.bss) 255 *(.bss.*) 256 *(.gnu.linkonce.b.*) 257 *(COMMON) 258 /* Align here to ensure that the .bss section occupies space up to 259 _end. Align after .bss to ensure correct alignment even if the 260 .bss section disappears because there are no input sections. */ 261 . = ALIGN(64 / 8); 262 } 263 . = ALIGN(64 / 8); 264 _end = .; 265 PROVIDE (end = .); 266 /* Stabs debugging sections. */ 267 .stab 0 : { *(.stab) } 268 .stabstr 0 : { *(.stabstr) } 269 .stab.excl 0 : { *(.stab.excl) } 270 .stab.exclstr 0 : { *(.stab.exclstr) } 271 .stab.index 0 : { *(.stab.index) } 272 .stab.indexstr 0 : { *(.stab.indexstr) } 273 .comment 0 : { *(.comment) } 274 /* DWARF debug sections. 275 Symbols in the DWARF debugging sections are relative to the beginning 276 of the section so we begin them at 0. */ 277 /* DWARF 1 */ 278 .debug 0 : { *(.debug) } 279 .line 0 : { *(.line) } 280 /* GNU DWARF 1 extensions */ 281 .debug_srcinfo 0 : { *(.debug_srcinfo) } 282 .debug_sfnames 0 : { *(.debug_sfnames) } 283 /* DWARF 1.1 and DWARF 2 */ 284 .debug_aranges 0 : { *(.debug_aranges) } 285 .debug_pubnames 0 : { *(.debug_pubnames) } 286 /* DWARF 2 */ 287 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } 288 .debug_abbrev 0 : { *(.debug_abbrev) } 289 .debug_line 0 : { *(.debug_line) } 290 .debug_frame 0 : { *(.debug_frame) } 291 .debug_str 0 : { *(.debug_str) } 292 .debug_loc 0 : { *(.debug_loc) } 293 .debug_macinfo 0 : { *(.debug_macinfo) } 294 /* SGI/MIPS DWARF 2 extensions */ 295 .debug_weaknames 0 : { *(.debug_weaknames) } 296 .debug_funcnames 0 : { *(.debug_funcnames) } 297 .debug_typenames 0 : { *(.debug_typenames) } 298 .debug_varnames 0 : { *(.debug_varnames) } 299 /* These must appear regardless of . */ 300} 301