1 # Linker script for MCore 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$*))'
28 R_RSRC='*(SORT(.rsrc$*))'
38 if test "$RELOCATING"; then
39 # Can't use ${RELOCATING+blah "blah" blah} for this,
40 # because bash 2.x will lose the doublequotes.
42 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
43 "${LITTLE_OUTPUT_FORMAT}")
50 ${RELOCATING+ENTRY (_mainCRTStartup)}
54 .text ${RELOCATING+ __image_base__ + __section_alignment__ } :
56 ${RELOCATING+ *(.init)}
59 ${RELOCATING+ *(.text.*)}
62 ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
63 LONG (-1); *(.ctors); *(.ctor); LONG (0); }
64 ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
65 LONG (-1); *(.dtors); *(.dtor); LONG (0); }
66 ${RELOCATING+ *(.fini)}
67 /* ??? Why is .gcc_exc here? */
68 ${RELOCATING+ *(.gcc_exc)}
69 ${RELOCATING+ etext = .;}
73 /* The Cygwin32 library uses a section to avoid copying certain data
74 on fork. This used to be named ".data$nocopy". The linker used
75 to include this between __data_start__ and __data_end__, but that
76 breaks building the cygwin32 dll. Instead, we name the section
77 ".data_cygwin_nocopy" and explictly include it after __data_end__. */
79 .data ${RELOCATING+BLOCK(__section_alignment__)} :
81 ${RELOCATING+__data_start__ = . ;}
85 ${RELOCATING+__data_end__ = . ;}
86 ${RELOCATING+*(.data_cygwin_nocopy)}
89 .bss ${RELOCATING+BLOCK(__section_alignment__)} :
91 ${RELOCATING+__bss_start__ = . ;}
94 ${RELOCATING+__bss_end__ = . ;}
97 .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
104 .edata ${RELOCATING+BLOCK(__section_alignment__)} :
117 .idata ${RELOCATING+BLOCK(__section_alignment__)} :
119 /* This cannot currently be handled with grouped sections.
120 See pe.em:sort_sections. */
123 .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
128 .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
130 /* end is deprecated, don't use it */
131 ${RELOCATING+ end = .;}
132 ${RELOCATING+ _end = .;}
133 ${RELOCATING+ __end__ = .;}
136 .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
141 .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
147 .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
152 .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :