This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, FT32] Place ctors/dtors in RAM


Please can someone review this patch, and if appropriate
commit it, as I do not have write access to the tree. Thanks.

2015-02-23  James Bowman  <james.bowman@ftdichip.com>

        * ld/scripttempl/ft32.sc: Place ctors/dtors in RAM.

---
 ld/scripttempl/ft32.sc |   50 +++++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 24 deletions(-)

diff --git a/ld/scripttempl/ft32.sc b/ld/scripttempl/ft32.sc
index 8ceee44..692a532 100644
--- a/ld/scripttempl/ft32.sc
+++ b/ld/scripttempl/ft32.sc
@@ -1,14 +1,3 @@
-TORS=".tors :
-  {
-    ___ctors = . ;
-    *(.ctors)
-    ___ctors_end = . ;
-    ___dtors = . ;
-    *(.dtors)
-    ___dtors_end = . ;
-    . = ALIGN(4);
-  } > ram"
-
 cat <<EOF
 OUTPUT_FORMAT("${OUTPUT_FORMAT}")
 OUTPUT_ARCH(${ARCH})
@@ -28,33 +17,46 @@ SECTIONS
     *(._pm*)
     *(.init)
     *(.fini)
-    ${RELOCATING+ _etext = . ; }
+     _etext = . ;
+
     . = ALIGN(4);
-  } ${RELOCATING+ > flash}
-  ${CONSTRUCTING+${TORS}}
-  .data          : AT (ADDR (.text) + SIZEOF (.text))
+  }  > flash
+
+  .data   : AT (ADDR (.text) + SIZEOF (.text))
   {
+    __data = .;
     *(.data)
     *(.rodata)
     *(.rodata*)
-    ${RELOCATING+ _edata = . ; }
-  } ${RELOCATING+ > ram}
+
+    ___ctors = . ;
+    *(.ctors)
+    ___ctors_end = . ;
+    
+    ___dtors = . ;
+    *(.dtors)
+    ___dtors_end = . ;
+
+    . = ALIGN(4);
+     _edata = . ;
+  }  > ram
+
   .bss  SIZEOF(.data) + ADDR(.data) :
   {
-    ${RELOCATING+ _bss_start = . ; }
+     _bss_start = . ;
     *(.bss)
     *(COMMON)
-    ${RELOCATING+ _end = . ;  }
-  } ${RELOCATING+ > ram}
+     _end = . ;
+  }  > ram
 
-  ${RELOCATING+ __data_load_start = LOADADDR(.data); }
-  ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
+   __data_load_start = LOADADDR(.data);
+   __data_load_end = __data_load_start + SIZEOF(.data);
 
-  .stab 0 ${RELOCATING+(NOLOAD)} :
+  .stab 0 (NOLOAD) :
   {
     *(.stab)
   }
-  .stabstr 0 ${RELOCATING+(NOLOAD)} :
+  .stabstr 0 (NOLOAD) :
   {
     *(.stabstr)
   }
-- 
1.7.9.5



--
James Bowman
FTDI Open Source Liaison


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]