modlib:#13819
Conversation
1. use '__attribute__((constructor))' mark initialize function
2. use '__attribute__((destructor))' mark uninitialize function
3. compile module with -fvisibility=hidden. use `__attribute__((visibility("default")))`
mark is need export symbol.so not need module_initialize to initialize export symbol.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
|
[Experimental Bot, please feedback here] The PR summary is insufficient and lacks detail. Here's a breakdown of what's missing and how to improve it: Summary Issues:
Impact Issues:
Testing Issues:
To make this PR meet NuttX requirements, you need to:
|
cederom
left a comment
There was a problem hiding this comment.
Thank you @anjiahao1 :-)
- Are there any possible compiler / linker compatibility issues?
- Do we need to update documentation as well?
The new approach uses the same mechanism of C++ constructor and destructor, so it's more general than before. Actually, so with the global c++ object work now with this change.
No documentation reference mod_initializer_t |
|
Hi @anjiahao1 , this PR also broke Any idea? |
Hi @anjiahao1 , were you able to verify anything further? |
Summary
The loading method of modlib has been optimized to allow dynamic modules to be loaded using attribute((destructor)), eliminating the need for module_initialize.
Impact
modlib
Testing
qemu with mps3 an547