Ravenscar port for RISC-V
[deliverable/binutils-gdb.git] / ld / scripttempl / xstormy16.sc
index 3f73598fe4263bd821606f9048245fe12742b122..13a9b44979fa59a61a447e543469815ee980eb66 100644 (file)
@@ -1,5 +1,5 @@
-# Copyright (C) 2014 Free Software Foundation, Inc.
-# 
+# Copyright (C) 2014-2019 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.
@@ -25,9 +25,9 @@
 #              .bss section besides __bss_start.
 #      INPUT_FILES - INPUT command of files to always include
 #      INIT_START, INIT_END -  statements just before and just after
-#      combination of .init sections.
+#      combination of .init sections.
 #      FINI_START, FINI_END - statements just before and just after
-#      combination of .fini sections.
+#      combination of .fini sections.
 #
 # When adding sections, do note that the names of some sections are used
 # when specifying the start address of the next.
@@ -59,7 +59,7 @@ test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
 if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
 test -z "${ELFSIZE}" && ELFSIZE=32
 test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
-CTOR=".ctors ${CONSTRUCTING-0} : 
+CTOR=".ctors ${CONSTRUCTING-0} :
   {
     ${CONSTRUCTING+${CTOR_START}}
     /* gcc uses crtbegin.o to find the start of
@@ -98,7 +98,7 @@ DTOR=" .dtors       ${CONSTRUCTING-0} :
   } > ROM"
 
 cat <<EOF
-/* Copyright (C) 2014 Free Software Foundation, Inc.
+/* Copyright (C) 2014-2019 Free Software Foundation, Inc.
 
    Copying and distribution of this script, with or without modification,
    are permitted in any medium without royalty provided the copyright
@@ -107,24 +107,25 @@ cat <<EOF
 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
              "${LITTLE_OUTPUT_FORMAT}")
 OUTPUT_ARCH(${OUTPUT_ARCH})
-${RELOCATING+ENTRY(${ENTRY})}
+EOF
+
+test -n "${RELOCATING}" && cat <<EOF
+ENTRY(${ENTRY})
 
-${RELOCATING+${LIB_SEARCH_DIRS}}
-${RELOCATING+${EXECUTABLE_SYMBOLS}}
-${RELOCATING+${INPUT_FILES}}
-${RELOCATING- /* For some reason, the Solaris linker makes bad executables
-  if gld -r is used and the intermediate file has sections starting
-  at non-zero addresses.  Could be a Solaris ld bug, could be a GNU ld
-  bug.  But for now assigning the zero vmas works.  */}
+${LIB_SEARCH_DIRS}
+${EXECUTABLE_SYMBOLS}
+${INPUT_FILES}
 
 /* There are two memory regions we care about, one from 0 through 0x7F00
    that is RAM and one from 0x8000 up which is ROM.  */
-MEMORY 
+MEMORY
 {
   RAM (w) : ORIGIN = 0, LENGTH = 0x7F00
   ROM (!w) : ORIGIN = 0x8000, LENGTH = 0xFF8000
 }
+EOF
 
+cat <<EOF
 SECTIONS
 {
   .data  ${RELOCATING-0} :
@@ -136,7 +137,7 @@ SECTIONS
     ${RELOCATING+*(.data.*)}
     ${RELOCATING+*(.gnu.linkonce.d.*)}
     ${CONSTRUCTING+SORT(CONSTRUCTORS)}
-  } > RAM
+  }${RELOCATING+ > RAM}
   ${RELOCATING+${OTHER_READWRITE_SECTIONS}}
   ${RELOCATING+${OTHER_GOT_SYMBOLS}}
   ${RELOCATING+${OTHER_GOT_SECTIONS}}
@@ -146,16 +147,16 @@ SECTIONS
   ${RELOCATING+${OTHER_BSS_SYMBOLS}}
   .bss     ${RELOCATING-0} :
   {
-   *(.dynbss)
+   ${RELOCATING+*(.dynbss)}
    *(.bss)
    ${RELOCATING+*(.bss.*)}
    ${RELOCATING+*(.gnu.linkonce.b.*)}
-   *(COMMON)
+   ${RELOCATING+*(COMMON)
    /* Align here to ensure that the .bss section occupies space up to
       _end.  Align after .bss to ensure correct alignment even if the
       .bss section disappears because there are no input sections.  */
-   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
-  } > RAM
+   . = ALIGN(${ALIGNMENT});}
+  }${RELOCATING+ > RAM}
   ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
   ${RELOCATING+${OTHER_END_SYMBOLS}}
@@ -164,15 +165,15 @@ SECTIONS
   ${RELOCATING+PROVIDE (end = .);}
 
   /* Read-only sections in ROM.  */
-  .int_vec     ${RELOCATING-0} : { *(.int_vec) } ${RELOCATING+> ROM}
+  .int_vec     ${RELOCATING-0} : { *(.int_vec) }${RELOCATING+ > ROM}
 
-  .rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} } ${RELOCATING+> ROM}
+  .rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} }${RELOCATING+ > ROM}
   ${RELOCATING+${CTOR}}
   ${RELOCATING+${DTOR}}
-  .jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ROM}
-  .eh_frame : { KEEP (*(.eh_frame)) } ${RELOCATING+> ROM}
-  .gcc_except_table : { *(.gcc_except_table) *(.gcc_except_table.*) } ${RELOCATING+> ROM}
-  .plt : { *(.plt) } ${RELOCATING+> ROM}
+  .jcr : { KEEP (*(.jcr)) }${RELOCATING+ > ROM}
+  .eh_frame : { KEEP (*(.eh_frame)) }${RELOCATING+ > ROM}
+  .gcc_except_table : { *(.gcc_except_table)${RELOCATING+ *(.gcc_except_table.*)} }${RELOCATING+ > ROM}
+  .plt : { *(.plt) }${RELOCATING+ > ROM}
 
   .text    ${RELOCATING-0} :
   {
@@ -180,23 +181,23 @@ SECTIONS
     *(.text)
     ${RELOCATING+*(.text.*)}
     *(.stub)
-    /* .gnu.warning sections are handled specially by elf32.em.  */
+    /* .gnu.warning sections are handled specially by elf.em.  */
     *(.gnu.warning)
     ${RELOCATING+*(.gnu.linkonce.t.*)}
     ${RELOCATING+${OTHER_TEXT_SECTIONS}}
-  } ${RELOCATING+> ROM =${NOP-0}}
-  .init        ${RELOCATING-0} : 
-  { 
+  }${RELOCATING+ > ROM =${NOP-0}}
+  .init        ${RELOCATING-0} :
+  {
     ${RELOCATING+${INIT_START}}
-    KEEP (*(.init))
+    KEEP (*(SORT_NONE(.init)))
     ${RELOCATING+${INIT_END}}
-  } ${RELOCATING+> ROM =${NOP-0}}
+  }${RELOCATING+ > ROM =${NOP-0}}
   .fini    ${RELOCATING-0} :
   {
     ${RELOCATING+${FINI_START}}
-    KEEP (*(.fini))
+    KEEP (*(SORT_NONE(.fini)))
     ${RELOCATING+${FINI_END}}
-  } ${RELOCATING+> ROM =${NOP-0}}
+  }${RELOCATING+ > ROM =${NOP-0}}
   ${RELOCATING+PROVIDE (__etext = .);}
   ${RELOCATING+PROVIDE (_etext = .);}
   ${RELOCATING+PROVIDE (etext = .);}
This page took 0.02627 seconds and 4 git commands to generate.