Add initX, finiX, ctors, dtors sections to respect C++ constructor/destructor.
authorNick Clifton <nickc@redhat.com>
Wed, 9 Apr 2003 11:07:51 +0000 (11:07 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 9 Apr 2003 11:07:51 +0000 (11:07 +0000)
Add ctors/dtors start/stop definitions.

ld/ChangeLog
ld/scripttempl/elf32msp430.sc
ld/scripttempl/elf32msp430_3.sc

index 642f41af0e672676e48023e696b5727b55550bb4..848853fb22395269ba3cdc2cfbf27f9b1281be96 100644 (file)
@@ -1,3 +1,10 @@
+2003-04-09   Dmitry Diky  <diwil@mail.ru>
+
+       * scripttempl/elf32msp430.sc: Add initX, finiX, ctors, dtors
+       sections to respect C++  constructor/destructor. Add ctors/dtors
+       start/stop definitions.
+       * scripttempl/elf32msp430_3.sc: Likewise.
+
 2003-04-06  Nick Clifton  <nickc@redhat.com>
 
        * ld.texinfo (Options): Add a reminder of the target specific
index ba6e03f77e9af8c3385cab0d872946d5262d1107..c3e78d32e6a24fa6d3fc209b0b307a0c00779713 100644 (file)
@@ -77,13 +77,44 @@ SECTIONS
   /* Internal text space.  */
   .text :
   {
+    ${RELOCATING+. = ALIGN(2);}
     *(.init)
+    *(.init0)  /* Start here after reset.  */
+    *(.init1)
+    *(.init2)  /* Copy data loop  */
+    *(.init3)
+    *(.init4)  /* Clear bss  */
+    *(.init5)
+    *(.init6)  /* C++ constructors.  */
+    *(.init7)
+    *(.init8)
+    *(.init9)  /* Call main().  */
+
+    ${CONSTRUCTING+ __ctors_start = . ; }
+    ${CONSTRUCTING+ *(.ctors) }
+    ${CONSTRUCTING+ __ctors_end = . ; }
+    ${CONSTRUCTING+ __dtors_start = . ; }
+    ${CONSTRUCTING+ *(.dtors) }
+    ${CONSTRUCTING+ __dtors_end = . ; }
+
     ${RELOCATING+. = ALIGN(2);}
     *(.text)
     ${RELOCATING+. = ALIGN(2);}
     *(.text.*)
+
     ${RELOCATING+. = ALIGN(2);}
+    *(.fini9)  /*   */
+    *(.fini8)
+    *(.fini7)
+    *(.fini6)  /* C++ destructors.  */
+    *(.fini5)
+    *(.fini4)
+    *(.fini3)
+    *(.fini2)
+    *(.fini1)
+    *(.fini0)  /* Infinite loop after program termination.  */
     *(.fini)
+
     ${RELOCATING+ _etext = . ; }
   } ${RELOCATING+ > text}
 
index 40259bfa1fbca8cee84a9509399c772159ed7126..15eb51723068c1be7b8273feaa8696e9b88070ad 100644 (file)
@@ -74,13 +74,44 @@ SECTIONS
   /* Internal text space.  */
   .text :
   {
+    ${RELOCATING+. = ALIGN(2);}
     *(.init)
+    *(.init0)  /* Start here after reset.  */
+    *(.init1)
+    *(.init2)
+    *(.init3)
+    *(.init4)
+    *(.init5)
+    *(.init6)  /* C++ constructors.  */
+    *(.init7)
+    *(.init8)
+    *(.init9)  /* Call main().  */
+
+    ${CONSTRUCTING+ __ctors_start = . ; }
+    ${CONSTRUCTING+ *(.ctors) }
+    ${CONSTRUCTING+ __ctors_end = . ; }
+    ${CONSTRUCTING+ __dtors_start = . ; }
+    ${CONSTRUCTING+ *(.dtors) }
+    ${CONSTRUCTING+ __dtors_end = . ; }
+
     ${RELOCATING+. = ALIGN(2);}
     *(.text)
     ${RELOCATING+. = ALIGN(2);}
     *(.text.*)
+
     ${RELOCATING+. = ALIGN(2);}
+    *(.fini9)
+    *(.fini8)
+    *(.fini7)
+    *(.fini6)  /* C++ destructors.  */
+    *(.fini5)
+    *(.fini4)
+    *(.fini3)
+    *(.fini2)
+    *(.fini1)
+    *(.fini0)  /* Infinite loop after program termination.  */
     *(.fini)
+
     ${RELOCATING+ _etext = . ; }
   } ${RELOCATING+ > text}
 
This page took 0.028803 seconds and 4 git commands to generate.