Commit | Line | Data |
---|---|---|
eb7f87c5 | 1 | # Linker script for PE. |
94d8217d | 2 | |
155d9cc4 GN |
3 | if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then |
4 | RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} | |
5 | fi | |
6 | ||
3f38a017 | 7 | cat <<EOF |
155d9cc4 GN |
8 | ${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})} |
9 | ${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})} | |
10 | ||
3f38a017 SC |
11 | ${LIB_SEARCH_DIRS} |
12 | ||
13 | ENTRY(_mainCRTStartup) | |
14 | ||
15 | SECTIONS | |
16 | { | |
d87e370b | 17 | .text ${RELOCATING+ __image_base__ + __section_alignment__ } : |
94d8217d ILT |
18 | { |
19 | ${RELOCATING+ *(.init)} | |
20 | *(.text) | |
155d9cc4 | 21 | ${RELOCATING+*(.text\$*)} |
94d8217d ILT |
22 | ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; |
23 | LONG (-1); *(.ctors); *(.ctor); LONG (0); } | |
24 | ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; | |
25 | LONG (-1); *(.dtors); *(.dtor); LONG (0); } | |
26 | ${RELOCATING+ *(.fini)} | |
27 | /* ??? Why is .gcc_exc here? */ | |
28 | ${RELOCATING+ *(.gcc_exc)} | |
29 | ${RELOCATING+ etext = .;} | |
94d8217d ILT |
30 | *(.gcc_except_table) |
31 | } | |
3f38a017 | 32 | |
9216fffa ILT |
33 | /* The Cygwin32 library uses a section to avoid copying certain data |
34 | on fork. This used to be named ".data$nocopy". The linker used | |
35 | to include this between __data_start__ and __data_end__, but that | |
36 | breaks building the cygwin32 dll. Instead, we name the section | |
37 | ".data_cygwin_nocopy" and explictly include it after __data_end__. */ | |
38 | ||
155d9cc4 | 39 | .data ${RELOCATING+BLOCK(__section_alignment__)} : |
94d8217d | 40 | { |
155d9cc4 | 41 | ${RELOCATING+__data_start__ = . ;} |
94d8217d ILT |
42 | *(.data) |
43 | *(.data2) | |
155d9cc4 GN |
44 | ${RELOCATING+*(.data\$*)} |
45 | ${RELOCATING+__data_end__ = . ;} | |
46 | ${RELOCATING+*(.data_cygwin_nocopy)} | |
47 | } | |
48 | ||
49 | .bss ${RELOCATING+BLOCK(__section_alignment__)} : | |
50 | { | |
51 | ${RELOCATING+__bss_start__ = . ;} | |
52 | *(.bss) | |
53 | *(COMMON) | |
54 | ${RELOCATING+__bss_end__ = . ;} | |
94d8217d | 55 | } |
3f38a017 | 56 | |
155d9cc4 | 57 | .rdata ${RELOCATING+BLOCK(__section_alignment__)} : |
94d8217d | 58 | { |
3f38a017 | 59 | *(.rdata) |
155d9cc4 GN |
60 | ${RELOCATING+*(.rdata\$*)} |
61 | *(.eh_frame) | |
3f38a017 | 62 | } |
d87e370b | 63 | |
155d9cc4 | 64 | .edata ${RELOCATING+BLOCK(__section_alignment__)} : |
94d8217d ILT |
65 | { |
66 | *(.edata) | |
d87e370b DE |
67 | } |
68 | ||
155d9cc4 | 69 | /DISCARD/ : |
94d8217d | 70 | { |
d87e370b DE |
71 | *(.debug\$S) |
72 | *(.debug\$T) | |
73 | *(.debug\$F) | |
74 | *(.drectve) | |
3f38a017 | 75 | } |
d87e370b | 76 | |
155d9cc4 | 77 | .idata ${RELOCATING+BLOCK(__section_alignment__)} : |
94d8217d ILT |
78 | { |
79 | /* This cannot currently be handled with grouped sections. | |
80 | See pe.em:sort_sections. */ | |
9216fffa ILT |
81 | ${RELOCATING+*(.idata\$2)} |
82 | ${RELOCATING+*(.idata\$3)} | |
94d8217d ILT |
83 | ${RELOCATING+ /* These zeroes mark the end of the import list. */} |
84 | ${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);} | |
9216fffa ILT |
85 | ${RELOCATING+*(.idata\$4)} |
86 | ${RELOCATING+*(.idata\$5)} | |
87 | ${RELOCATING+*(.idata\$6)} | |
88 | ${RELOCATING+*(.idata\$7)} | |
3f38a017 | 89 | } |
155d9cc4 | 90 | .CRT ${RELOCATING+BLOCK(__section_alignment__)} : |
3f38a017 | 91 | { |
155d9cc4 | 92 | ${RELOCATING+*(.CRT\$*)} |
3f38a017 | 93 | } |
d87e370b | 94 | |
155d9cc4 | 95 | .endjunk ${RELOCATING+BLOCK(__section_alignment__)} : |
d87e370b | 96 | { |
f2618f82 | 97 | /* end is deprecated, don't use it */ |
94d8217d ILT |
98 | ${RELOCATING+ end = .;} |
99 | ${RELOCATING+ __end__ = .;} | |
3f38a017 | 100 | } |
d87e370b | 101 | |
155d9cc4 | 102 | .reloc ${RELOCATING+BLOCK(__section_alignment__)} : |
a12e6215 ILT |
103 | { |
104 | *(.reloc) | |
105 | } | |
106 | ||
155d9cc4 | 107 | .rsrc ${RELOCATING+BLOCK(__section_alignment__)} : |
a12e6215 ILT |
108 | { |
109 | *(.rsrc) | |
155d9cc4 | 110 | ${RELOCATING+*(.rsrc\$*)} |
a12e6215 ILT |
111 | } |
112 | ||
155d9cc4 | 113 | .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : |
3f38a017 SC |
114 | { |
115 | [ .stab ] | |
116 | } | |
117 | ||
155d9cc4 | 118 | .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : |
3f38a017 SC |
119 | { |
120 | [ .stabstr ] | |
121 | } | |
d87e370b | 122 | |
3f38a017 SC |
123 | } |
124 | EOF |