ldscript.mips.cfe revision 178170
1178170Simp/* 2178170Simp * This linker script is needed to build a kernel for use by Broadcom CFE. 3178170Simp */ 4178170Simp 5178170Simp/* $FreeBSD: head/sys/conf/ldscript.mips.cfe 178170 2008-04-13 06:25:43Z imp $ */ 6178170SimpOUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips") 7178170SimpOUTPUT_ARCH(mips) 8178170SimpENTRY(_start) 9178170SimpSEARCH_DIR(/usr/lib); 10178170Simp/* Do we need any of these for elf? 11178170Simp __DYNAMIC = 0; 12178170SimpPROVIDE (_DYNAMIC = 0); 13178170Simp*/ 14178170SimpDYNAMIC_LINK = 0; /* XXX */ 15178170SimpSECTIONS 16178170Simp{ 17178170Simp /* Read-only sections, merged into text segment: */ 18178170Simp . = 0x80001000; 19178170Simp .text : 20178170Simp { 21178170Simp *(.trap) 22178170Simp *(.text) 23178170Simp *(.text.*) 24178170Simp *(.stub) 25178170Simp /* .gnu.warning sections are handled specially by elf32.em. */ 26178170Simp *(.gnu.warning) 27178170Simp *(.gnu.linkonce.t.*) 28178170Simp } 29178170Simp .interp : { *(.interp) } 30178170Simp .hash : { *(.hash) } 31178170Simp .dynsym : { *(.dynsym) } 32178170Simp .dynstr : { *(.dynstr) } 33178170Simp .gnu.version : { *(.gnu.version) } 34178170Simp .gnu.version_d : { *(.gnu.version_d) } 35178170Simp .gnu.version_r : { *(.gnu.version_r) } 36178170Simp .rel.init : { *(.rel.init) } 37178170Simp .rela.init : { *(.rela.init) } 38178170Simp .rel.text : 39178170Simp { 40178170Simp *(.rel.text) 41178170Simp *(.rel.text.*) 42178170Simp *(.rel.gnu.linkonce.t.*) 43178170Simp } 44178170Simp .rela.text : 45178170Simp { 46178170Simp *(.rela.text) 47178170Simp *(.rela.text.*) 48178170Simp *(.rela.gnu.linkonce.t.*) 49178170Simp } 50178170Simp .rel.fini : { *(.rel.fini) } 51178170Simp .rela.fini : { *(.rela.fini) } 52178170Simp .rel.rodata : 53178170Simp { 54178170Simp *(.rel.rodata) 55178170Simp *(.rel.rodata.*) 56178170Simp *(.rel.gnu.linkonce.r.*) 57178170Simp } 58178170Simp .rela.rodata : 59178170Simp { 60178170Simp *(.rela.rodata) 61178170Simp *(.rela.rodata.*) 62178170Simp *(.rela.gnu.linkonce.r.*) 63178170Simp } 64178170Simp .rel.data : 65178170Simp { 66178170Simp *(.rel.data) 67178170Simp *(.rel.data.*) 68178170Simp *(.rel.gnu.linkonce.d.*) 69178170Simp } 70178170Simp .rela.data : 71178170Simp { 72178170Simp *(.rela.data) 73178170Simp *(.rela.data.*) 74178170Simp *(.rela.gnu.linkonce.d.*) 75178170Simp } 76178170Simp .rel.ctors : { *(.rel.ctors) } 77178170Simp .rela.ctors : { *(.rela.ctors) } 78178170Simp .rel.dtors : { *(.rel.dtors) } 79178170Simp .rela.dtors : { *(.rela.dtors) } 80178170Simp .rel.got : { *(.rel.got) } 81178170Simp .rela.got : { *(.rela.got) } 82178170Simp .rel.sdata : 83178170Simp { 84178170Simp *(.rel.sdata) 85178170Simp *(.rel.sdata.*) 86178170Simp *(.rel.gnu.linkonce.s.*) 87178170Simp } 88178170Simp .rela.sdata : 89178170Simp { 90178170Simp *(.rela.sdata) 91178170Simp *(.rela.sdata.*) 92178170Simp *(.rela.gnu.linkonce.s.*) 93178170Simp } 94178170Simp .rel.sbss : 95178170Simp { 96178170Simp *(.rel.sbss) 97178170Simp *(.rel.sbss.*) 98178170Simp *(.rel.gnu.linkonce.sb.*) 99178170Simp } 100178170Simp .rela.sbss : 101178170Simp { 102178170Simp *(.rela.sbss) 103178170Simp *(.rela.sbss.*) 104178170Simp *(.rel.gnu.linkonce.sb.*) 105178170Simp } 106178170Simp .rel.sdata2 : 107178170Simp { 108178170Simp *(.rel.sdata2) 109178170Simp *(.rel.sdata2.*) 110178170Simp *(.rel.gnu.linkonce.s2.*) 111178170Simp } 112178170Simp .rela.sdata2 : 113178170Simp { 114178170Simp *(.rela.sdata2) 115178170Simp *(.rela.sdata2.*) 116178170Simp *(.rela.gnu.linkonce.s2.*) 117178170Simp } 118178170Simp .rel.sbss2 : 119178170Simp { 120178170Simp *(.rel.sbss2) 121178170Simp *(.rel.sbss2.*) 122178170Simp *(.rel.gnu.linkonce.sb2.*) 123178170Simp } 124178170Simp .rela.sbss2 : 125178170Simp { 126178170Simp *(.rela.sbss2) 127178170Simp *(.rela.sbss2.*) 128178170Simp *(.rela.gnu.linkonce.sb2.*) 129178170Simp } 130178170Simp .rel.bss : 131178170Simp { 132178170Simp *(.rel.bss) 133178170Simp *(.rel.bss.*) 134178170Simp *(.rel.gnu.linkonce.b.*) 135178170Simp } 136178170Simp .rela.bss : 137178170Simp { 138178170Simp *(.rela.bss) 139178170Simp *(.rela.bss.*) 140178170Simp *(.rela.gnu.linkonce.b.*) 141178170Simp } 142178170Simp .rel.plt : { *(.rel.plt) } 143178170Simp .rela.plt : { *(.rela.plt) } 144178170Simp 145178170Simp .init : 146178170Simp { 147178170Simp KEEP (*(.init)) 148178170Simp } 149178170Simp 150178170Simp .fini : 151178170Simp { 152178170Simp KEEP (*(.fini)) 153178170Simp } =0x1000000 154178170Simp PROVIDE (__etext = .); 155178170Simp PROVIDE (_etext = .); 156178170Simp PROVIDE (etext = .); 157178170Simp .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } 158178170Simp .rodata1 : { *(.rodata1) } 159178170Simp .reginfo : { *(.reginfo) } 160178170Simp .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } 161178170Simp .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } 162178170Simp . = ALIGN(0x2000) + (. & (0x2000 - 1)); 163178170Simp .data : 164178170Simp { 165178170Simp *(.data) 166178170Simp *(.data.*) 167178170Simp *(.gnu.linkonce.d.*) 168178170Simp SORT(CONSTRUCTORS) 169178170Simp } 170178170Simp .data1 : { *(.data1) } 171178170Simp .eh_frame : { KEEP (*(.eh_frame)) } 172178170Simp .gcc_except_table : { *(.gcc_except_table) } 173178170Simp .ctors : 174178170Simp { 175178170Simp /* gcc uses crtbegin.o to find the start of 176178170Simp the constructors, so we make sure it is 177178170Simp first. Because this is a wildcard, it 178178170Simp doesn't matter if the user does not 179178170Simp actually link against crtbegin.o; the 180178170Simp linker won't look for a file to match a 181178170Simp wildcard. The wildcard also means that it 182178170Simp doesn't matter which directory crtbegin.o 183178170Simp is in. */ 184178170Simp KEEP (*crtbegin.o(.ctors)) 185178170Simp /* We don't want to include the .ctor section from 186178170Simp from the crtend.o file until after the sorted ctors. 187178170Simp The .ctor section from the crtend file contains the 188178170Simp end of ctors marker and it must be last */ 189178170Simp KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) 190178170Simp KEEP (*(SORT(.ctors.*))) 191178170Simp KEEP (*(.ctors)) 192178170Simp } 193178170Simp .dtors : 194178170Simp { 195178170Simp KEEP (*crtbegin.o(.dtors)) 196178170Simp KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) 197178170Simp KEEP (*(SORT(.dtors.*))) 198178170Simp KEEP (*(.dtors)) 199178170Simp } 200178170Simp .plt : { *(.plt) } 201178170Simp _gp = ALIGN(16) + 0x7ff0; 202178170Simp .got : { *(.got.plt) *(.got) } 203178170Simp .dynamic : { *(.dynamic) } 204178170Simp /* We want the small data sections together, so single-instruction offsets 205178170Simp can access them all, and initialized data all before uninitialized, so 206178170Simp we can shorten the on-disk segment size. */ 207178170Simp .sdata : 208178170Simp { 209178170Simp *(.sdata) 210178170Simp *(.sdata.*) 211178170Simp *(.gnu.linkonce.s.*) 212178170Simp } 213178170Simp _edata = .; 214178170Simp PROVIDE (edata = .); 215178170Simp __bss_start = .; 216178170Simp .sbss : 217178170Simp { 218178170Simp PROVIDE (__sbss_start = .); 219178170Simp PROVIDE (___sbss_start = .); 220178170Simp *(.dynsbss) 221178170Simp *(.sbss) 222178170Simp *(.sbss.*) 223178170Simp *(.gnu.linkonce.sb.*) 224178170Simp *(.scommon) 225178170Simp PROVIDE (__sbss_end = .); 226178170Simp PROVIDE (___sbss_end = .); 227178170Simp } 228178170Simp .bss : 229178170Simp { 230178170Simp *(.dynbss) 231178170Simp *(.bss) 232178170Simp *(.bss.*) 233178170Simp *(.gnu.linkonce.b.*) 234178170Simp *(COMMON) 235178170Simp /* Align here to ensure that the .bss section occupies space up to 236178170Simp _end. Align after .bss to ensure correct alignment even if the 237178170Simp .bss section disappears because there are no input sections. */ 238178170Simp . = ALIGN(64 / 8); 239178170Simp } 240178170Simp . = ALIGN(64 / 8); 241178170Simp _end = .; 242178170Simp PROVIDE (end = .); 243178170Simp /* Stabs debugging sections. */ 244178170Simp .stab 0 : { *(.stab) } 245178170Simp .stabstr 0 : { *(.stabstr) } 246178170Simp .stab.excl 0 : { *(.stab.excl) } 247178170Simp .stab.exclstr 0 : { *(.stab.exclstr) } 248178170Simp .stab.index 0 : { *(.stab.index) } 249178170Simp .stab.indexstr 0 : { *(.stab.indexstr) } 250178170Simp .comment 0 : { *(.comment) } 251178170Simp /* DWARF debug sections. 252178170Simp Symbols in the DWARF debugging sections are relative to the beginning 253178170Simp of the section so we begin them at 0. */ 254178170Simp /* DWARF 1 */ 255178170Simp .debug 0 : { *(.debug) } 256178170Simp .line 0 : { *(.line) } 257178170Simp /* GNU DWARF 1 extensions */ 258178170Simp .debug_srcinfo 0 : { *(.debug_srcinfo) } 259178170Simp .debug_sfnames 0 : { *(.debug_sfnames) } 260178170Simp /* DWARF 1.1 and DWARF 2 */ 261178170Simp .debug_aranges 0 : { *(.debug_aranges) } 262178170Simp .debug_pubnames 0 : { *(.debug_pubnames) } 263178170Simp /* DWARF 2 */ 264178170Simp .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } 265178170Simp .debug_abbrev 0 : { *(.debug_abbrev) } 266178170Simp .debug_line 0 : { *(.debug_line) } 267178170Simp .debug_frame 0 : { *(.debug_frame) } 268178170Simp .debug_str 0 : { *(.debug_str) } 269178170Simp .debug_loc 0 : { *(.debug_loc) } 270178170Simp .debug_macinfo 0 : { *(.debug_macinfo) } 271178170Simp /* SGI/MIPS DWARF 2 extensions */ 272178170Simp .debug_weaknames 0 : { *(.debug_weaknames) } 273178170Simp .debug_funcnames 0 : { *(.debug_funcnames) } 274178170Simp .debug_typenames 0 : { *(.debug_typenames) } 275178170Simp .debug_varnames 0 : { *(.debug_varnames) } 276178170Simp /* These must appear regardless of . */ 277178170Simp} 278