-
Notifications
You must be signed in to change notification settings - Fork 1.5k
modlib: #13819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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