Skip to content

Commit 25f7eee

Browse files
committed
Don't import the metadata symbol
Helps with #1134
1 parent 4cfb885 commit 25f7eee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/driver/jit.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ fn load_imported_symbols_for_jit(tcx: TyCtxt<'_>) -> Vec<(String, *const u8)> {
209209
if name.is_empty() || !symbol.is_global() || symbol.is_undefined() {
210210
return None;
211211
}
212+
if name.starts_with("rust_metadata_") {
213+
// The metadata is part of a section that is not loaded by the dynamic linker in
214+
// case of cg_llvm.
215+
return None;
216+
}
212217
let dlsym_name = if cfg!(target_os = "macos") {
213218
// On macOS `dlsym` expects the name without leading `_`.
214219
assert!(name.starts_with('_'), "{:?}", name);

0 commit comments

Comments
 (0)