summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-10-28 11:51:27 -0400
committermidipix <writeonce@midipix.org>2017-10-28 12:45:07 -0400
commit03bf9aba6d06016ee4c01ba10ad19f6029c4056d (patch)
tree5a42b4cd28783d4a8f4ae777807a121ba1fe4074
parentffa3293e29b6efc2e6d952adea984e8b81b8918c (diff)
downloadmmglue-03bf9aba6d06016ee4c01ba10ad19f6029c4056d.tar.bz2
mmglue-03bf9aba6d06016ee4c01ba10ad19f6029c4056d.tar.xz
psxglue.h: pointers to ctors_fn & dtors_fn are now in struct __psx_vtbl.
-rw-r--r--arch/nt32/psxglue.h4
-rw-r--r--arch/nt32/src/crt_glue.c4
-rw-r--r--arch/nt64/psxglue.h4
-rw-r--r--arch/nt64/src/crt_glue.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/arch/nt32/psxglue.h b/arch/nt32/psxglue.h
index 2bcf329..0e4a440 100644
--- a/arch/nt32/psxglue.h
+++ b/arch/nt32/psxglue.h
@@ -31,6 +31,8 @@ struct __ldso_vtbl {
};
struct __psx_vtbl {
+ void (*do_global_ctors_fn)();
+ void (*do_global_dtors_fn)();
__psx_start_main * start_main;
__psx_convert_thread * convert_thread;
__psx_unmapself * unmapself;
@@ -47,8 +49,6 @@ struct __psx_context {
unsigned int teb_libc_idx;
void * pthread_surrogate_fn;
void * pthread_create_fn;
- void * do_global_ctors_fn;
- void * do_global_dtors_fn;
};
struct __tlca_abi {
diff --git a/arch/nt32/src/crt_glue.c b/arch/nt32/src/crt_glue.c
index 08928c1..2967ad6 100644
--- a/arch/nt32/src/crt_glue.c
+++ b/arch/nt32/src/crt_glue.c
@@ -82,8 +82,8 @@ void __libc_entry_routine(
__teb_libc_idx = ctx.teb_libc_idx;
/* surrogate init/fini arrays */
- __global_ctors_fn = ctx.do_global_ctors_fn;
- __global_dtors_fn = ctx.do_global_dtors_fn;
+ __global_ctors_fn = __psx_vtbl->do_global_ctors_fn;
+ __global_dtors_fn = __psx_vtbl->do_global_dtors_fn;
/* enter libc */
__psx_vtbl->start_main(__main,argc,argv,__libc_start_main);
diff --git a/arch/nt64/psxglue.h b/arch/nt64/psxglue.h
index 2bcf329..0e4a440 100644
--- a/arch/nt64/psxglue.h
+++ b/arch/nt64/psxglue.h
@@ -31,6 +31,8 @@ struct __ldso_vtbl {
};
struct __psx_vtbl {
+ void (*do_global_ctors_fn)();
+ void (*do_global_dtors_fn)();
__psx_start_main * start_main;
__psx_convert_thread * convert_thread;
__psx_unmapself * unmapself;
@@ -47,8 +49,6 @@ struct __psx_context {
unsigned int teb_libc_idx;
void * pthread_surrogate_fn;
void * pthread_create_fn;
- void * do_global_ctors_fn;
- void * do_global_dtors_fn;
};
struct __tlca_abi {
diff --git a/arch/nt64/src/crt_glue.c b/arch/nt64/src/crt_glue.c
index 08928c1..2967ad6 100644
--- a/arch/nt64/src/crt_glue.c
+++ b/arch/nt64/src/crt_glue.c
@@ -82,8 +82,8 @@ void __libc_entry_routine(
__teb_libc_idx = ctx.teb_libc_idx;
/* surrogate init/fini arrays */
- __global_ctors_fn = ctx.do_global_ctors_fn;
- __global_dtors_fn = ctx.do_global_dtors_fn;
+ __global_ctors_fn = __psx_vtbl->do_global_ctors_fn;
+ __global_dtors_fn = __psx_vtbl->do_global_dtors_fn;
/* enter libc */
__psx_vtbl->start_main(__main,argc,argv,__libc_start_main);