1 /* Default linker script, for normal executables */ 2 OUTPUT_FORMAT(pei-x86-64) 3 SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); 4 SECTIONS 5 { 6 /* Make the virtual address and file offset synced if the alignment is 7 lower than the target page size. */ 8 . = SIZEOF_HEADERS; 9 . = ALIGN(__section_alignment__); 10 .text __image_base__ + ( __section_alignment__ < 0x1000 ? . : __section_alignment__ ) : 11 { 12 *(.init) 13 *(.text) 14 *(SORT(.text$*)) 15 *(.text.*) 16 *(.glue_7t) 17 *(.glue_7) 18 . = ALIGN(8); 19 ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; 20 LONG (-1); LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0); LONG (0); 21 ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; 22 LONG (-1); LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0); LONG (0); 23 *(.fini) 24 /* ??? Why is .gcc_exc here? */ 25 *(.gcc_exc) 26 PROVIDE (etext = .); 27 *(.gcc_except_table) 28 } 29 /* The Cygwin32 library uses a section to avoid copying certain data 30 on fork. This used to be named ".data". The linker used 31 to include this between __data_start__ and __data_end__, but that 32 breaks building the cygwin32 dll. Instead, we name the section 33 ".data_cygwin_nocopy" and explicitly include it after __data_end__. */ 34 .data BLOCK(__section_alignment__) : 35 { 36 __data_start__ = . ; 37 *(.data) 38 *(.data2) 39 *(SORT(.data$*)) 40 *(.jcr) 41 __data_end__ = . ; 42 *(.data_cygwin_nocopy) 43 } 44 .rdata BLOCK(__section_alignment__) : 45 { 46 *(.rdata) 47 *(SORT(.rdata$*)) 48 __rt_psrelocs_start = .; 49 *(.rdata_runtime_pseudo_reloc) 50 __rt_psrelocs_end = .; 51 } 52 __rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start; 53 ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .; 54 __RUNTIME_PSEUDO_RELOC_LIST_END__ = .; 55 ___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size; 56 __RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size; 57 .eh_frame BLOCK(__section_alignment__) : 58 { 59 *(.eh_frame*) 60 } 61 .pdata BLOCK(__section_alignment__) : 62 { 63 *(.pdata*) 64 } 65 .xdata BLOCK(__section_alignment__) : 66 { 67 *(.xdata*) 68 } 69 .bss BLOCK(__section_alignment__) : 70 { 71 __bss_start__ = . ; 72 *(.bss) 73 *(COMMON) 74 __bss_end__ = . ; 75 } 76 .edata BLOCK(__section_alignment__) : 77 { 78 *(.edata) 79 } 80 /DISCARD/ : 81 { 82 *(.debug$S) 83 *(.debug$T) 84 *(.debug$F) 85 *(.drectve) 86 *(.note.GNU-stack) 87 *(.gnu.lto_*) 88 } 89 .idata BLOCK(__section_alignment__) : 90 { 91 /* This cannot currently be handled with grouped sections. 92 See pep.em:sort_sections. */ 93 SORT(*)(.idata$2) 94 SORT(*)(.idata$3) 95 /* These zeroes mark the end of the import list. */ 96 LONG (0); LONG (0); LONG (0); LONG (0); LONG (0); 97 SORT(*)(.idata$4) 98 __IAT_start__ = .; 99 SORT(*)(.idata$5) 100 __IAT_end__ = .; 101 SORT(*)(.idata$6) 102 SORT(*)(.idata$7) 103 } 104 .CRT BLOCK(__section_alignment__) : 105 { 106 ___crt_xc_start__ = . ; 107 *(SORT(.CRT$XC*)) /* C initialization */ 108 ___crt_xc_end__ = . ; 109 ___crt_xi_start__ = . ; 110 *(SORT(.CRT$XI*)) /* C++ initialization */ 111 ___crt_xi_end__ = . ; 112 ___crt_xl_start__ = . ; 113 *(SORT(.CRT$XL*)) /* TLS callbacks */ 114 /* ___crt_xl_end__ is defined in the TLS Directory support code */ 115 ___crt_xp_start__ = . ; 116 *(SORT(.CRT$XP*)) /* Pre-termination */ 117 ___crt_xp_end__ = . ; 118 ___crt_xt_start__ = . ; 119 *(SORT(.CRT$XT*)) /* Termination */ 120 ___crt_xt_end__ = . ; 121 } 122 .tls BLOCK(__section_alignment__) : 123 { 124 ___tls_start__ = . ; 125 *(.tls) 126 *(.tls$) 127 *(SORT(.tls$*)) 128 ___tls_end__ = . ; 129 } 130 .endjunk BLOCK(__section_alignment__) : 131 { 132 /* end is deprecated, don't use it */ 133 PROVIDE (end = .); 134 PROVIDE ( _end = .); 135 __end__ = .; 136 } 137 .rsrc BLOCK(__section_alignment__) : 138 { 139 *(.rsrc) 140 *(SORT(.rsrc$*)) 141 } 142 .reloc BLOCK(__section_alignment__) : 143 { 144 *(.reloc) 145 } 146 .stab BLOCK(__section_alignment__) (NOLOAD) : 147 { 148 *(.stab) 149 } 150 .stabstr BLOCK(__section_alignment__) (NOLOAD) : 151 { 152 *(.stabstr) 153 } 154 /* DWARF debug sections. 155 Symbols in the DWARF debugging sections are relative to the beginning 156 of the section. Unlike other targets that fake this by putting the 157 section VMA at 0, the PE format will not allow it. */ 158 /* DWARF 1.1 and DWARF 2. */ 159 .debug_aranges BLOCK(__section_alignment__) (NOLOAD) : 160 { 161 *(.debug_aranges) 162 } 163 .debug_pubnames BLOCK(__section_alignment__) (NOLOAD) : 164 { 165 *(.debug_pubnames) 166 } 167 .debug_pubtypes BLOCK(__section_alignment__) (NOLOAD) : 168 { 169 *(.debug_pubtypes) 170 } 171 /* DWARF 2. */ 172 .debug_info BLOCK(__section_alignment__) (NOLOAD) : 173 { 174 *(.debug_info) *(.gnu.linkonce.wi.*) 175 } 176 .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) : 177 { 178 *(.debug_abbrev) 179 } 180 .debug_line BLOCK(__section_alignment__) (NOLOAD) : 181 { 182 *(.debug_line) 183 } 184 .debug_frame BLOCK(__section_alignment__) (NOLOAD) : 185 { 186 *(.debug_frame*) 187 } 188 .debug_str BLOCK(__section_alignment__) (NOLOAD) : 189 { 190 *(.debug_str) 191 } 192 .debug_loc BLOCK(__section_alignment__) (NOLOAD) : 193 { 194 *(.debug_loc) 195 } 196 .debug_macinfo BLOCK(__section_alignment__) (NOLOAD) : 197 { 198 *(.debug_macinfo) 199 } 200 /* SGI/MIPS DWARF 2 extensions. */ 201 .debug_weaknames BLOCK(__section_alignment__) (NOLOAD) : 202 { 203 *(.debug_weaknames) 204 } 205 .debug_funcnames BLOCK(__section_alignment__) (NOLOAD) : 206 { 207 *(.debug_funcnames) 208 } 209 .debug_typenames BLOCK(__section_alignment__) (NOLOAD) : 210 { 211 *(.debug_typenames) 212 } 213 .debug_varnames BLOCK(__section_alignment__) (NOLOAD) : 214 { 215 *(.debug_varnames) 216 } 217 .debug_macro BLOCK(__section_alignment__) (NOLOAD) : 218 { 219 *(.debug_macro) 220 } 221 /* DWARF 3. */ 222 .debug_ranges BLOCK(__section_alignment__) (NOLOAD) : 223 { 224 *(.debug_ranges) 225 } 226 /* DWARF 4. */ 227 .debug_types BLOCK(__section_alignment__) (NOLOAD) : 228 { 229 *(.debug_types) *(.gnu.linkonce.wt.*) 230 } 231 } 232