Skip to content

Instantly share code, notes, and snippets.

@Wazzaps
Created March 13, 2020 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wazzaps/b8b28c7123820874c5455bf5a07ef979 to your computer and use it in GitHub Desktop.
Save Wazzaps/b8b28c7123820874c5455bf5a07ef979 to your computer and use it in GitHub Desktop.
ab wants to call ba::hello(). ab should be the one dynamically loaded here, but it shouldn't matter I think.
mod ba {
#[link(name="ba")]
extern "Rust" {
#[link_name = "_ZN2ba5hello17hb8c57573de8c5a19E"]
pub fn hello();
}
}
fn main() {
unsafe { ba::hello() }
}
pub extern fn hello() {
println!("hello");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment