Merge from gcc:
[deliverable/binutils-gdb.git] / ld / scripttempl / mmo.sc
index 643b349539e30346eef217ca26a97c0fb7094c15..33808846ac7e3de375c4d8b2f75d961976e0a64b 100644 (file)
@@ -1,7 +1,11 @@
+# MMO is not a relocateable format, and we don't want to require an
+# explicit (e.g.) "-m elf64mmix" when -r is used.
+test -z $RELOCATEABLE_OUTPUT_FORMAT && RELOCATEABLE_OUTPUT_FORMAT=$OUTPUT_FORMAT
+test -z ${RELOCATING+0} && OUTPUT_FORMAT=$RELOCATEABLE_OUTPUT_FORMAT
 cat <<EOF
-OUTPUT_FORMAT("mmo")
+OUTPUT_FORMAT("$OUTPUT_FORMAT")
 OUTPUT_ARCH(mmix)
-ENTRY(Main)
+${RELOCATING+ENTRY(Main)}
 SECTIONS
 {
   .text ${RELOCATING+ ${TEXT_START_ADDR}}:
@@ -29,8 +33,9 @@ SECTIONS
     ${RELOCATING+ PROVIDE (__ctors_start = .);}
     ${RELOCATING+ PROVIDE (_ctors = .);}
     ${RELOCATING+ PROVIDE (__ctors = .);}
-    ${RELOCATING+ KEEP (*crtbegin*.o(.ctors))}
-    ${RELOCATING+ KEEP (*(EXCLUDE_FILE (*crtend*.o) .ctors))}
+    ${RELOCATING+ KEEP (*crtbegin.o(.ctors))}
+    ${RELOCATING+ KEEP (*crtbegin?.o(.ctors))}
+    ${RELOCATING+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .ctors))}
     ${RELOCATING+ KEEP (*(SORT(.ctors.*)))}
     ${RELOCATING+ KEEP (*(.ctors))}
     ${RELOCATING+ PROVIDE (_ctors_end = .);}
@@ -40,8 +45,9 @@ SECTIONS
     ${RELOCATING+ PROVIDE (__dtors_start = .);}
     ${RELOCATING+ PROVIDE (_dtors = .);}
     ${RELOCATING+ PROVIDE (__dtors = .);}
-    ${RELOCATING+ KEEP (*crtbegin*.o(.dtors))}
-    ${RELOCATING+ KEEP (*(EXCLUDE_FILE (*crtend*.o) .dtors))}
+    ${RELOCATING+ KEEP (*crtbegin.o(.dtors))}
+    ${RELOCATING+ KEEP (*crtbegin?.o(.dtors))}
+    ${RELOCATING+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .dtors))}
     ${RELOCATING+ KEEP (*(SORT(.dtors.*)))}
     ${RELOCATING+ KEEP (*(.dtors))}
     ${RELOCATING+ PROVIDE (_dtors_end = .);}
@@ -126,6 +132,6 @@ SECTIONS
   /* Unfortunately, stabs are not mappable from ELF to MMO.
      It can probably be fixed with some amount of work.  */
   /DISCARD/ :
-  { *(.gnu.warning.*); }
+  { ${RELOCATING+ *(.gnu.warning.*);} }
 }
 EOF
This page took 0.02498 seconds and 4 git commands to generate.