Commit | Line | Data |
---|---|---|
eb7f87c5 | 1 | # Linker script for PE. |
94d8217d | 2 | |
3f38a017 | 3 | cat <<EOF |
eb7f87c5 | 4 | OUTPUT_FORMAT(${OUTPUT_FORMAT}) |
3f38a017 SC |
5 | ${LIB_SEARCH_DIRS} |
6 | ||
7 | ENTRY(_mainCRTStartup) | |
8 | ||
9 | SECTIONS | |
10 | { | |
d87e370b | 11 | .text ${RELOCATING+ __image_base__ + __section_alignment__ } : |
94d8217d ILT |
12 | { |
13 | ${RELOCATING+ *(.init)} | |
14 | *(.text) | |
15 | ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; | |
16 | LONG (-1); *(.ctors); *(.ctor); LONG (0); } | |
17 | ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; | |
18 | LONG (-1); *(.dtors); *(.dtor); LONG (0); } | |
19 | ${RELOCATING+ *(.fini)} | |
20 | /* ??? Why is .gcc_exc here? */ | |
21 | ${RELOCATING+ *(.gcc_exc)} | |
22 | ${RELOCATING+ etext = .;} | |
23 | /* Grouped section support currently must be explicitly provided for | |
24 | in the linker script. */ | |
25 | *(.text\$) | |
26 | *(.gcc_except_table) | |
27 | } | |
3f38a017 | 28 | |
d87e370b | 29 | .bss BLOCK(__section_alignment__) : |
94d8217d ILT |
30 | { |
31 | __bss_start__ = . ; | |
32 | *(.bss) | |
33 | *(COMMON) | |
34 | __bss_end__ = . ; | |
35 | } | |
d87e370b | 36 | .data BLOCK(__section_alignment__) : |
94d8217d ILT |
37 | { |
38 | __data_start__ = . ; | |
39 | *(.data) | |
40 | *(.data2) | |
41 | __data_end__ = . ; | |
42 | /* Grouped section support currently must be explicitly provided for | |
43 | in the linker script. */ | |
44 | *(.data\$) | |
45 | } | |
3f38a017 | 46 | |
d87e370b | 47 | .rdata BLOCK(__section_alignment__) : |
94d8217d | 48 | { |
3f38a017 | 49 | *(.rdata) |
94d8217d ILT |
50 | /* Grouped section support currently must be explicitly provided for |
51 | in the linker script. */ | |
52 | *(.rdata\$) | |
3f38a017 | 53 | } |
d87e370b | 54 | |
94d8217d ILT |
55 | .edata BLOCK(__section_alignment__) : |
56 | { | |
57 | *(.edata) | |
d87e370b DE |
58 | } |
59 | ||
94d8217d ILT |
60 | /DISCARD/ BLOCK(__section_alignment__) : |
61 | { | |
d87e370b DE |
62 | *(.debug\$S) |
63 | *(.debug\$T) | |
64 | *(.debug\$F) | |
65 | *(.drectve) | |
3f38a017 | 66 | } |
d87e370b DE |
67 | |
68 | .idata BLOCK(__section_alignment__) : | |
94d8217d ILT |
69 | { |
70 | /* This cannot currently be handled with grouped sections. | |
71 | See pe.em:sort_sections. */ | |
de71eb77 SC |
72 | *(.idata\$2) |
73 | *(.idata\$3) | |
94d8217d ILT |
74 | ${RELOCATING+ /* These zeroes mark the end of the import list. */} |
75 | ${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);} | |
de71eb77 SC |
76 | *(.idata\$4) |
77 | *(.idata\$5) | |
78 | *(.idata\$6) | |
79 | *(.idata\$7) | |
3f38a017 | 80 | } |
d87e370b | 81 | .CRT BLOCK(__section_alignment__) : |
3f38a017 | 82 | { |
94d8217d ILT |
83 | /* Grouped sections are used to handle .CRT\$foo. */ |
84 | *(.CRT\$) | |
3f38a017 | 85 | } |
d87e370b | 86 | .rsrc BLOCK(__section_alignment__) : |
3f38a017 | 87 | { |
94d8217d ILT |
88 | /* Grouped sections are used to handle .rsrc\$0[12]. */ |
89 | *(.rsrc\$) | |
3f38a017 | 90 | } |
d87e370b DE |
91 | |
92 | .endjunk BLOCK(__section_alignment__) : | |
93 | { | |
f2618f82 | 94 | /* end is deprecated, don't use it */ |
94d8217d ILT |
95 | ${RELOCATING+ end = .;} |
96 | ${RELOCATING+ __end__ = .;} | |
3f38a017 | 97 | } |
d87e370b DE |
98 | |
99 | .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} : | |
3f38a017 SC |
100 | { |
101 | [ .stab ] | |
102 | } | |
103 | ||
d87e370b | 104 | .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} : |
3f38a017 SC |
105 | { |
106 | [ .stabstr ] | |
107 | } | |
d87e370b | 108 | |
d87e370b DE |
109 | .reloc BLOCK(__section_alignment__) : |
110 | { | |
111 | *(.reloc) | |
d87e370b | 112 | } |
3f38a017 SC |
113 | } |
114 | EOF |