| Commit | Line | Data |
|---|---|---|
| d7f50089 YY |
1 | /* |
| 2 | * $FreeBSD: src/sys/conf/ldscript.amd64,v 1.9 2004/05/29 01:09:00 tjr Exp $ | |
| d7f50089 YY |
3 | */ |
| 4 | OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") | |
| 5 | OUTPUT_ARCH(i386:x86-64) | |
| 6 | ENTRY(btext) | |
| 7 | SEARCH_DIR("/usr/lib"); | |
| 8 | SECTIONS | |
| 9 | { | |
| 10 | /* Read-only sections, merged into text segment: */ | |
| 11 | . = kernbase + 0x00100000 + SIZEOF_HEADERS; | |
| 12 | .interp : { *(.interp) } | |
| 13 | .hash : { *(.hash) } | |
| 14 | .dynsym : { *(.dynsym) } | |
| 15 | .dynstr : { *(.dynstr) } | |
| 16 | .gnu.version : { *(.gnu.version) } | |
| 17 | .gnu.version_d : { *(.gnu.version_d) } | |
| 18 | .gnu.version_r : { *(.gnu.version_r) } | |
| 19 | .rel.init : { *(.rel.init) } | |
| 20 | .rela.init : { *(.rela.init) } | |
| 21 | .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } | |
| 22 | .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } | |
| 23 | .rel.fini : { *(.rel.fini) } | |
| 24 | .rela.fini : { *(.rela.fini) } | |
| 25 | .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } | |
| 26 | .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } | |
| 27 | .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } | |
| 28 | .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } | |
| 29 | .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } | |
| 30 | .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } | |
| 31 | .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } | |
| 32 | .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } | |
| 33 | .rel.ctors : { *(.rel.ctors) } | |
| 34 | .rela.ctors : { *(.rela.ctors) } | |
| 35 | .rel.dtors : { *(.rel.dtors) } | |
| 36 | .rela.dtors : { *(.rela.dtors) } | |
| 37 | .rel.got : { *(.rel.got) } | |
| 38 | .rela.got : { *(.rela.got) } | |
| 39 | .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } | |
| 40 | .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } | |
| 41 | .rel.plt : { *(.rel.plt) } | |
| 42 | .rela.plt : { *(.rela.plt) } | |
| 43 | .init : | |
| 44 | { | |
| 45 | KEEP (*(.init)) | |
| 46 | } =0x90909090 | |
| 47 | .plt : { *(.plt) } | |
| 48 | .text : | |
| 49 | { | |
| 50 | *(.text .stub .text.* .gnu.linkonce.t.*) | |
| 51 | /* .gnu.warning sections are handled specially by elf32.em. */ | |
| 52 | *(.gnu.warning) | |
| 53 | } =0x90909090 | |
| 54 | .fini : | |
| 55 | { | |
| 56 | KEEP (*(.fini)) | |
| 57 | } =0x90909090 | |
| 58 | PROVIDE (__etext = .); | |
| 59 | PROVIDE (_etext = .); | |
| 60 | PROVIDE (etext = .); | |
| 61 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } | |
| 62 | .rodata1 : { *(.rodata1) } | |
| 63 | .eh_frame_hdr : { *(.eh_frame_hdr) } | |
| 64 | /* Adjust the address for the data segment. We want to adjust up to | |
| 65 | the same address within the page on the next page up. */ | |
| 66 | . = DATA_SEGMENT_ALIGN(0x100000, 0x1000); | |
| 67 | /* Ensure the __preinit_array_start label is properly aligned. We | |
| 68 | could instead move the label definition inside the section, but | |
| 69 | the linker would then create the section even if it turns out to | |
| 70 | be empty, which isn't pretty. */ | |
| 71 | . = ALIGN(64 / 8); | |
| 72 | PROVIDE (__preinit_array_start = .); | |
| 73 | .preinit_array : { *(.preinit_array) } | |
| 74 | PROVIDE (__preinit_array_end = .); | |
| 75 | PROVIDE (__init_array_start = .); | |
| 76 | .init_array : { *(.init_array) } | |
| 77 | PROVIDE (__init_array_end = .); | |
| 78 | PROVIDE (__fini_array_start = .); | |
| 79 | .fini_array : { *(.fini_array) } | |
| 80 | PROVIDE (__fini_array_end = .); | |
| 81 | .data : | |
| 82 | { | |
| 83 | *(.data .data.* .gnu.linkonce.d.*) | |
| 84 | SORT(CONSTRUCTORS) | |
| 85 | } | |
| 86 | .data1 : { *(.data1) } | |
| 87 | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } | |
| 88 | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } | |
| 89 | .eh_frame : { KEEP (*(.eh_frame)) } | |
| 90 | .gcc_except_table : { *(.gcc_except_table) } | |
| 91 | .dynamic : { *(.dynamic) } | |
| 92 | _start_ctors = .; | |
| 93 | PROVIDE (start_ctors = .); | |
| 94 | .ctors : | |
| 95 | { | |
| 96 | /* gcc uses crtbegin.o to find the start of | |
| 97 | the constructors, so we make sure it is | |
| 98 | first. Because this is a wildcard, it | |
| 99 | doesn't matter if the user does not | |
| 100 | actually link against crtbegin.o; the | |
| 101 | linker won't look for a file to match a | |
| 102 | wildcard. The wildcard also means that it | |
| 103 | doesn't matter which directory crtbegin.o | |
| 104 | is in. */ | |
| 105 | KEEP (*crtbegin.o(.ctors)) | |
| 106 | /* We don't want to include the .ctor section from | |
| 107 | from the crtend.o file until after the sorted ctors. | |
| 108 | The .ctor section from the crtend file contains the | |
| 109 | end of ctors marker and it must be last */ | |
| 110 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) | |
| 111 | KEEP (*(SORT(.ctors.*))) | |
| 112 | KEEP (*(.ctors)) | |
| 113 | } | |
| 114 | _stop_ctors = .; | |
| 115 | PROVIDE (stop_ctors = .); | |
| 116 | .dtors : | |
| 117 | { | |
| 118 | KEEP (*crtbegin.o(.dtors)) | |
| 119 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) | |
| 120 | KEEP (*(SORT(.dtors.*))) | |
| 121 | KEEP (*(.dtors)) | |
| 122 | } | |
| 123 | .jcr : { KEEP (*(.jcr)) } | |
| 124 | .got : { *(.got.plt) *(.got) } | |
| 125 | _edata = .; | |
| 126 | PROVIDE (edata = .); | |
| 127 | __bss_start = .; | |
| 128 | .bss : | |
| 129 | { | |
| 130 | *(.dynbss) | |
| 131 | *(.bss .bss.* .gnu.linkonce.b.*) | |
| 132 | *(COMMON) | |
| 133 | /* Align here to ensure that the .bss section occupies space up to | |
| 134 | _end. Align after .bss to ensure correct alignment even if the | |
| 135 | .bss section disappears because there are no input sections. */ | |
| 136 | . = ALIGN(64 / 8); | |
| 137 | } | |
| 138 | . = ALIGN(64 / 8); | |
| 139 | _end = .; | |
| 140 | PROVIDE (end = .); | |
| 141 | . = DATA_SEGMENT_END (.); | |
| 142 | /* Stabs debugging sections. */ | |
| 143 | .stab 0 : { *(.stab) } | |
| 144 | .stabstr 0 : { *(.stabstr) } | |
| 145 | .stab.excl 0 : { *(.stab.excl) } | |
| 146 | .stab.exclstr 0 : { *(.stab.exclstr) } | |
| 147 | .stab.index 0 : { *(.stab.index) } | |
| 148 | .stab.indexstr 0 : { *(.stab.indexstr) } | |
| 149 | .comment 0 : { *(.comment) } | |
| 150 | /* DWARF debug sections. | |
| 151 | Symbols in the DWARF debugging sections are relative to the beginning | |
| 152 | of the section so we begin them at 0. */ | |
| 153 | /* DWARF 1 */ | |
| 154 | .debug 0 : { *(.debug) } | |
| 155 | .line 0 : { *(.line) } | |
| 156 | /* GNU DWARF 1 extensions */ | |
| 157 | .debug_srcinfo 0 : { *(.debug_srcinfo) } | |
| 158 | .debug_sfnames 0 : { *(.debug_sfnames) } | |
| 159 | /* DWARF 1.1 and DWARF 2 */ | |
| 160 | .debug_aranges 0 : { *(.debug_aranges) } | |
| 161 | .debug_pubnames 0 : { *(.debug_pubnames) } | |
| 162 | /* DWARF 2 */ | |
| 163 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } | |
| 164 | .debug_abbrev 0 : { *(.debug_abbrev) } | |
| 165 | .debug_line 0 : { *(.debug_line) } | |
| 166 | .debug_frame 0 : { *(.debug_frame) } | |
| 167 | .debug_str 0 : { *(.debug_str) } | |
| 168 | .debug_loc 0 : { *(.debug_loc) } | |
| 169 | .debug_macinfo 0 : { *(.debug_macinfo) } | |
| 170 | /* SGI/MIPS DWARF 2 extensions */ | |
| 171 | .debug_weaknames 0 : { *(.debug_weaknames) } | |
| 172 | .debug_funcnames 0 : { *(.debug_funcnames) } | |
| 173 | .debug_typenames 0 : { *(.debug_typenames) } | |
| 174 | .debug_varnames 0 : { *(.debug_varnames) } | |
| 175 | } |