Exposes libc::dlopen flags for unix platform. #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a requirement for passing the RTLD_NOW flag to libc::dlopen.
This situation arises when undefined symbols in a shared library are present. The undefined symbols are ultimately defined, but in another library that is linked into the library being loaded.
For example:
Using default flags of
RTLD_LOCAL | RTLD_LAZY
, for some reason, causesFoo
to not be found during runtime.Testing revealed
LD_BIND_NOW=1
works to override this behavior, but that is unfeasible for my use case. I need to be able to specifyRTLD_NOW
as a flag when callinglibc::dlopen
.Therefore, I augmented the public interface to support opening a library with
flags: Option<i32>
. PassingNone
preserves the current behavior. This is a non-breaking change to the public API as far as I can tell.