feat: impl export-executable-symbols

This commit is contained in:
csmoe
2022-07-25 05:20:23 +00:00
parent babff2211e
commit 6674c94d15
7 changed files with 42 additions and 5 deletions

View File

@@ -2082,7 +2082,12 @@ fn add_order_independent_options(
// sections to ensure we have all the data for PGO.
let keep_metadata =
crate_type == CrateType::Dylib || sess.opts.cg.profile_generate.enabled();
cmd.gc_sections(keep_metadata);
if crate_type != CrateType::Executable || !sess.opts.unstable_opts.export_executable_symbols
{
cmd.gc_sections(keep_metadata);
} else {
cmd.no_gc_sections();
}
}
cmd.set_output_kind(link_output_kind, out_filename);