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