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: releng/10.2/sys/conf/ldscript.mips 215251 2010-11-13 18:38:35Z imp $ 31 */ 32 33OUTPUT_ARCH(mips) 34ENTRY(_start) 35SEARCH_DIR(/usr/lib); 36SECTIONS 37{ 38 /* Read-only sections, merged into text segment: */ 39 . = KERNLOADADDR + SIZEOF_HEADERS; 40 .text : 41 { 42 *(.trap) 43 *(.text) 44 *(.text.*) 45 *(.stub) 46 /* .gnu.warning sections are handled specially by elf32.em. */ 47 *(.gnu.warning) 48 *(.gnu.linkonce.t.*) 49 } =0x1000000 50 .fini : 51 { 52 KEEP (*(.fini)) 53 } =0x1000000 54 PROVIDE (__etext = .); 55 PROVIDE (_etext = .); 56 PROVIDE (etext = .); 57 .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } 58 .rodata1 : { *(.rodata1) } 59 .interp : { *(.interp) } 60 .hash : { *(.hash) } 61 .dynsym : { *(.dynsym) } 62 .dynstr : { *(.dynstr) } 63 .gnu.version : { *(.gnu.version) } 64 .gnu.version_d : { *(.gnu.version_d) } 65 .gnu.version_r : { *(.gnu.version_r) } 66 .rel.init : { *(.rel.init) } 67 .rela.init : { *(.rela.init) } 68 .rel.text : 69 { 70 *(.rel.text) 71 *(.rel.text.*) 72 *(.rel.gnu.linkonce.t.*) 73 } 74 .rela.text : 75 { 76 *(.rela.text) 77 *(.rela.text.*) 78 *(.rela.gnu.linkonce.t.*) 79 } 80 .rel.fini : { *(.rel.fini) } 81 .rela.fini : { *(.rela.fini) } 82 .rel.rodata : 83 { 84 *(.rel.rodata) 85 *(.rel.rodata.*) 86 *(.rel.gnu.linkonce.r.*) 87 } 88 .rela.rodata : 89 { 90 *(.rela.rodata) 91 *(.rela.rodata.*) 92 *(.rela.gnu.linkonce.r.*) 93 } 94 .rel.data : 95 { 96 *(.rel.data) 97 *(.rel.data.*) 98 *(.rel.gnu.linkonce.d.*) 99 } 100 .rela.data : 101 { 102 *(.rela.data) 103 *(.rela.data.*) 104 *(.rela.gnu.linkonce.d.*) 105 } 106 .rel.ctors : { *(.rel.ctors) } 107 .rela.ctors : { *(.rela.ctors) } 108 .rel.dtors : { *(.rel.dtors) } 109 .rela.dtors : { *(.rela.dtors) } 110 .rel.got : { *(.rel.got) } 111 .rela.got : { *(.rela.got) } 112 .rel.sdata : 113 { 114 *(.rel.sdata) 115 *(.rel.sdata.*) 116 *(.rel.gnu.linkonce.s.*) 117 } 118 .rela.sdata : 119 { 120 *(.rela.sdata) 121 *(.rela.sdata.*) 122 *(.rela.gnu.linkonce.s.*) 123 } 124 .rel.sbss : 125 { 126 *(.rel.sbss) 127 *(.rel.sbss.*) 128 *(.rel.gnu.linkonce.sb.*) 129 } 130 .rela.sbss : 131 { 132 *(.rela.sbss) 133 *(.rela.sbss.*) 134 *(.rel.gnu.linkonce.sb.*) 135 } 136 .rel.sdata2 : 137 { 138 *(.rel.sdata2) 139 *(.rel.sdata2.*) 140 *(.rel.gnu.linkonce.s2.*) 141 } 142 .rela.sdata2 : 143 { 144 *(.rela.sdata2) 145 *(.rela.sdata2.*) 146 *(.rela.gnu.linkonce.s2.*) 147 } 148 .rel.sbss2 : 149 { 150 *(.rel.sbss2) 151 *(.rel.sbss2.*) 152 *(.rel.gnu.linkonce.sb2.*) 153 } 154 .rela.sbss2 : 155 { 156 *(.rela.sbss2) 157 *(.rela.sbss2.*) 158 *(.rela.gnu.linkonce.sb2.*) 159 } 160 .rel.bss : 161 { 162 *(.rel.bss) 163 *(.rel.bss.*) 164 *(.rel.gnu.linkonce.b.*) 165 } 166 .rela.bss : 167 { 168 *(.rela.bss) 169 *(.rela.bss.*) 170 *(.rela.gnu.linkonce.b.*) 171 } 172 .rel.plt : { *(.rel.plt) } 173 .rela.plt : { *(.rela.plt) } 174 .init : 175 { 176 KEEP (*(.init)) 177 } =0x1000000 178 .reginfo : { *(.reginfo) } 179 .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } 180 .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } 181 . = ALIGN(0x2000) + (. & (0x2000 - 1)); 182 .data : 183 { 184 *(.data) 185 *(.data.*) 186 *(.gnu.linkonce.d.*) 187 SORT(CONSTRUCTORS) 188 } 189 .data1 : { *(.data1) } 190 .eh_frame : { KEEP (*(.eh_frame)) } 191 .gcc_except_table : { *(.gcc_except_table) } 192 .ctors : 193 { 194 /* gcc uses crtbegin.o to find the start of 195 the constructors, so we make sure it is 196 first. Because this is a wildcard, it 197 doesn't matter if the user does not 198 actually link against crtbegin.o; the 199 linker won't look for a file to match a 200 wildcard. The wildcard also means that it 201 doesn't matter which directory crtbegin.o 202 is in. */ 203 KEEP (*crtbegin.o(.ctors)) 204 /* We don't want to include the .ctor section from 205 from the crtend.o file until after the sorted ctors. 206 The .ctor section from the crtend file contains the 207 end of ctors marker and it must be last */ 208 KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) 209 KEEP (*(SORT(.ctors.*))) 210 KEEP (*(.ctors)) 211 } 212 .dtors : 213 { 214 KEEP (*crtbegin.o(.dtors)) 215 KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) 216 KEEP (*(SORT(.dtors.*))) 217 KEEP (*(.dtors)) 218 } 219 .plt : { *(.plt) } 220 _gp = ALIGN(16) + 0x7ff0; 221 .got : { *(.got.plt) *(.got) } 222 .dynamic : { *(.dynamic) } 223 /* We want the small data sections together, so single-instruction offsets 224 can access them all, and initialized data all before uninitialized, so 225 we can shorten the on-disk segment size. */ 226 .sdata : 227 { 228 *(.sdata) 229 *(.sdata.*) 230 *(.gnu.linkonce.s.*) 231 } 232 _edata = .; 233 PROVIDE (edata = .); 234 __bss_start = .; 235 .sbss : 236 { 237 PROVIDE (__sbss_start = .); 238 PROVIDE (___sbss_start = .); 239 *(.dynsbss) 240 *(.sbss) 241 *(.sbss.*) 242 *(.gnu.linkonce.sb.*) 243 *(.scommon) 244 PROVIDE (__sbss_end = .); 245 PROVIDE (___sbss_end = .); 246 } 247 .bss : 248 { 249 *(.dynbss) 250 *(.bss) 251 *(.bss.*) 252 *(.gnu.linkonce.b.*) 253 *(COMMON) 254 /* Align here to ensure that the .bss section occupies space up to 255 _end. Align after .bss to ensure correct alignment even if the 256 .bss section disappears because there are no input sections. */ 257 . = ALIGN(64 / 8); 258 } 259 . = ALIGN(64 / 8); 260 _end = .; 261 PROVIDE (end = .); 262 /* Stabs debugging sections. */ 263 .stab 0 : { *(.stab) } 264 .stabstr 0 : { *(.stabstr) } 265 .stab.excl 0 : { *(.stab.excl) } 266 .stab.exclstr 0 : { *(.stab.exclstr) } 267 .stab.index 0 : { *(.stab.index) } 268 .stab.indexstr 0 : { *(.stab.indexstr) } 269 .comment 0 : { *(.comment) } 270 /* DWARF debug sections. 271 Symbols in the DWARF debugging sections are relative to the beginning 272 of the section so we begin them at 0. */ 273 /* DWARF 1 */ 274 .debug 0 : { *(.debug) } 275 .line 0 : { *(.line) } 276 /* GNU DWARF 1 extensions */ 277 .debug_srcinfo 0 : { *(.debug_srcinfo) } 278 .debug_sfnames 0 : { *(.debug_sfnames) } 279 /* DWARF 1.1 and DWARF 2 */ 280 .debug_aranges 0 : { *(.debug_aranges) } 281 .debug_pubnames 0 : { *(.debug_pubnames) } 282 /* DWARF 2 */ 283 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } 284 .debug_abbrev 0 : { *(.debug_abbrev) } 285 .debug_line 0 : { *(.debug_line) } 286 .debug_frame 0 : { *(.debug_frame) } 287 .debug_str 0 : { *(.debug_str) } 288 .debug_loc 0 : { *(.debug_loc) } 289 .debug_macinfo 0 : { *(.debug_macinfo) } 290 /* SGI/MIPS DWARF 2 extensions */ 291 .debug_weaknames 0 : { *(.debug_weaknames) } 292 .debug_funcnames 0 : { *(.debug_funcnames) } 293 .debug_typenames 0 : { *(.debug_typenames) } 294 .debug_varnames 0 : { *(.debug_varnames) } 295 /* These must appear regardless of . */ 296} 297