1d0e12656SPeter Wemm/* $FreeBSD$ */ 2b05deb9bSPeter WemmOUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") 3b05deb9bSPeter WemmOUTPUT_ARCH(i386:x86-64) 46b7a14ceSPeter WemmENTRY(btext) 5b05deb9bSPeter WemmSEARCH_DIR("/usr/lib"); 66b7a14ceSPeter WemmSECTIONS 76b7a14ceSPeter Wemm{ 86b7a14ceSPeter Wemm /* Read-only sections, merged into text segment: */ 9d7ffc002SPeter Wemm . = kernbase + 0x00100000 + SIZEOF_HEADERS; 106b7a14ceSPeter Wemm .interp : { *(.interp) } 116b7a14ceSPeter Wemm .hash : { *(.hash) } 126b7a14ceSPeter Wemm .dynsym : { *(.dynsym) } 136b7a14ceSPeter Wemm .dynstr : { *(.dynstr) } 146b7a14ceSPeter Wemm .gnu.version : { *(.gnu.version) } 156b7a14ceSPeter Wemm .gnu.version_d : { *(.gnu.version_d) } 166b7a14ceSPeter Wemm .gnu.version_r : { *(.gnu.version_r) } 17b05deb9bSPeter Wemm .rel.init : { *(.rel.init) } 18b05deb9bSPeter Wemm .rela.init : { *(.rela.init) } 19b05deb9bSPeter Wemm .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } 20b05deb9bSPeter Wemm .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } 21b05deb9bSPeter Wemm .rel.fini : { *(.rel.fini) } 22b05deb9bSPeter Wemm .rela.fini : { *(.rela.fini) } 23b05deb9bSPeter Wemm .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } 24b05deb9bSPeter Wemm .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } 25b05deb9bSPeter Wemm .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } 26b05deb9bSPeter Wemm .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } 27b05deb9bSPeter Wemm .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } 28b05deb9bSPeter Wemm .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } 29b05deb9bSPeter Wemm .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } 30b05deb9bSPeter Wemm .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } 316b7a14ceSPeter Wemm .rel.ctors : { *(.rel.ctors) } 326b7a14ceSPeter Wemm .rela.ctors : { *(.rela.ctors) } 336b7a14ceSPeter Wemm .rel.dtors : { *(.rel.dtors) } 346b7a14ceSPeter Wemm .rela.dtors : { *(.rela.dtors) } 35b05deb9bSPeter Wemm .rel.got : { *(.rel.got) } 36b05deb9bSPeter Wemm .rela.got : { *(.rela.got) } 37b05deb9bSPeter Wemm .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } 38b05deb9bSPeter Wemm .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } 396b7a14ceSPeter Wemm .rel.plt : { *(.rel.plt) } 406b7a14ceSPeter Wemm .rela.plt : { *(.rela.plt) } 41b05deb9bSPeter Wemm .init : 42b05deb9bSPeter Wemm { 43b05deb9bSPeter Wemm KEEP (*(.init)) 44b05deb9bSPeter Wemm } =0x90909090 456b7a14ceSPeter Wemm .plt : { *(.plt) } 466b7a14ceSPeter Wemm .text : 476b7a14ceSPeter Wemm { 48b05deb9bSPeter Wemm *(.text .stub .text.* .gnu.linkonce.t.*) 496b7a14ceSPeter Wemm /* .gnu.warning sections are handled specially by elf32.em. */ 506b7a14ceSPeter Wemm *(.gnu.warning) 51b05deb9bSPeter Wemm } =0x90909090 52b05deb9bSPeter Wemm .fini : 53b05deb9bSPeter Wemm { 54b05deb9bSPeter Wemm KEEP (*(.fini)) 55b05deb9bSPeter Wemm } =0x90909090 56b05deb9bSPeter Wemm PROVIDE (__etext = .); 57b05deb9bSPeter Wemm PROVIDE (_etext = .); 586b7a14ceSPeter Wemm PROVIDE (etext = .); 59b05deb9bSPeter Wemm .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 606b7a14ceSPeter Wemm .rodata1 : { *(.rodata1) } 61b05deb9bSPeter Wemm .eh_frame_hdr : { *(.eh_frame_hdr) } 626b7a14ceSPeter Wemm /* Adjust the address for the data segment. We want to adjust up to 636b7a14ceSPeter Wemm the same address within the page on the next page up. */ 64b05deb9bSPeter Wemm . = DATA_SEGMENT_ALIGN(0x100000, 0x1000); 65b05deb9bSPeter Wemm /* Ensure the __preinit_array_start label is properly aligned. We 66b05deb9bSPeter Wemm could instead move the label definition inside the section, but 67b05deb9bSPeter Wemm the linker would then create the section even if it turns out to 68b05deb9bSPeter Wemm be empty, which isn't pretty. */ 69b05deb9bSPeter Wemm . = ALIGN(64 / 8); 70b05deb9bSPeter Wemm PROVIDE (__preinit_array_start = .); 71b05deb9bSPeter Wemm .preinit_array : { *(.preinit_array) } 72b05deb9bSPeter Wemm PROVIDE (__preinit_array_end = .); 73b05deb9bSPeter Wemm PROVIDE (__init_array_start = .); 74b05deb9bSPeter Wemm .init_array : { *(.init_array) } 75b05deb9bSPeter Wemm PROVIDE (__init_array_end = .); 76b05deb9bSPeter Wemm PROVIDE (__fini_array_start = .); 77b05deb9bSPeter Wemm .fini_array : { *(.fini_array) } 78b05deb9bSPeter Wemm PROVIDE (__fini_array_end = .); 796b7a14ceSPeter Wemm .data : 806b7a14ceSPeter Wemm { 81b05deb9bSPeter Wemm *(.data .data.* .gnu.linkonce.d.*) 82b05deb9bSPeter Wemm SORT(CONSTRUCTORS) 836b7a14ceSPeter Wemm } 846b7a14ceSPeter Wemm .data1 : { *(.data1) } 85b05deb9bSPeter Wemm .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } 86b05deb9bSPeter Wemm .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } 87b05deb9bSPeter Wemm .eh_frame : { KEEP (*(.eh_frame)) } 88b05deb9bSPeter Wemm .gcc_except_table : { *(.gcc_except_table) } 89b05deb9bSPeter Wemm .dynamic : { *(.dynamic) } 906b7a14ceSPeter Wemm .ctors : 916b7a14ceSPeter Wemm { 92b05deb9bSPeter Wemm /* gcc uses crtbegin.o to find the start of 93b05deb9bSPeter Wemm the constructors, so we make sure it is 94b05deb9bSPeter Wemm first. Because this is a wildcard, it 95b05deb9bSPeter Wemm doesn't matter if the user does not 96b05deb9bSPeter Wemm actually link against crtbegin.o; the 97b05deb9bSPeter Wemm linker won't look for a file to match a 98b05deb9bSPeter Wemm wildcard. The wildcard also means that it 99b05deb9bSPeter Wemm doesn't matter which directory crtbegin.o 100b05deb9bSPeter Wemm is in. */ 101b05deb9bSPeter Wemm KEEP (*crtbegin.o(.ctors)) 102b05deb9bSPeter Wemm /* We don't want to include the .ctor section from 103b05deb9bSPeter Wemm from the crtend.o file until after the sorted ctors. 104b05deb9bSPeter Wemm The .ctor section from the crtend file contains the 105b05deb9bSPeter Wemm end of ctors marker and it must be last */ 106b05deb9bSPeter Wemm KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) 107b05deb9bSPeter Wemm KEEP (*(SORT(.ctors.*))) 108b05deb9bSPeter Wemm KEEP (*(.ctors)) 1096b7a14ceSPeter Wemm } 1106b7a14ceSPeter Wemm .dtors : 1116b7a14ceSPeter Wemm { 112b05deb9bSPeter Wemm KEEP (*crtbegin.o(.dtors)) 113b05deb9bSPeter Wemm KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) 114b05deb9bSPeter Wemm KEEP (*(SORT(.dtors.*))) 115b05deb9bSPeter Wemm KEEP (*(.dtors)) 1166b7a14ceSPeter Wemm } 117b05deb9bSPeter Wemm .jcr : { KEEP (*(.jcr)) } 1186b7a14ceSPeter Wemm .got : { *(.got.plt) *(.got) } 1196b7a14ceSPeter Wemm _edata = .; 1206b7a14ceSPeter Wemm PROVIDE (edata = .); 1216b7a14ceSPeter Wemm __bss_start = .; 1226b7a14ceSPeter Wemm .bss : 1236b7a14ceSPeter Wemm { 1246b7a14ceSPeter Wemm *(.dynbss) 125b05deb9bSPeter Wemm *(.bss .bss.* .gnu.linkonce.b.*) 1266b7a14ceSPeter Wemm *(COMMON) 127b05deb9bSPeter Wemm /* Align here to ensure that the .bss section occupies space up to 128b05deb9bSPeter Wemm _end. Align after .bss to ensure correct alignment even if the 129b05deb9bSPeter Wemm .bss section disappears because there are no input sections. */ 130b05deb9bSPeter Wemm . = ALIGN(64 / 8); 1316b7a14ceSPeter Wemm } 132b05deb9bSPeter Wemm . = ALIGN(64 / 8); 1336b7a14ceSPeter Wemm _end = .; 1346b7a14ceSPeter Wemm PROVIDE (end = .); 135b05deb9bSPeter Wemm . = DATA_SEGMENT_END (.); 1366b7a14ceSPeter Wemm /* Stabs debugging sections. */ 1376b7a14ceSPeter Wemm .stab 0 : { *(.stab) } 1386b7a14ceSPeter Wemm .stabstr 0 : { *(.stabstr) } 1396b7a14ceSPeter Wemm .stab.excl 0 : { *(.stab.excl) } 1406b7a14ceSPeter Wemm .stab.exclstr 0 : { *(.stab.exclstr) } 1416b7a14ceSPeter Wemm .stab.index 0 : { *(.stab.index) } 1426b7a14ceSPeter Wemm .stab.indexstr 0 : { *(.stab.indexstr) } 1436b7a14ceSPeter Wemm .comment 0 : { *(.comment) } 1446b7a14ceSPeter Wemm /* DWARF debug sections. 1456b7a14ceSPeter Wemm Symbols in the DWARF debugging sections are relative to the beginning 1466b7a14ceSPeter Wemm of the section so we begin them at 0. */ 1476b7a14ceSPeter Wemm /* DWARF 1 */ 1486b7a14ceSPeter Wemm .debug 0 : { *(.debug) } 1496b7a14ceSPeter Wemm .line 0 : { *(.line) } 1506b7a14ceSPeter Wemm /* GNU DWARF 1 extensions */ 1516b7a14ceSPeter Wemm .debug_srcinfo 0 : { *(.debug_srcinfo) } 1526b7a14ceSPeter Wemm .debug_sfnames 0 : { *(.debug_sfnames) } 1536b7a14ceSPeter Wemm /* DWARF 1.1 and DWARF 2 */ 1546b7a14ceSPeter Wemm .debug_aranges 0 : { *(.debug_aranges) } 1556b7a14ceSPeter Wemm .debug_pubnames 0 : { *(.debug_pubnames) } 1566b7a14ceSPeter Wemm /* DWARF 2 */ 157b05deb9bSPeter Wemm .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 1586b7a14ceSPeter Wemm .debug_abbrev 0 : { *(.debug_abbrev) } 1596b7a14ceSPeter Wemm .debug_line 0 : { *(.debug_line) } 1606b7a14ceSPeter Wemm .debug_frame 0 : { *(.debug_frame) } 1616b7a14ceSPeter Wemm .debug_str 0 : { *(.debug_str) } 1626b7a14ceSPeter Wemm .debug_loc 0 : { *(.debug_loc) } 1636b7a14ceSPeter Wemm .debug_macinfo 0 : { *(.debug_macinfo) } 1646b7a14ceSPeter Wemm /* SGI/MIPS DWARF 2 extensions */ 1656b7a14ceSPeter Wemm .debug_weaknames 0 : { *(.debug_weaknames) } 1666b7a14ceSPeter Wemm .debug_funcnames 0 : { *(.debug_funcnames) } 1676b7a14ceSPeter Wemm .debug_typenames 0 : { *(.debug_typenames) } 1686b7a14ceSPeter Wemm .debug_varnames 0 : { *(.debug_varnames) } 1696b7a14ceSPeter Wemm} 170