1 # Linker script for MCore PE.
3 # Copyright (C) 2014-2019 Free Software Foundation, Inc.
5 # Copying and distribution of this file, with or without modification,
6 # are permitted in any medium without royalty provided the copyright
7 # notice and this notice are preserved.
9 if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
10 RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
13 # We can't easily and portably get an unquoted $ in a shell
14 # substitution, so we do this instead.
15 # Sorting of the .foo$* sections is required by the definition of
16 # grouped sections in PE.
17 # Sorting of the file names in R_IDATA is required by the
18 # current implementation of dlltool (this could probably be changed to
19 # use grouped sections instead).
20 if test "${RELOCATING}"; then
21 R_TEXT='*(SORT(.text$*))'
22 R_DATA='*(SORT(.data$*))'
23 R_RDATA='*(SORT(.rdata$*))'
27 /* These zeroes mark the end of the import list. */
28 LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
33 R_CRT='*(SORT(.CRT$*))'
34 R_RSRC='*(SORT(.rsrc$*))'
44 if test "$RELOCATING"; then
45 # Can't use ${RELOCATING+blah "blah" blah} for this,
46 # because bash 2.x will lose the doublequotes.
48 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
49 "${LITTLE_OUTPUT_FORMAT}")
54 /* Copyright (C) 2014-2019 Free Software Foundation, Inc.
56 Copying and distribution of this script, with or without modification,
57 are permitted in any medium without royalty provided the copyright
58 notice and this notice are preserved. */
62 ${RELOCATING+ENTRY (_mainCRTStartup)}
66 .text ${RELOCATING+ __image_base__ + __section_alignment__ } :
68 ${RELOCATING+ KEEP (*(SORT_NONE(.init)))}
71 ${RELOCATING+ *(.text.*)}
74 ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
75 LONG (-1); *(.ctors); *(.ctor); LONG (0); }
76 ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
77 LONG (-1); *(.dtors); *(.dtor); LONG (0); }
78 ${RELOCATING+ KEEP (*(SORT_NONE(.fini)))}
79 /* ??? Why is .gcc_exc here? */
80 ${RELOCATING+ *(.gcc_exc)}
81 ${RELOCATING+ etext = .;}
85 /* The Cygwin32 library uses a section to avoid copying certain data
86 on fork. This used to be named ".data$nocopy". The linker used
87 to include this between __data_start__ and __data_end__, but that
88 breaks building the cygwin32 dll. Instead, we name the section
89 ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
91 .data ${RELOCATING+BLOCK(__section_alignment__)} :
93 ${RELOCATING+__data_start__ = . ;}
97 ${RELOCATING+__data_end__ = . ;}
98 ${RELOCATING+*(.data_cygwin_nocopy)}
101 .bss ${RELOCATING+BLOCK(__section_alignment__)} :
103 ${RELOCATING+__bss_start__ = . ;}
106 ${RELOCATING+__bss_end__ = . ;}
109 .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
116 .edata ${RELOCATING+BLOCK(__section_alignment__)} :
129 .idata ${RELOCATING+BLOCK(__section_alignment__)} :
131 /* This cannot currently be handled with grouped sections.
132 See pe.em:sort_sections. */
135 .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
140 .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
142 /* end is deprecated, don't use it */
143 ${RELOCATING+ end = .;}
144 ${RELOCATING+ _end = .;}
145 ${RELOCATING+ __end__ = .;}
148 .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
153 .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
159 .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
164 .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :