Wed Jan 28 16:37:27 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
[deliverable/binutils-gdb.git] / ld / scripttempl / pe.sc
CommitLineData
eb7f87c5 1# Linker script for PE.
94d8217d 2
3f38a017 3cat <<EOF
eb7f87c5 4OUTPUT_FORMAT(${OUTPUT_FORMAT})
3f38a017
SC
5${LIB_SEARCH_DIRS}
6
7ENTRY(_mainCRTStartup)
8
9SECTIONS
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
DE
86
87 .endjunk BLOCK(__section_alignment__) :
88 {
f2618f82 89 /* end is deprecated, don't use it */
94d8217d
ILT
90 ${RELOCATING+ end = .;}
91 ${RELOCATING+ __end__ = .;}
3f38a017 92 }
d87e370b 93
a12e6215
ILT
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
d87e370b 106 .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
3f38a017
SC
107 {
108 [ .stab ]
109 }
110
d87e370b 111 .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
3f38a017
SC
112 {
113 [ .stabstr ]
114 }
d87e370b 115
3f38a017
SC
116}
117EOF
This page took 0.11464 seconds and 4 git commands to generate.