Provide eabi C++ static constructor/destructor support.
authorMichael Meissner <gnu@the-meissners.org>
Thu, 16 Mar 1995 22:22:39 +0000 (22:22 +0000)
committerMichael Meissner <gnu@the-meissners.org>
Thu, 16 Mar 1995 22:22:39 +0000 (22:22 +0000)
ld/ChangeLog
ld/scripttempl/elfppc.sc

index b4ba5abc9a23513f2fd5cb4174840cf5d9bcd65d..ed55c612705ed7874be6e5ac96c707209e2ca544 100644 (file)
@@ -1,3 +1,10 @@
+Thu Mar 16 17:17:33 1995  Michael Meissner  <meissner@cygnus.com>
+
+       * scripttempl/elfppc.sc: Move _GOT2_END_ after the .ctors and
+       .dtors sections, so that these pointers get relocated also.
+       Define the symbols __{C,D}TOR_{LIST,END}__ to mark the beginning
+       and end of the constructors/destructors.
+
 Thu Mar 16 13:59:14 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
 
        * ldlang.c (load_symbols): If whole_archive is true and ENTRY
index 1f9537ac546e83b393c67d3f8dcac6a5ff2bb477..8a6b78dd763df78e969ab6e7e129bfcef9f51936 100644 (file)
@@ -99,15 +99,25 @@ SECTIONS
   }
   .data1 ${RELOCATING-0} : { *(.data1) }
   ${RELOCATING+${OTHER_READWRITE_SECTIONS}}
-  .ctors       ${RELOCATING-0} : { *(.ctors) }
-  .dtors       ${RELOCATING-0} : { *(.dtors) }
 
   ${RELOCATING+_GOT1_START_ = .;}
   .got1 ${RELOCATING-0} :  { *(.got1) }
   ${RELOCATING+_GOT1_END_ = .;}
 
+  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
+     get relocated with -mrelocatable. */
+
   ${RELOCATING+_GOT2_START_ = .;}
-  .got2 ${RELOCATING-0} :  { *(.got2) }
+  .got2  ${RELOCATING-0} :  { *(.got2) }
+
+  ${RELOCATING+__CTOR_LIST__ = .;}
+  .ctors ${RELOCATING-0} : { *(.ctors) }
+  ${RELOCATING+__CTOR_END__ = .;}
+
+  ${RELOCATING+__DTOR_LIST__ = .;}
+  .dtors ${RELOCATING-0} : { *(.dtors) }
+  ${RELOCATING+__DTOR_END__ = .;}
+
   ${RELOCATING+_GOT2_END_ = .;}
 
   ${RELOCATING+_GOT_START_ = .;}