[PATCH 13/42] moxie/moxiesim: Remove __main()

Joel Sherrill joel.sherrill at oarcorp.com
Fri Oct 17 15:23:29 UTC 2014


Moxie has .init section and that is what handles the constructors.
---
 c/src/lib/libbsp/moxie/moxiesim/Makefile.am      |  2 +-
 c/src/lib/libbsp/moxie/moxiesim/startup/__main.c | 21 ---------------------
 2 files changed, 1 insertion(+), 22 deletions(-)
 delete mode 100644 c/src/lib/libbsp/moxie/moxiesim/startup/__main.c

diff --git a/c/src/lib/libbsp/moxie/moxiesim/Makefile.am b/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
index b109664..2d04f11 100644
--- a/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
+++ b/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
@@ -34,7 +34,7 @@ libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bsplibc.c \
     ../../shared/bsppredriverhook.c ../../shared/bsppretaskinghook.c \
     ../../shared/bspgetworkarea.c ../../shared/bsppost.c \
     ../../shared/bspstart.c ../../shared/bootcard.c ../../shared/sbrk.c \
-    ../../shared/gnatinstallhandler.c startup/__main.c
+    ../../shared/gnatinstallhandler.c
 # clock
 libbsp_a_SOURCES += ../../shared/clock_driver_simidle.c
 # console
diff --git a/c/src/lib/libbsp/moxie/moxiesim/startup/__main.c b/c/src/lib/libbsp/moxie/moxiesim/startup/__main.c
deleted file mode 100644
index ffe8b55..0000000
--- a/c/src/lib/libbsp/moxie/moxiesim/startup/__main.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *  COPYRIGHT (c) 2011 Anthony Green <green at moxielogic.com>
- *
- */
-
-typedef void (*pfunc) (void);
-extern pfunc __ctors[];
-extern pfunc __ctors_end[];
-
-void __main (void)
-{
-  static int initialized;
-  pfunc *p;
-
-  if (initialized)
-    return;
-
-  initialized = 1;
-  for (p = __ctors_end; p > __ctors; )
-    (*--p) ();
-}
-- 
1.9.3



More information about the devel mailing list