File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
rustc_codegen_llvm/src/back Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ fn prepare_lto(
7070 symbols_below_threshold. extend ( msan_weak_symbols. into_iter ( ) . map ( |sym| sym. to_owned ( ) ) ) ;
7171 }
7272
73+ // Preserve LLVM-injected, ASAN-related symbols.
74+ // See also https://github.com/rust-lang/rust/issues/113404.
75+ symbols_below_threshold. push ( c"___asan_globals_registered" . to_owned ( ) ) ;
76+
7377 // __llvm_profile_counter_bias is pulled in at link time by an undefined reference to
7478 // __llvm_profile_runtime, therefore we won't know until link time if this symbol
7579 // should have default visibility.
Original file line number Diff line number Diff line change @@ -1226,12 +1226,6 @@ extern "C" void LLVMRustPrintPasses() {
12261226extern " C" void LLVMRustRunRestrictionPass (LLVMModuleRef M, char **Symbols,
12271227 size_t Len) {
12281228 auto PreserveFunctions = [=](const GlobalValue &GV) {
1229- // Preserve LLVM-injected, ASAN-related symbols.
1230- // See also https://github.com/rust-lang/rust/issues/113404.
1231- if (GV.getName () == " ___asan_globals_registered" ) {
1232- return true ;
1233- }
1234-
12351229 // Preserve symbols exported from Rust modules.
12361230 for (size_t I = 0 ; I < Len; I++) {
12371231 if (GV.getName () == Symbols[I]) {
You can’t perform that action at this time.
0 commit comments