Thu Aug 17 13:35:49 1995 steve chamberlain <sac@slash.cygnus.com>
[binutils-gdb.git] / ld / scripttempl / pe.sc
1 # Linker script for PE.
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
7 OUTPUT_FORMAT(${OUTPUT_FORMAT})
8 ${LIB_SEARCH_DIRS}
9
10 ENTRY(_mainCRTStartup)
11
12 SECTIONS
13 {
14
15 .text ${RELOCATING+ 0x401000} :
16 {
17 ${RELOCATING+ *(.init);}
18 *(.text)
19 ${CONSTRUCTING+ ___CTOR_LIST__ = .; LONG (-1); *(.ctor); LONG (0); }
20 ${CONSTRUCTING+ ___DTOR_LIST__ = .; LONG (-1); *(.dtor); LONG (0); }
21 ${RELOCATING+ *(.fini);}
22 ${RELOCATING+ etext = .};
23 }
24
25 .bss BLOCK(0x1000) :
26 {
27 *(.bss)
28 *(COMMON);
29 }
30
31 .rdata BLOCK(0x1000) :
32 {
33 *(.rdata)
34 ;
35 }
36 .data BLOCK(0x1000) : {
37 *(.data)
38 *(.data2)
39 ;
40 }
41 .idata BLOCK(0x1000) :
42 {
43 *(.idata\$2)
44 *(.idata\$3)
45 *(.idata\$4)
46 *(.idata\$5)
47 *(.idata\$6)
48 *(.idata\$7)
49 ;
50 }
51 .CRT BLOCK(0x1000) :
52 {
53 *(.CRT\$XCA)
54 *(.CRT\$XCC)
55 *(.CRT\$XCZ)
56 *(.CRT\$XIA)
57 *(.CRT\$XIC)
58 *(.CRT\$XIZ)
59 *(.CRT\$XLA)
60 *(.CRT\$XLZ)
61 *(.CRT\$XPA)
62 *(.CRT\$XPX)
63 *(.CRT\$XPZ)
64 *(.CRT\$XTA)
65 *(.CRT\$XTZ)
66 ;
67 }
68 .rsrc BLOCK(0x1000) :
69 {
70 *(.rsrc\$01)
71 *(.rsrc\$02)
72 ;
73 }
74 .reloc BLOCK(0x1000) :
75 {
76 *(.reloc)
77 ;
78 }
79 .junk BLOCK(0x1000) :
80 {
81 *(.debug\$S)
82 *(.debug\$T)
83 *(.debug\$F)
84 *(.drectve)
85 ;
86 }
87 .stab 0 ${RELOCATING+(NOLOAD)} :
88 {
89 [ .stab ]
90 }
91
92 .stabstr 0 ${RELOCATING+(NOLOAD)} :
93 {
94 [ .stabstr ]
95 }
96 }
97 EOF