• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Default linker script, for normal executables */
2 /* Copyright (C) 2014-2016 Free Software Foundation, Inc.
3    Copying and distribution of this script, with or without modification,
4    are permitted in any medium without royalty provided the copyright
5    notice and this notice are preserved.  */
6 OUTPUT_FORMAT(pei-i386)
7 SEARCH_DIR("=/mnt/disks/build-disk/src/android/mingw/out/install/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
8 SECTIONS
9 {
10   /* Make the virtual address and file offset synced if the alignment is
11      lower than the target page size. */
12   . = SIZEOF_HEADERS;
13   . = ALIGN(__section_alignment__);
14   .text  __image_base__ + ( __section_alignment__ < 0x1000 ? . : __section_alignment__ ) :
15   {
16      KEEP(*(.init))
17     *(.text)
18     *(SORT(.text$*))
19      *(.text.*)
20      *(.gnu.linkonce.t.*)
21     *(.glue_7t)
22     *(.glue_7)
23     . = ALIGN(4);
24      ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
25 			LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*));  LONG (0);
26      ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
27 			LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*));  LONG (0);
28      *(.fini)
29     /* ??? Why is .gcc_exc here?  */
30      *(.gcc_exc)
31     PROVIDE (etext = .);
32     PROVIDE (_etext = .);
33      *(.gcc_except_table)
34   }
35   /* The Cygwin32 library uses a section to avoid copying certain data
36      on fork.  This used to be named ".data".  The linker used
37      to include this between __data_start__ and __data_end__, but that
38      breaks building the cygwin32 dll.  Instead, we name the section
39      ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
BLOCK(__section_alignment__)40   .data BLOCK(__section_alignment__) :
41   {
42     __data_start__ = . ;
43     *(.data)
44     *(.data2)
45     *(SORT(.data$*))
46     KEEP(*(.jcr))
47     __data_end__ = . ;
48     *(.data_cygwin_nocopy)
49   }
BLOCK(__section_alignment__)50   .rdata BLOCK(__section_alignment__) :
51   {
52     *(.rdata)
53              *(SORT(.rdata$*))
54     __rt_psrelocs_start = .;
55     KEEP(*(.rdata_runtime_pseudo_reloc))
56     __rt_psrelocs_end = .;
57   }
58   __rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;
59   ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
60   __RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
61   ___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
62   __RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
BLOCK(__section_alignment__)63   .eh_frame BLOCK(__section_alignment__) :
64   {
65     KEEP(*(.eh_frame*))
66   }
BLOCK(__section_alignment__)67   .pdata BLOCK(__section_alignment__) :
68   {
69     KEEP(*(.pdata))
70   }
BLOCK(__section_alignment__)71   .bss BLOCK(__section_alignment__) :
72   {
73     __bss_start__ = . ;
74     *(.bss)
75     *(COMMON)
76     __bss_end__ = . ;
77   }
BLOCK(__section_alignment__)78   .edata BLOCK(__section_alignment__) :
79   {
80     *(.edata)
81   }
82   /DISCARD/ :
83   {
84     *(.debug$S)
85     *(.debug$T)
86     *(.debug$F)
87     *(.drectve)
88      *(.note.GNU-stack)
89      *(.gnu.lto_*)
90   }
BLOCK(__section_alignment__)91   .idata BLOCK(__section_alignment__) :
92   {
93     /* This cannot currently be handled with grouped sections.
94 	See pe.em:sort_sections.  */
95     KEEP (SORT(*)(.idata$2))
96     KEEP (SORT(*)(.idata$3))
97     /* These zeroes mark the end of the import list.  */
98     LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
99     KEEP (SORT(*)(.idata$4))
100     __IAT_start__ = .;
101     KEEP (SORT(*)(.idata$5))
102     __IAT_end__ = .;
103     KEEP (SORT(*)(.idata$6))
104     KEEP (SORT(*)(.idata$7))
105   }
BLOCK(__section_alignment__)106   .CRT BLOCK(__section_alignment__) :
107   {
108     ___crt_xc_start__ = . ;
109     KEEP (*(SORT(.CRT$XC*)))  /* C initialization */
110     ___crt_xc_end__ = . ;
111     ___crt_xi_start__ = . ;
112     KEEP (*(SORT(.CRT$XI*)))  /* C++ initialization */
113     ___crt_xi_end__ = . ;
114     ___crt_xl_start__ = . ;
115     KEEP (*(SORT(.CRT$XL*)))  /* TLS callbacks */
116     /* ___crt_xl_end__ is defined in the TLS Directory support code */
117     ___crt_xp_start__ = . ;
118     KEEP (*(SORT(.CRT$XP*)))  /* Pre-termination */
119     ___crt_xp_end__ = . ;
120     ___crt_xt_start__ = . ;
121     KEEP (*(SORT(.CRT$XT*)))  /* Termination */
122     ___crt_xt_end__ = . ;
123   }
124   /* Windows TLS expects .tls$AAA to be at the start and .tls$ZZZ to be
125      at the end of section.  This is important because _tls_start MUST
126      be at the beginning of the section to enable SECREL32 relocations with TLS
127      data.  */
BLOCK(__section_alignment__)128   .tls BLOCK(__section_alignment__) :
129   {
130     ___tls_start__ = . ;
131     KEEP (*(.tls$AAA))
132     KEEP (*(.tls))
133     KEEP (*(.tls$))
134     KEEP (*(SORT(.tls$*)))
135     KEEP (*(.tls$ZZZ))
136     ___tls_end__ = . ;
137   }
BLOCK(__section_alignment__)138   .endjunk BLOCK(__section_alignment__) :
139   {
140     /* end is deprecated, don't use it */
141     PROVIDE (end = .);
142     PROVIDE ( _end = .);
143      __end__ = .;
144   }
BLOCK(__section_alignment__)145   .rsrc BLOCK(__section_alignment__) : SUBALIGN(4)
146   {
147     KEEP (*(.rsrc))
148     KEEP (*(.rsrc$*))
149   }
BLOCK(__section_alignment__)150   .reloc BLOCK(__section_alignment__) :
151   {
152     *(.reloc)
153   }
BLOCK(__section_alignment__)154   .stab BLOCK(__section_alignment__) (NOLOAD) :
155   {
156     *(.stab)
157   }
BLOCK(__section_alignment__)158   .stabstr BLOCK(__section_alignment__) (NOLOAD) :
159   {
160     *(.stabstr)
161   }
162   /* DWARF debug sections.
163      Symbols in the DWARF debugging sections are relative to the beginning
164      of the section.  Unlike other targets that fake this by putting the
165      section VMA at 0, the PE format will not allow it.  */
166   /* DWARF 1.1 and DWARF 2.  */
BLOCK(__section_alignment__)167   .debug_aranges BLOCK(__section_alignment__) (NOLOAD) :
168   {
169     *(.debug_aranges)
170   }
BLOCK(__section_alignment__)171   .zdebug_aranges BLOCK(__section_alignment__) (NOLOAD) :
172   {
173     *(.zdebug_aranges)
174   }
BLOCK(__section_alignment__)175   .debug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
176   {
177     *(.debug_pubnames)
178   }
BLOCK(__section_alignment__)179   .zdebug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
180   {
181     *(.zdebug_pubnames)
182   }
BLOCK(__section_alignment__)183   .debug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
184   {
185     *(.debug_pubtypes)
186   }
BLOCK(__section_alignment__)187   .zdebug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
188   {
189     *(.zdebug_pubtypes)
190   }
191   /* DWARF 2.  */
BLOCK(__section_alignment__)192   .debug_info BLOCK(__section_alignment__) (NOLOAD) :
193   {
194     *(.debug_info .gnu.linkonce.wi.*)
195   }
BLOCK(__section_alignment__)196   .zdebug_info BLOCK(__section_alignment__) (NOLOAD) :
197   {
198     *(.zdebug_info .zdebug.gnu.linkonce.wi.*)
199   }
BLOCK(__section_alignment__)200   .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
201   {
202     *(.debug_abbrev)
203   }
BLOCK(__section_alignment__)204   .zdebug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
205   {
206     *(.zdebug_abbrev)
207   }
BLOCK(__section_alignment__)208   .debug_line BLOCK(__section_alignment__) (NOLOAD) :
209   {
210     *(.debug_line)
211   }
BLOCK(__section_alignment__)212   .zdebug_line BLOCK(__section_alignment__) (NOLOAD) :
213   {
214     *(.zdebug_line)
215   }
BLOCK(__section_alignment__)216   .debug_frame BLOCK(__section_alignment__) (NOLOAD) :
217   {
218     *(.debug_frame*)
219   }
BLOCK(__section_alignment__)220   .zdebug_frame BLOCK(__section_alignment__) (NOLOAD) :
221   {
222     *(.zdebug_frame*)
223   }
BLOCK(__section_alignment__)224   .debug_str BLOCK(__section_alignment__) (NOLOAD) :
225   {
226     *(.debug_str)
227   }
BLOCK(__section_alignment__)228   .zdebug_str BLOCK(__section_alignment__) (NOLOAD) :
229   {
230     *(.zdebug_str)
231   }
BLOCK(__section_alignment__)232   .debug_loc BLOCK(__section_alignment__) (NOLOAD) :
233   {
234     *(.debug_loc)
235   }
BLOCK(__section_alignment__)236   .zdebug_loc BLOCK(__section_alignment__) (NOLOAD) :
237   {
238     *(.zdebug_loc)
239   }
BLOCK(__section_alignment__)240   .debug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
241   {
242     *(.debug_macinfo)
243   }
BLOCK(__section_alignment__)244   .zdebug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
245   {
246     *(.zdebug_macinfo)
247   }
248   /* SGI/MIPS DWARF 2 extensions.  */
BLOCK(__section_alignment__)249   .debug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
250   {
251     *(.debug_weaknames)
252   }
BLOCK(__section_alignment__)253   .zdebug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
254   {
255     *(.zdebug_weaknames)
256   }
BLOCK(__section_alignment__)257   .debug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
258   {
259     *(.debug_funcnames)
260   }
BLOCK(__section_alignment__)261   .zdebug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
262   {
263     *(.zdebug_funcnames)
264   }
BLOCK(__section_alignment__)265   .debug_typenames BLOCK(__section_alignment__) (NOLOAD) :
266   {
267     *(.debug_typenames)
268   }
BLOCK(__section_alignment__)269   .zdebug_typenames BLOCK(__section_alignment__) (NOLOAD) :
270   {
271     *(.zdebug_typenames)
272   }
BLOCK(__section_alignment__)273   .debug_varnames BLOCK(__section_alignment__) (NOLOAD) :
274   {
275     *(.debug_varnames)
276   }
BLOCK(__section_alignment__)277   .zdebug_varnames BLOCK(__section_alignment__) (NOLOAD) :
278   {
279     *(.zdebug_varnames)
280   }
BLOCK(__section_alignment__)281   .debug_macro BLOCK(__section_alignment__) (NOLOAD) :
282   {
283     *(.debug_macro)
284   }
BLOCK(__section_alignment__)285   .zdebug_macro BLOCK(__section_alignment__) (NOLOAD) :
286   {
287     *(.zdebug_macro)
288   }
289   /* DWARF 3.  */
BLOCK(__section_alignment__)290   .debug_ranges BLOCK(__section_alignment__) (NOLOAD) :
291   {
292     *(.debug_ranges)
293   }
BLOCK(__section_alignment__)294   .zdebug_ranges BLOCK(__section_alignment__) (NOLOAD) :
295   {
296     *(.zdebug_ranges)
297   }
298   /* DWARF 4.  */
BLOCK(__section_alignment__)299   .debug_types BLOCK(__section_alignment__) (NOLOAD) :
300   {
301     *(.debug_types .gnu.linkonce.wt.*)
302   }
BLOCK(__section_alignment__)303   .zdebug_types BLOCK(__section_alignment__) (NOLOAD) :
304   {
305     *(.zdebug_types .gnu.linkonce.wt.*)
306   }
307 }
308