diff --git a/libraries/wutcrt/crt0_rpl.s b/libraries/wutcrt/crt0_rpl.s index 1ed6d91..3512c14 100644 --- a/libraries/wutcrt/crt0_rpl.s +++ b/libraries/wutcrt/crt0_rpl.s @@ -28,7 +28,6 @@ unload: lwz 3, 0xC(1) lwz 4, 0x10(1) bl rpl_entry - bl __fini_wut addi 1, 1, 0x14 b exit diff --git a/libraries/wutcrt/crt0_rpx.s b/libraries/wutcrt/crt0_rpx.s index c80c669..4de8989 100644 --- a/libraries/wutcrt/crt0_rpx.s +++ b/libraries/wutcrt/crt0_rpx.s @@ -14,6 +14,5 @@ __rpx_start: lwz 3, 0xC(1) lwz 4, 0x10(1) bl main - bl __fini_wut addi 1, 1, 0x14 b exit diff --git a/libraries/wutnewlib/wut_newlib.c b/libraries/wutnewlib/wut_newlib.c index d4b61ac..c19362d 100644 --- a/libraries/wutnewlib/wut_newlib.c +++ b/libraries/wutnewlib/wut_newlib.c @@ -2,6 +2,7 @@ #include void(*__wut_exit)(int rc); +extern void __fini_wut(void); int __syscall_lock_init(int *lock, int recursive) { return __wut_lock_init(lock,recursive); @@ -19,7 +20,8 @@ int __syscall_lock_acquire(int *lock) { return __wut_lock_acquire(lock); } -void __syscall_exit(int rc) { +void __syscall_exit(int rc) { + __fini_wut(); __wut_exit(rc); }