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

Change signature of load_library_permanently #445

Merged
merged 6 commits into from
Oct 4, 2023
Merged

Change signature of load_library_permanently #445

merged 6 commits into from
Oct 4, 2023

Conversation

gavrilikhin-d
Copy link
Contributor

@gavrilikhin-d gavrilikhin-d commented Sep 29, 2023

Description

Change signature of load_library_permanently to be more self-describing

Related Issue

#443

How This Has Been Tested

cargo t --features llvm16-0

Will it be overkill to load a real dll in test?

Breaking Changes

Signature change breaks existing code

Checklist

src/support/mod.rs Outdated Show resolved Hide resolved
src/support/mod.rs Outdated Show resolved Hide resolved
src/support/mod.rs Show resolved Hide resolved
@gavrilikhin-d gavrilikhin-d changed the title Add try_load_library_permanently Change signature of load_library_permanently Sep 30, 2023
Comment on lines +175 to +177
pub fn load_visible_symbols() {
unsafe { LLVMLoadLibraryPermanently(std::ptr::null()) };
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find it anywhere in docs, but people from StackOverflow (and tests) say that passing nullptr as filename results in loading all the symbols visible inside program

/// Search through all previously loaded dynamic libraries for `symbol`.
///
/// Returns an address of the symbol, if found
pub fn search_for_address_of_symbol(symbol: &str) -> Option<usize> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may use this to protect from running non-linked functions in jit

Copy link
Owner

@TheDan64 TheDan64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TheDan64 TheDan64 merged commit 7a09ad8 into TheDan64:master Oct 4, 2023
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.

2 participants