]> oss.titaniummirror.com Git - msp430-libc.git/blobdiff - src/stdlib/__do_global_ctors.S
Imported msp430-libc-20100207
[msp430-libc.git] / src / stdlib / __do_global_ctors.S
diff --git a/src/stdlib/__do_global_ctors.S b/src/stdlib/__do_global_ctors.S
new file mode 100644 (file)
index 0000000..804cde6
--- /dev/null
@@ -0,0 +1,24 @@
+#include    "../core_common.inc"
+/*****************************************************************
+ * Call C++ global and static objects constructors
+ * can be overwriten by user function with the same name
+ *****************************************************************/
+        .section .init6, "ax", @progbits
+
+        .weak   __do_global_ctors
+        .func   __do_global_ctors
+
+
+__do_global_ctors:
+
+        XMOVA   #__ctors_start, r11
+        XMOVA   #__ctors_end,   r10
+.L__ctors_loop:
+        XCALL  @r11+   ; call constructor
+        XCMP    r10, r11
+        jne     .L__ctors_loop
+
+                                ; require linking of stack initialization
+        .global        __init_stack    ; stack has to be set before constructors calling
+
+        .endfunc