about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-02-21 10:40:30 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2021-02-21 10:40:30 +0100
commit25f7eeec4638694bfeb5dc7569701ee802e2bf45 (patch)
tree369805ddd1e1c8d0bb01de2dfb9bb924dc9ab57a /src
parent4cfb885da7090678ebce1dde972e7df612ef03e5 (diff)
downloadrust-25f7eeec4638694bfeb5dc7569701ee802e2bf45.tar.gz
rust-25f7eeec4638694bfeb5dc7569701ee802e2bf45.zip
Don't import the metadata symbol
Helps with #1134
Diffstat (limited to 'src')
-rw-r--r--src/driver/jit.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/driver/jit.rs b/src/driver/jit.rs
index 4abfcfcd7b1..1640c622b91 100644
--- a/src/driver/jit.rs
+++ b/src/driver/jit.rs
@@ -209,6 +209,11 @@ fn load_imported_symbols_for_jit(tcx: TyCtxt<'_>) -> Vec<(String, *const u8)> {
             if name.is_empty() || !symbol.is_global() || symbol.is_undefined() {
                 return None;
             }
+            if name.starts_with("rust_metadata_") {
+                // The metadata is part of a section that is not loaded by the dynamic linker in
+                // case of cg_llvm.
+                return None;
+            }
             let dlsym_name = if cfg!(target_os = "macos") {
                 // On macOS `dlsym` expects the name without leading `_`.
                 assert!(name.starts_with('_'), "{:?}", name);