From befda9884b731205be67de7327f234b48f340164 Mon Sep 17 00:00:00 2001 From: Julian Uy Date: Wed, 1 Jul 2026 23:34:17 -0500 Subject: [PATCH] feat: [sysclib] do not attempt to register stdio stub if not loaded in boot Allows using sysclib as upgrade to 1.3.4 modules after boot --- iop/system/sysclib/README.md | 4 ++-- iop/system/sysclib/src/_start.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iop/system/sysclib/README.md b/iop/system/sysclib/README.md index 4a6e6248730e..94cacc04b0bf 100644 --- a/iop/system/sysclib/README.md +++ b/iop/system/sysclib/README.md @@ -30,5 +30,5 @@ balancing between size, speed, and features. In order to use this module in your program, you must integrate the module into an IOPRP image, then load the image with `UDNL`.\ -Using `LoadModule` or `LoadModuleBuffer` directly will not work, because the -module is already loaded at IOP boot. +Using `LoadModule` or `LoadModuleBuffer` directly will work, but is not +recommended because the old version of the module will remain in memory. diff --git a/iop/system/sysclib/src/_start.c b/iop/system/sysclib/src/_start.c index d0bc35ae8138..e40a7efa5ec4 100644 --- a/iop/system/sysclib/src/_start.c +++ b/iop/system/sysclib/src/_start.c @@ -17,12 +17,12 @@ extern struct irx_export_table _exp_sysclib; extern struct irx_export_table _exp_stdio; int _start(int argc, char *argv[]) { - (void)argc; (void)argv; if (RegisterLibraryEntries(&_exp_sysclib) != 0) return MODULE_NO_RESIDENT_END; - if (RegisterLibraryEntries(&_exp_stdio) != 0) + // Unofficial: only attempt to register stdio stub if in boot stage + if (!argc && RegisterLibraryEntries(&_exp_stdio) != 0) return MODULE_NO_RESIDENT_END; return MODULE_RESIDENT_END;