gdb/
[binutils-gdb.git] / ld / scripttempl / mcorepe.sc
index 8111bf211ee971074a9e79165f2c505ad99022f1..511fdb1f898ecd0485fde5f7753ad5d8471fa6a7 100644 (file)
@@ -1,4 +1,4 @@
-# Linker script for PE.
+# Linker script for MCore PE.
 
 if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
   RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
@@ -35,13 +35,19 @@ else
   R_RSRC=
 fi
 
-cat <<EOF
-${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
-${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
+if test "$RELOCATING"; then
+  # Can't use ${RELOCATING+blah "blah" blah} for this,
+  # because bash 2.x will lose the doublequotes.
+  cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
+                          "${LITTLE_OUTPUT_FORMAT}")
+EOF
+fi
 
+cat <<EOF
 ${LIB_SEARCH_DIRS}
 
-ENTRY(_mainCRTStartup)
+${RELOCATING+ENTRY (_mainCRTStartup)}
 
 SECTIONS
 {
@@ -50,6 +56,7 @@ SECTIONS
     ${RELOCATING+ *(.init)}
     *(.text)
     ${R_TEXT}
+    ${RELOCATING+ *(.text.*)}
     *(.glue_7t)
     *(.glue_7)
     ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;