summaryrefslogtreecommitdiffstats
path: root/bsps/v850
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/v850')
-rw-r--r--bsps/v850/shared/start/crt1.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/bsps/v850/shared/start/crt1.c b/bsps/v850/shared/start/crt1.c
new file mode 100644
index 0000000000..02a8a7f8cf
--- /dev/null
+++ b/bsps/v850/shared/start/crt1.c
@@ -0,0 +1,25 @@
+/*
+ * From newlib ==> libc/sys/sysnecv850/crt1.c
+ *
+ * Obtained from newlib: 29 May 2012
+ * Warnings fixed: 7 October 2014
+ */
+
+void __main(void);
+typedef void (*pfunc) (void);
+extern pfunc __ctors[];
+extern pfunc __ctors_end[];
+
+void __main(void)
+{
+ static int initialized;
+ if (! initialized)
+ {
+ pfunc *p;
+
+ initialized = 1;
+ for (p = __ctors_end; p > __ctors; )
+ (*--p) ();
+
+ }
+}