Commit | Line | Data |
---|---|---|
eb7f87c5 | 1 | # Linker script for PE. |
3f38a017 SC |
2 | # These are substituted in as variables in order to get '}' in a shell |
3 | # conditional expansion. | |
4 | INIT='.init : { *(.init) }' | |
5 | FINI='.fini : { *(.fini) }' | |
6 | cat <<EOF | |
eb7f87c5 | 7 | OUTPUT_FORMAT(${OUTPUT_FORMAT}) |
3f38a017 SC |
8 | ${LIB_SEARCH_DIRS} |
9 | ||
10 | ENTRY(_mainCRTStartup) | |
11 | ||
12 | SECTIONS | |
13 | { | |
14 | ||
d87e370b | 15 | .text ${RELOCATING+ __image_base__ + __section_alignment__ } : |
3f38a017 SC |
16 | { |
17 | ${RELOCATING+ *(.init);} | |
18 | *(.text) | |
d87e370b DE |
19 | ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; |
20 | LONG (-1); *(.ctors); *(.ctor); LONG (0); } | |
21 | ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; | |
22 | LONG (-1); *(.dtors); *(.dtor); LONG (0); } | |
3f38a017 SC |
23 | ${RELOCATING+ *(.fini);} |
24 | ${RELOCATING+ etext = .}; | |
25 | } | |
26 | ||
d87e370b | 27 | .bss BLOCK(__section_alignment__) : |
3f38a017 | 28 | { |
d87e370b DE |
29 | __bss_start__ = . ; |
30 | *(.bss) ; | |
3f38a017 | 31 | *(COMMON); |
d87e370b DE |
32 | __bss_end__ = . ; |
33 | } | |
34 | .data BLOCK(__section_alignment__) : | |
35 | { | |
36 | __data_start__ = . ; | |
37 | *(.data); | |
38 | *(.data2); | |
39 | __data_end__ = . ; | |
3f38a017 SC |
40 | } |
41 | ||
d87e370b | 42 | .rdata BLOCK(__section_alignment__) : |
3f38a017 SC |
43 | { |
44 | *(.rdata) | |
45 | ; | |
46 | } | |
d87e370b DE |
47 | |
48 | ||
49 | ||
50 | .edata BLOCK(__section_alignment__) : { | |
51 | *(.edata) ; | |
52 | } | |
53 | ||
781332fa | 54 | /* See coffcode.h. These are discarded. */ |
d87e370b DE |
55 | .junk BLOCK(__section_alignment__) : { |
56 | *(.debug\$S) | |
57 | *(.debug\$T) | |
58 | *(.debug\$F) | |
59 | *(.drectve) | |
3f38a017 SC |
60 | ; |
61 | } | |
d87e370b DE |
62 | |
63 | .idata BLOCK(__section_alignment__) : | |
3f38a017 | 64 | { |
de71eb77 SC |
65 | *(.idata\$2) |
66 | *(.idata\$3) | |
67 | *(.idata\$4) | |
68 | *(.idata\$5) | |
69 | *(.idata\$6) | |
70 | *(.idata\$7) | |
3f38a017 SC |
71 | ; |
72 | } | |
d87e370b | 73 | .CRT BLOCK(__section_alignment__) : |
3f38a017 | 74 | { |
de71eb77 SC |
75 | *(.CRT\$XCA) |
76 | *(.CRT\$XCC) | |
77 | *(.CRT\$XCZ) | |
78 | *(.CRT\$XIA) | |
79 | *(.CRT\$XIC) | |
80 | *(.CRT\$XIZ) | |
81 | *(.CRT\$XLA) | |
82 | *(.CRT\$XLZ) | |
83 | *(.CRT\$XPA) | |
84 | *(.CRT\$XPX) | |
85 | *(.CRT\$XPZ) | |
86 | *(.CRT\$XTA) | |
87 | *(.CRT\$XTZ) | |
3f38a017 SC |
88 | ; |
89 | } | |
d87e370b | 90 | .rsrc BLOCK(__section_alignment__) : |
3f38a017 | 91 | { |
de71eb77 SC |
92 | *(.rsrc\$01) |
93 | *(.rsrc\$02) | |
3f38a017 SC |
94 | ; |
95 | } | |
d87e370b DE |
96 | |
97 | .endjunk BLOCK(__section_alignment__) : | |
98 | { | |
99 | ${RELOCATING+ end = .}; | |
3f38a017 | 100 | } |
d87e370b DE |
101 | |
102 | .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} : | |
3f38a017 SC |
103 | { |
104 | [ .stab ] | |
105 | } | |
106 | ||
d87e370b | 107 | .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} : |
3f38a017 SC |
108 | { |
109 | [ .stabstr ] | |
110 | } | |
d87e370b DE |
111 | |
112 | ||
113 | .reloc BLOCK(__section_alignment__) : | |
114 | { | |
115 | *(.reloc) | |
116 | ; | |
117 | } | |
118 | ||
119 | ||
3f38a017 SC |
120 | } |
121 | EOF |