diff --git a/src/lib/ubix/static.c b/src/lib/ubix/static.c new file mode 100644 index 0000000..c9f360a --- /dev/null +++ b/src/lib/ubix/static.c @@ -0,0 +1,15 @@ +int static_constructors(void) { + extern void (* __ctor_list)(); + void (** l_ctor)() = &__ctor_list; + int l_ctorCount = *(int *)l_ctor; + + l_ctor++; + while(l_ctorCount) + { + (*l_ctor)(); + l_ctorCount--; + l_ctor++; + } + + return 0; + }