# Loosely based on Steve Chamberlain's pe.sc.
# All new mistakes should be credited to Kim Knuttila (krk@cygnus.com)
#
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+#
# These are substituted in as variables in order to get '}' in a shell
# conditional expansion.
+
INIT='.init : { *(.init) }'
FINI='.fini : { *(.fini) }'
+
cat <<EOF
+/* Copyright (C) 2014 Free Software Foundation, Inc.
+
+ Copying and distribution of this script, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. */
+
OUTPUT_FORMAT(${OUTPUT_FORMAT})
${LIB_SEARCH_DIRS}
"-u mainCRTStartup" to make sure it gets included in the link.
*/
-ENTRY(mainCRTStartup)
+${RELOCATING+ENTRY (mainCRTStartup)}
SECTIONS
{
{
${RELOCATING+ *(.init);}
*(.text)
+ ${RELOCATING+ *(.text.*)}
+ *(.gcc_except_table)
${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
LONG (-1); *(.ctors); *(.ctor); LONG (0); }
${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
*(.idata\$3);
__idata4_magic__ = .;
*(.idata\$4);
+ . = ALIGN(4);
.toc = . + 32768;
*(.private.toc);
__idata5_magic__ = .;
;
}
- /* We don't do anything useful with codeview debugger support or the
- directive section (yet). Hopefully, we junk them correctly.
- */
- .junk BLOCK(__section_alignment__) :
- {
- *(.debug\$S)
- *(.debug\$T)
- *(.debug\$F)
- *(.drectve)
- ;
- }
/* Resources */
.rsrc BLOCK(__section_alignment__) :
;
}
+ .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+
+ .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
+
/* The .reloc section is currently generated by the dlltool from Steve
Chamberlain in a second pass of linking. Section address and extent
are placed in the DataDirectory.
;
}
- .stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
+ /* We don't do anything useful with codeview debugger support or the
+ directive section (yet). Hopefully, we junk them correctly.
+ */
+ /DISCARD/ BLOCK(__section_alignment__) :
{
- [ .stab ]
- }
-
- .stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
- {
- [ .stabstr ]
- }
+ *(.debug\$S)
+ *(.debug\$T)
+ *(.debug\$F)
+ *(.drectve)
+ ;
+ }
}
EOF