X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=src%2Fstdlib%2F__do_global_ctors.S;fp=src%2Fstdlib%2F__do_global_ctors.S;h=804cde6b2a7487c14ea1ed7cde2c4ce25089f919;hb=6f720ff00773571c2fa2d35e67bff68547617639;hp=0000000000000000000000000000000000000000;hpb=807b2dd5b7365eb87b482197af3b4a3f520c14f7;p=msp430-libc.git diff --git a/src/stdlib/__do_global_ctors.S b/src/stdlib/__do_global_ctors.S new file mode 100644 index 0000000..804cde6 --- /dev/null +++ b/src/stdlib/__do_global_ctors.S @@ -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