aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/module/elf_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/sys/module/elf_module.c')
-rw-r--r--com32/lib/sys/module/elf_module.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/com32/lib/sys/module/elf_module.c b/com32/lib/sys/module/elf_module.c
index 2952e617..ba535f45 100644
--- a/com32/lib/sys/module/elf_module.c
+++ b/com32/lib/sys/module/elf_module.c
@@ -401,12 +401,21 @@ static int extract_operations(struct elf_module *module) {
module->init_func = (module_init_t*)module_get_absolute(
init_sym->st_value, module);
+ if (*(module->init_func) == NULL) {
+ module->init_func = NULL;
+ }
module->exit_func = (module_exit_t*)module_get_absolute(
exit_sym->st_value, module);
+ if (*(module->exit_func) == NULL) {
+ module->exit_func = NULL;
+ }
module->main_func = (module_main_t*)module_get_absolute(
main_sym->st_value, module);
+ if (*(module->main_func) == NULL) {
+ module->main_func = NULL;
+ }
return 0;
}