Mark __msan_track_origins as an exported symbol for LTO
This commit is contained in:
parent
66b0c97070
commit
2c0845c6cc
2 changed files with 12 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
|||
|
||||
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
use rustc::middle::exported_symbols::{metadata_symbol_name, ExportedSymbol, SymbolExportLevel};
|
||||
use rustc::session::config;
|
||||
use rustc::session::config::{self, Sanitizer};
|
||||
use rustc::ty::query::Providers;
|
||||
use rustc::ty::subst::SubstsRef;
|
||||
use rustc::ty::Instance;
|
||||
|
|
@ -206,6 +206,12 @@ fn exported_symbols_provider_local(
|
|||
}));
|
||||
}
|
||||
|
||||
if let Some(Sanitizer::Memory) = tcx.sess.opts.debugging_opts.sanitizer {
|
||||
// Similar to profiling, preserve weak msan symbol during LTO.
|
||||
let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new("__msan_track_origins"));
|
||||
symbols.push((exported_symbol, SymbolExportLevel::C));
|
||||
}
|
||||
|
||||
if tcx.sess.crate_types.borrow().contains(&config::CrateType::Dylib) {
|
||||
let symbol_name = metadata_symbol_name(tcx);
|
||||
let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(&symbol_name));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue