Skip to content

Commit

Permalink
Ensure #[used] symbols are preserved in LTO
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Apr 24, 2022
1 parent 9ebeb28 commit 1af3e0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/back/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn prepare_lto(
};

let symbol_filter = &|&(ref name, info): &(String, SymbolExportInfo)| {
if info.level.is_below_threshold(export_threshold) {
if info.level.is_below_threshold(export_threshold) || info.used {
Some(CString::new(name.as_str()).unwrap())
} else {
None
Expand Down

0 comments on commit 1af3e0a

Please sign in to comment.