Skip to content

Commit

Permalink
Fix handling of rust_eh_personality in reachable_non_generics
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Aug 27, 2022
1 parent d8c8148 commit a7e4794
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,14 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, cnum: CrateNum) -> DefIdMap<
}
})
.map(|def_id| {
let (export_level, used) = if special_runtime_crate {
let name = tcx.symbol_name(Instance::mono(tcx, def_id.to_def_id())).name;
// We won't link right if these symbols are stripped during LTO.
let used = match name {
"rust_eh_personality"
| "rust_eh_register_frames"
| "rust_eh_unregister_frames" => true,
_ => false,
};
(SymbolExportLevel::Rust, used)
// We won't link right if this symbol is stripped during LTO.
let name = tcx.symbol_name(Instance::mono(tcx, def_id.to_def_id())).name;
let used = name == "rust_eh_personality";

let export_level = if special_runtime_crate {
SymbolExportLevel::Rust
} else {
(symbol_export_level(tcx, def_id.to_def_id()), false)
symbol_export_level(tcx, def_id.to_def_id())
};
let codegen_attrs = tcx.codegen_fn_attrs(def_id.to_def_id());
debug!(
Expand Down

0 comments on commit a7e4794

Please sign in to comment.