#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.
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\""
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
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
#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__,
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
#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
/* 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);