Skip to content

Commit d7b50b3

Browse files
authored
Merge pull request #883 from uyjulian/sysclib_after_boot
Do not attempt to register stdio stub in sysclib if not loaded in boot
2 parents b741e97 + befda98 commit d7b50b3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

iop/system/sysclib/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ balancing between size, speed, and features.
3030

3131
In order to use this module in your program, you must integrate the module into
3232
an IOPRP image, then load the image with `UDNL`.\
33-
Using `LoadModule` or `LoadModuleBuffer` directly will not work, because the
34-
module is already loaded at IOP boot.
33+
Using `LoadModule` or `LoadModuleBuffer` directly will work, but is not
34+
recommended because the old version of the module will remain in memory.

iop/system/sysclib/src/_start.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ extern struct irx_export_table _exp_sysclib;
1717
extern struct irx_export_table _exp_stdio;
1818

1919
int _start(int argc, char *argv[]) {
20-
(void)argc;
2120
(void)argv;
2221

2322
if (RegisterLibraryEntries(&_exp_sysclib) != 0)
2423
return MODULE_NO_RESIDENT_END;
25-
if (RegisterLibraryEntries(&_exp_stdio) != 0)
24+
// Unofficial: only attempt to register stdio stub if in boot stage
25+
if (!argc && RegisterLibraryEntries(&_exp_stdio) != 0)
2626
return MODULE_NO_RESIDENT_END;
2727

2828
return MODULE_RESIDENT_END;

0 commit comments

Comments
 (0)