File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -241,10 +241,18 @@ fn exported_symbols_provider_local<'tcx>(
241241 }
242242
243243 if tcx. sess . opts . debugging_opts . sanitizer . contains ( SanitizerSet :: MEMORY ) {
244+ let mut msan_weak_symbols = Vec :: new ( ) ;
245+
244246 // Similar to profiling, preserve weak msan symbol during LTO.
245- const MSAN_WEAK_SYMBOLS : [ & str ; 2 ] = [ "__msan_track_origins" , "__msan_keep_going" ] ;
247+ if tcx. sess . opts . debugging_opts . sanitizer_recover . contains ( SanitizerSet :: MEMORY ) {
248+ msan_weak_symbols. push ( "__msan_keep_going" ) ;
249+ }
250+
251+ if tcx. sess . opts . debugging_opts . sanitizer_memory_track_origins != 0 {
252+ msan_weak_symbols. push ( "__msan_track_origins" ) ;
253+ }
246254
247- symbols. extend ( MSAN_WEAK_SYMBOLS . iter ( ) . map ( |sym| {
255+ symbols. extend ( msan_weak_symbols . into_iter ( ) . map ( |sym| {
248256 let exported_symbol = ExportedSymbol :: NoDefId ( SymbolName :: new ( tcx, sym) ) ;
249257 (
250258 exported_symbol,
You can’t perform that action at this time.
0 commit comments