1 # Linker script for PE.
3 if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
4 RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
7 # We can't easily and portably get an unquoted $ in a shell
8 # substitution, so we do this instead.
9 # Sorting of the .foo$* sections is required by the definition of
10 # grouped sections in PE.
11 # Sorting of the file names in R_IDATA is required by the
12 # current implementation of dlltool (this could probably be changed to
13 # use grouped sections instead).
14 if test "${RELOCATING}"; then
15 R_TEXT='*(SORT(.text$*))'
16 R_DATA='*(SORT(.data$*))'
17 R_RDATA='*(SORT(.rdata$*))'
21 /* These zeroes mark the end of the import list. */
22 LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
27 R_CRT='*(SORT(.CRT$*))'
32 R_RSRC='*(SORT(.rsrc$*))'
43 ${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
44 ${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
45 ${OUTPUT_ARCH+OUTPUT_ARCH(${OUTPUT_ARCH})}
53 .text ${RELOCATING+ __image_base__ + __section_alignment__ } :
55 ${RELOCATING+ *(.init)}
60 ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
61 LONG (-1); *(SORT(.ctors.*)); *(.ctors); *(.ctor); LONG (0); }
62 ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
63 LONG (-1); *(SORT(.dtors.*)); *(.dtors); *(.dtor); LONG (0); }
64 ${RELOCATING+ *(.fini)}
65 /* ??? Why is .gcc_exc here? */
66 ${RELOCATING+ *(.gcc_exc)}
67 ${RELOCATING+PROVIDE (etext = .);}
71 /* The Cygwin32 library uses a section to avoid copying certain data
72 on fork. This used to be named ".data$nocopy". The linker used
73 to include this between __data_start__ and __data_end__, but that
74 breaks building the cygwin32 dll. Instead, we name the section
75 ".data_cygwin_nocopy" and explictly include it after __data_end__. */
77 .data ${RELOCATING+BLOCK(__section_alignment__)} :
79 ${RELOCATING+__data_start__ = . ;}
83 ${RELOCATING+__data_end__ = . ;}
84 ${RELOCATING+*(.data_cygwin_nocopy)}
87 .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
92 ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = .;}
93 ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = .;}
94 *(.rdata_runtime_pseudo_reloc)
95 ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
96 ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
99 .pdata ${RELOCATING+BLOCK(__section_alignment__)} :
104 .bss ${RELOCATING+BLOCK(__section_alignment__)} :
106 ${RELOCATING+__bss_start__ = . ;}
109 ${RELOCATING+__bss_end__ = . ;}
112 .edata ${RELOCATING+BLOCK(__section_alignment__)} :
125 .idata ${RELOCATING+BLOCK(__section_alignment__)} :
127 /* This cannot currently be handled with grouped sections.
128 See pe.em:sort_sections. */
131 .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
136 .tls ${RELOCATING+BLOCK(__section_alignment__)} :
141 .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
143 /* end is deprecated, don't use it */
144 ${RELOCATING+PROVIDE (end = .);}
145 ${RELOCATING+PROVIDE ( _end = .);}
146 ${RELOCATING+ __end__ = .;}
149 .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
155 .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
160 .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
165 .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :