diff options
Diffstat (limited to 'src/codegen/helpers.rs')
-rw-r--r-- | src/codegen/helpers.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/codegen/helpers.rs b/src/codegen/helpers.rs index 5136d787..9a8b0576 100644 --- a/src/codegen/helpers.rs +++ b/src/codegen/helpers.rs @@ -45,6 +45,9 @@ pub mod attributes { } pub fn link_name(name: &str) -> quote::Tokens { + // LLVM mangles the name by default but it's already mangled. + // Prefixing the name with \u{1} should tell LLVM to not mangle it. + let name = format!("\u{1}{}", name); quote! { #[link_name = #name] } |