modilib:add new args to modp record init arry

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2024-07-10 22:49:47 +08:00 committed by Xiang Xiao
parent e9550783d3
commit 9c191e93b7
2 changed files with 4 additions and 0 deletions

View File

@ -179,6 +179,8 @@ struct module_s
FAR struct module_s *dependencies[CONFIG_MODLIB_MAXDEPEND];
#endif
uintptr_t initarr; /* .init_array */
uint16_t ninit; /* Number of entries in .init_array */
uintptr_t finiarr; /* .fini_array */
uint16_t nfini; /* Number of entries in .fini_array */
};

View File

@ -332,6 +332,8 @@ FAR void *modlib_insert(FAR const char *filename, FAR const char *modname)
array[i]();
}
modp->initarr = loadinfo.initarr;
modp->ninit = loadinfo.ninit;
modp->finiarr = loadinfo.finiarr;
modp->nfini = loadinfo.nfini;
break;