Allow the flash and ram memory region sizes to be specified in the default FT32 linke...
[binutils-gdb.git] / ld / scripttempl / tic80coff.sc
index 0d52aaa7487cd287da179bbb5453e34f8b1c9b8a..1af69406cb420706de8d1d954551c4856a03f9ef 100644 (file)
@@ -1,5 +1,11 @@
 # Linker script for TI TMS320C80 (tic80) COFF.
 #
+# Copyright (C) 2014-2016 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.
+#
 # Besides the shell variables set by the emulparams script, and the LD_FLAG
 # variable, the genscripts.sh script will set the following variables for each
 # time this script is run to generate one of the linker scripts for ldscripts:
@@ -20,10 +26,16 @@ test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x80000 + SIZEOF_HEADERS"
 test -z "$ENTRY" && ENTRY=__start
 
 cat <<EOF
+/* Copyright (C) 2014-2016 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}
 
-ENTRY(${ENTRY})
+${RELOCATING+ENTRY (${ENTRY})}
 
 SECTIONS
 {
@@ -31,19 +43,26 @@ SECTIONS
     *(.init)
     *(.fini)
     *(.text)
+  }
+  .const ALIGN(4) : {
+    *(.const)
+  }
+  .ctors ALIGN(4) : {
     ${CONSTRUCTING+ . = ALIGN(4);}
     ${CONSTRUCTING+ ___CTOR_LIST__ = .;}
-    ${CONSTRUCTING+ LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)}
-    ${CONSTRUCTING+ *(.ctors)}
-    ${CONSTRUCTING+ LONG(0)}
+    ${CONSTRUCTING+ LONG(-1)}
+    *(.ctors)
     ${CONSTRUCTING+ ___CTOR_END__ = .;}
+    ${CONSTRUCTING+ LONG(0)}
+  }
+  .dtors ALIGN(4) : {
     ${CONSTRUCTING+ ___DTOR_LIST__ = .;}
-    ${CONSTRUCTING+ LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2)}
+    ${CONSTRUCTING+ LONG(-1)}
     ${CONSTRUCTING+ *(.dtors)}
-    ${CONSTRUCTING+ LONG(0)}
     ${CONSTRUCTING+ ___DTOR_END__ = .;}
-    ${RELOCATING+ etext  =  .;}
+    ${CONSTRUCTING+ LONG(0)}
   }
+  ${RELOCATING+ etext  =  .;}
   .data : {
     *(.data)
     ${RELOCATING+ __edata  =  .};