OSDN Git Service

2000-12-28 Jeffrey Oldham <oldham@codesourcery.com>
[pf3gnuchains/gcc-fork.git] / gcc / crtstuff.c
index 8603547..2a5864d 100644 (file)
@@ -62,6 +62,10 @@ Boston, MA 02111-1307, USA.  */
 #include "defaults.h"
 #include "frame.h"
 
+#ifndef CRT_CALL_STATIC_FUNCTION
+# define CRT_CALL_STATIC_FUNCTION(func) func ()
+#endif
+
 /* We do not want to add the weak attribute to the declarations of these
    routines in frame.h because that will cause the definition of these
    symbols to be weak as well.
@@ -106,7 +110,10 @@ extern void *__deregister_frame_info (void *)
    an additional check that you are doing everything right.  But if you do
    use the `-z text' option when building a shared library, you will get
    errors unless the .ctors and .dtors sections are marked as writable
-   via the SHF_WRITE attribute.)  */
+   via the SHF_WRITE attribute.)
+
+   These defaults do not include leading spacing, as they will only be
+   used in asm:s here.  */
 
 #ifndef CTORS_SECTION_ASM_OP
 #define CTORS_SECTION_ASM_OP   ".section\t.ctors,\"aw\""
@@ -213,7 +220,7 @@ static void __attribute__ ((__unused__))
 fini_dummy (void)
 {
   asm (FINI_SECTION_ASM_OP);
-  __do_global_dtors_aux ();
+  CRT_CALL_STATIC_FUNCTION (__do_global_dtors_aux);
 #ifdef FORCE_FINI_SECTION_ALIGN
   FORCE_FINI_SECTION_ALIGN;
 #endif
@@ -237,7 +244,7 @@ static void __attribute__ ((__unused__))
 init_dummy (void)
 {
   asm (INIT_SECTION_ASM_OP);
-  frame_dummy ();
+  CRT_CALL_STATIC_FUNCTION (frame_dummy);
 #ifdef FORCE_INIT_SECTION_ALIGN
   FORCE_INIT_SECTION_ALIGN;
 #endif
@@ -337,7 +344,7 @@ __frame_dummy (void)
 #endif /* defined(INIT_SECTION_ASM_OP) */
 
 /* Force cc1 to switch to .data section.  */
-static func_ptr force_to_data[0] __attribute__ ((__unused__)) = { };
+static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { };
 
 /* NOTE:  In order to be able to support SVR4 shared libraries, we arrange
    to have one set of symbols { __CTOR_LIST__, __DTOR_LIST__, __CTOR_END__,
@@ -402,7 +409,7 @@ static void __attribute__ ((__unused__))
 init_dummy (void)
 {
   asm (INIT_SECTION_ASM_OP);
-  __do_global_ctors_aux ();
+  CRT_CALL_STATIC_FUNCTION (__do_global_ctors_aux);
 #ifdef FORCE_INIT_SECTION_ALIGN
   FORCE_INIT_SECTION_ALIGN;
 #endif
@@ -488,7 +495,7 @@ __do_global_ctors (void)
 #endif /* defined(INIT_SECTION_ASM_OP) */
 
 /* Force cc1 to switch to .data section.  */
-static func_ptr force_to_data[0] __attribute__ ((__unused__)) = { };
+static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { };
 
 /* Put a word containing zero at the end of each of our two lists of function
    addresses.  Note that the words defined here go into the .ctors and .dtors
@@ -579,7 +586,7 @@ __dereg_frame_dtor (void)
 /* Terminate the frame section with a final zero. */
 
 /* Force cc1 to switch to .data section.  */
-static void * force_to_data[0] __attribute__ ((__unused__)) = { };
+static void * force_to_data[1] __attribute__ ((__unused__)) = { };
 
 typedef unsigned int ui32 __attribute__ ((mode (SI)));
 asm (EH_FRAME_SECTION_ASM_OP);