Thu Mar 19 14:54:45 1998 Geoffrey Noer <noer@cygnus.com>
[deliverable/binutils-gdb.git] / ld / scripttempl / pe.sc
1 # Linker script for PE.
2
3 if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
4 RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
5 fi
6
7 cat <<EOF
8 ${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
9 ${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
10
11 ${LIB_SEARCH_DIRS}
12
13 ENTRY(_mainCRTStartup)
14
15 SECTIONS
16 {
17 .text ${RELOCATING+ __image_base__ + __section_alignment__ } :
18 {
19 ${RELOCATING+ *(.init)}
20 *(.text)
21 ${RELOCATING+*(.text\$*)}
22 ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
23 LONG (-1); *(.ctors); *(.ctor); LONG (0); }
24 ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
25 LONG (-1); *(.dtors); *(.dtor); LONG (0); }
26 ${RELOCATING+ *(.fini)}
27 /* ??? Why is .gcc_exc here? */
28 ${RELOCATING+ *(.gcc_exc)}
29 ${RELOCATING+ etext = .;}
30 *(.gcc_except_table)
31 }
32
33 .data ${RELOCATING+BLOCK(__section_alignment__)} :
34 {
35 ${RELOCATING+__data_start__ = . ;}
36 *(.data)
37 *(.data2)
38 ${RELOCATING+*(.data\$*)}
39 ${RELOCATING+__data_end__ = . ;}
40 ${RELOCATING+*(.data_cygwin_nocopy)}
41 }
42
43 .bss ${RELOCATING+BLOCK(__section_alignment__)} :
44 {
45 ${RELOCATING+__bss_start__ = . ;}
46 *(.bss)
47 *(COMMON)
48 ${RELOCATING+__bss_end__ = . ;}
49 }
50
51 .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
52 {
53 *(.rdata)
54 ${RELOCATING+*(.rdata\$*)}
55 *(.eh_frame)
56 }
57
58 .edata ${RELOCATING+BLOCK(__section_alignment__)} :
59 {
60 *(.edata)
61 }
62
63 /DISCARD/ :
64 {
65 *(.debug\$S)
66 *(.debug\$T)
67 *(.debug\$F)
68 *(.drectve)
69 }
70
71 .idata ${RELOCATING+BLOCK(__section_alignment__)} :
72 {
73 /* This cannot currently be handled with grouped sections.
74 See pe.em:sort_sections. */
75 *(.idata\$2)
76 *(.idata\$3)
77 ${RELOCATING+ /* These zeroes mark the end of the import list. */}
78 ${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);}
79 *(.idata\$4)
80 *(.idata\$5)
81 *(.idata\$6)
82 *(.idata\$7)
83 }
84 .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
85 {
86 ${RELOCATING+*(.CRT\$*)}
87 }
88
89 .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
90 {
91 /* end is deprecated, don't use it */
92 ${RELOCATING+ end = .;}
93 ${RELOCATING+ __end__ = .;}
94 }
95
96 .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
97 {
98 *(.reloc)
99 }
100
101 .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
102 {
103 *(.rsrc)
104 ${RELOCATING+*(.rsrc\$*)}
105 }
106
107 .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
108 {
109 [ .stab ]
110 }
111
112 .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
113 {
114 [ .stabstr ]
115 }
116
117 }
118 EOF
This page took 0.039667 seconds and 5 git commands to generate.