1/* Default linker script, for normal executables */
2OUTPUT_FORMAT(pei-i386)
3SEARCH_DIR("/usr/local/mingw32/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
4SECTIONS
5{
6  /* Make the virtual address and file offset synced if the alignment is
7     lower than the target page size. */
8  . = SIZEOF_HEADERS;
9  . = ALIGN(__section_alignment__);
10  .text  __image_base__ + ( __section_alignment__ < 0x1000 ? . : __section_alignment__ ) :
11  {
12     *(.init)
13    *(.text)
14    *(SORT(.text$*))
15    *(.glue_7t)
16    *(.glue_7)
17     ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
18			LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*));  LONG (0);
19     ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
20			LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*));  LONG (0);
21     *(.fini)
22    /* ??? Why is .gcc_exc here?  */
23     *(.gcc_exc)
24    PROVIDE (etext = .);
25     *(.gcc_except_table)
26  }
27
28  /* setction information for finsh shell begin */
29  . = ALIGN(__section_alignment__);
30  FSymTab () :
31  {
32      ___fsymtab_start = .; __fsymtab_start = .;
33      KEEP(*(FSymTab))
34      ___fsymtab_end = .; __fsymtab_end = .;
35  }
36  . = ALIGN(__section_alignment__);
37  VSymTab () :
38  {
39      ___vsymtab_start = .; __vsymtab_start = .;
40      KEEP(*(VSymTab))
41      ___vsymtab_end = .; __vsymtab_end = .;
42  }
43  . = ALIGN(__section_alignment__);
44  rti_fn () :
45  {
46      __rt_init_start = .;
47      KEEP(*(SORT(.rti_fn*)))
48	  __rt_init_end = .;
49  }
50  . = ALIGN(__section_alignment__);
51  /* setction information for finsh shell end */
52
53  /* The Cygwin32 library uses a section to avoid copying certain data
54     on fork.  This used to be named ".data".  The linker used
55     to include this between __data_start__ and __data_end__, but that
56     breaks building the cygwin32 dll.  Instead, we name the section
57     ".data_cygwin_nocopy" and explictly include it after __data_end__. */
58  .data BLOCK(__section_alignment__) :
59  {
60    __data_start__ = . ;
61    *(.data)
62    *(.data2)
63    *(SORT(.data$*))
64    *(.jcr)
65    __data_end__ = . ;
66    *(.data_cygwin_nocopy)
67  }
68
69  .rdata BLOCK(__section_alignment__) :
70  {
71    *(.rdata)
72             *(SORT(.rdata$*))
73     *(.eh_frame)
74    ___RUNTIME_PSEUDO_RELOC_LIST__ = .;
75    __RUNTIME_PSEUDO_RELOC_LIST__ = .;
76    *(.rdata_runtime_pseudo_reloc)
77    ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
78    __RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
79  }
80  .pdata BLOCK(__section_alignment__) :
81  {
82    *(.pdata)
83  }
84  .bss BLOCK(__section_alignment__) :
85  {
86    __bss_start__ = . ;
87    *(.bss)
88    *(COMMON)
89    __bss_end__ = . ;
90  }
91  .edata BLOCK(__section_alignment__) :
92  {
93    *(.edata)
94  }
95  /DISCARD/ :
96  {
97    *(.debug$S)
98    *(.debug$T)
99    *(.debug$F)
100    *(.drectve)
101  }
102  .idata BLOCK(__section_alignment__) :
103  {
104    /* This cannot currently be handled with grouped sections.
105	See pe.em:sort_sections.  */
106    SORT(*)(.idata$2)
107    SORT(*)(.idata$3)
108    /* These zeroes mark the end of the import list.  */
109    LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
110    SORT(*)(.idata$4)
111    SORT(*)(.idata$5)
112    SORT(*)(.idata$6)
113    SORT(*)(.idata$7)
114  }
115  .CRT BLOCK(__section_alignment__) :
116  {
117    ___crt_xc_start__ = . ;
118    *(SORT(.CRT$XC*))  /* C initialization */
119    ___crt_xc_end__ = . ;
120    ___crt_xi_start__ = . ;
121    *(SORT(.CRT$XI*))  /* C++ initialization */
122    ___crt_xi_end__ = . ;
123    ___crt_xl_start__ = . ;
124    *(SORT(.CRT$XL*))  /* TLS callbacks */
125    /* ___crt_xl_end__ is defined in the TLS Directory support code */
126    ___crt_xp_start__ = . ;
127    *(SORT(.CRT$XP*))  /* Pre-termination */
128    ___crt_xp_end__ = . ;
129    ___crt_xt_start__ = . ;
130    *(SORT(.CRT$XT*))  /* Termination */
131    ___crt_xt_end__ = . ;
132  }
133  .tls BLOCK(__section_alignment__) :
134  {
135    ___tls_start__ = . ;
136    *(.tls)
137    *(.tls$)
138    *(SORT(.tls$*))
139    ___tls_end__ = . ;
140  }
141  .endjunk BLOCK(__section_alignment__) :
142  {
143    /* end is deprecated, don't use it */
144    PROVIDE (end = .);
145    PROVIDE ( _end = .);
146     __end__ = .;
147  }
148  .rsrc BLOCK(__section_alignment__) :
149  {
150    *(.rsrc)
151    *(SORT(.rsrc$*))
152  }
153  .reloc BLOCK(__section_alignment__) :
154  {
155    *(.reloc)
156  }
157  .stab BLOCK(__section_alignment__) (NOLOAD) :
158  {
159    *(.stab)
160  }
161  .stabstr BLOCK(__section_alignment__) (NOLOAD) :
162  {
163    *(.stabstr)
164  }
165  /* DWARF debug sections.
166     Symbols in the DWARF debugging sections are relative to the beginning
167     of the section.  Unlike other targets that fake this by putting the
168     section VMA at 0, the PE format will not allow it.  */
169  /* DWARF 1.1 and DWARF 2.  */
170  .debug_aranges BLOCK(__section_alignment__) (NOLOAD) :
171  {
172    *(.debug_aranges)
173  }
174  .debug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
175  {
176    *(.debug_pubnames)
177  }
178  /* DWARF 2.  */
179  .debug_info BLOCK(__section_alignment__) (NOLOAD) :
180  {
181    *(.debug_info) *(.gnu.linkonce.wi.*)
182  }
183  .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
184  {
185    *(.debug_abbrev)
186  }
187  .debug_line BLOCK(__section_alignment__) (NOLOAD) :
188  {
189    *(.debug_line)
190  }
191  .debug_frame BLOCK(__section_alignment__) (NOLOAD) :
192  {
193    *(.debug_frame)
194  }
195  .debug_str BLOCK(__section_alignment__) (NOLOAD) :
196  {
197    *(.debug_str)
198  }
199  .debug_loc BLOCK(__section_alignment__) (NOLOAD) :
200  {
201    *(.debug_loc)
202  }
203  .debug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
204  {
205    *(.debug_macinfo)
206  }
207  /* SGI/MIPS DWARF 2 extensions.  */
208  .debug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
209  {
210    *(.debug_weaknames)
211  }
212  .debug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
213  {
214    *(.debug_funcnames)
215  }
216  .debug_typenames BLOCK(__section_alignment__) (NOLOAD) :
217  {
218    *(.debug_typenames)
219  }
220  .debug_varnames BLOCK(__section_alignment__) (NOLOAD) :
221  {
222    *(.debug_varnames)
223  }
224  /* DWARF 3.  */
225  .debug_ranges BLOCK(__section_alignment__) (NOLOAD) :
226  {
227    *(.debug_ranges)
228  }
229}
230
231