* scripttempl/pe.sc: Put .stab and .stabstr sections at end.
[deliverable/binutils-gdb.git] / ld / scripttempl / pe.sc
1 # Linker script for PE.
2
3 cat <<EOF
4 OUTPUT_FORMAT(${OUTPUT_FORMAT})
5 ${LIB_SEARCH_DIRS}
6
7 ENTRY(_mainCRTStartup)
8
9 SECTIONS
10 {
11 .text ${RELOCATING+ __image_base__ + __section_alignment__ } :
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 }
28
29 .bss BLOCK(__section_alignment__) :
30 {
31 __bss_start__ = . ;
32 *(.bss)
33 *(COMMON)
34 __bss_end__ = . ;
35 }
36 .data BLOCK(__section_alignment__) :
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 }
46
47 .rdata BLOCK(__section_alignment__) :
48 {
49 *(.rdata)
50 /* Grouped section support currently must be explicitly provided for
51 in the linker script. */
52 *(.rdata\$)
53 }
54
55 .edata BLOCK(__section_alignment__) :
56 {
57 *(.edata)
58 }
59
60 /DISCARD/ BLOCK(__section_alignment__) :
61 {
62 *(.debug\$S)
63 *(.debug\$T)
64 *(.debug\$F)
65 *(.drectve)
66 }
67
68 .idata BLOCK(__section_alignment__) :
69 {
70 /* This cannot currently be handled with grouped sections.
71 See pe.em:sort_sections. */
72 *(.idata\$2)
73 *(.idata\$3)
74 ${RELOCATING+ /* These zeroes mark the end of the import list. */}
75 ${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);}
76 *(.idata\$4)
77 *(.idata\$5)
78 *(.idata\$6)
79 *(.idata\$7)
80 }
81 .CRT BLOCK(__section_alignment__) :
82 {
83 /* Grouped sections are used to handle .CRT\$foo. */
84 *(.CRT\$)
85 }
86
87 .endjunk BLOCK(__section_alignment__) :
88 {
89 /* end is deprecated, don't use it */
90 ${RELOCATING+ end = .;}
91 ${RELOCATING+ __end__ = .;}
92 }
93
94 .reloc BLOCK(__section_alignment__) :
95 {
96 *(.reloc)
97 }
98
99 .rsrc BLOCK(__section_alignment__) :
100 {
101 *(.rsrc)
102 /* Grouped sections are used to handle .rsrc\$0[12]. */
103 *(.rsrc\$)
104 }
105
106 .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
107 {
108 [ .stab ]
109 }
110
111 .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
112 {
113 [ .stabstr ]
114 }
115
116 }
117 EOF
This page took 0.048596 seconds and 5 git commands to generate.