summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--crt/crtidata.c0
-rw-r--r--crt/nt32/Scrt1.c9
-rw-r--r--crt/nt32/crtidata.c16
-rw-r--r--crt/nt64/Scrt1.c9
-rw-r--r--crt/nt64/crt1.c6
-rw-r--r--crt/nt64/crtidata.c16
6 files changed, 52 insertions, 4 deletions
diff --git a/crt/crtidata.c b/crt/crtidata.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/crt/crtidata.c
diff --git a/crt/nt32/Scrt1.c b/crt/nt32/Scrt1.c
index ff5789f..c635211 100644
--- a/crt/nt32/Scrt1.c
+++ b/crt/nt32/Scrt1.c
@@ -1,2 +1,11 @@
+#include "psxglue.h"
+
+__psx_init_routine __psx_init;
+
+__psx_init_routine * __psx_init_fn(void)
+{
+ return __psx_init;
+}
+
#define LIBC_STATIC
#include "crt1.c"
diff --git a/crt/nt32/crtidata.c b/crt/nt32/crtidata.c
new file mode 100644
index 0000000..6037c25
--- /dev/null
+++ b/crt/nt32/crtidata.c
@@ -0,0 +1,16 @@
+/****************************************/
+/* dynamically linked applications only */
+/* see also: Scrt1.c */
+/****************************************/
+
+#include "psxglue.h"
+
+#define __external_routine __attribute__((dllimport))
+
+__external_routine
+__psx_init_routine __psx_init;
+
+__psx_init_routine * __psx_init_fn(void)
+{
+ return __psx_init;
+}
diff --git a/crt/nt64/Scrt1.c b/crt/nt64/Scrt1.c
index ff5789f..c635211 100644
--- a/crt/nt64/Scrt1.c
+++ b/crt/nt64/Scrt1.c
@@ -1,2 +1,11 @@
+#include "psxglue.h"
+
+__psx_init_routine __psx_init;
+
+__psx_init_routine * __psx_init_fn(void)
+{
+ return __psx_init;
+}
+
#define LIBC_STATIC
#include "crt1.c"
diff --git a/crt/nt64/crt1.c b/crt/nt64/crt1.c
index 6f08278..0d319a1 100644
--- a/crt/nt64/crt1.c
+++ b/crt/nt64/crt1.c
@@ -19,8 +19,7 @@ extern const int __crtopt_vrfs __attribute((weak,alias("__disabled")));
int main();
-__external_routine
-__psx_init_routine __psx_init;
+__psx_init_routine * __psx_init_fn(void);
__external_routine
void __libc_entry_routine(void *,void *,int);
@@ -29,7 +28,6 @@ void _start(void)
{
__libc_entry_routine(
main,
- __psx_init,
+ __psx_init_fn(),
__crtopt_posix | __crtopt_dinga);
}
-
diff --git a/crt/nt64/crtidata.c b/crt/nt64/crtidata.c
new file mode 100644
index 0000000..6037c25
--- /dev/null
+++ b/crt/nt64/crtidata.c
@@ -0,0 +1,16 @@
+/****************************************/
+/* dynamically linked applications only */
+/* see also: Scrt1.c */
+/****************************************/
+
+#include "psxglue.h"
+
+#define __external_routine __attribute__((dllimport))
+
+__external_routine
+__psx_init_routine __psx_init;
+
+__psx_init_routine * __psx_init_fn(void)
+{
+ return __psx_init;
+}