Skip to content
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

Load plugin library symbols first #1664

Closed
wants to merge 1 commit into from

Conversation

benierc
Copy link

@benierc benierc commented Apr 28, 2021

dlopen load plugins LIBRARY with RTLD_LAZY flag
it means the symbols are loaded when references are executed
so it causes issue when some references are the same than in system

append RTLD_BINDDEEP allows to first load symbols from the plugin library

Fixes: #1663

@ffesti
Copy link
Contributor

ffesti commented Apr 28, 2021

I understand the issue of symbols of the plugin vs system symbols as both may be linked to different versions of a library or symbols may collide otherwise.

I am just not quite sure how or if at all this relates to RTLD_LAZY vs RTLD_NOW. So while the change may be OK I wonder if the commit message is capturing the right reasons.

@benierc
Copy link
Author

benierc commented Apr 28, 2021

@ffesti, i see what you mean, i will change it, thanks

dlopen the plugin librairies with RTLD_BINDDEEP flag
avoid collide with system libraries by first loading plugin symbols
before system symbols

Fixes: rpm-software-management#1663
@pmatilai
Copy link
Member

If I understand the ticket correctly, this is solving the wrong problem. With the exception of foo_hooks, all symbols in a plugin should be static in which case they get resolved at build time and using this GNU-specific extension is wholly unnecessary.

@pmatilai
Copy link
Member

See above, I think this is addressing the wrong end of the problem.

@pmatilai pmatilai closed this Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin library symbols are not loaded at first
3 participants