Skip to content

Commit

Permalink
Limit dylib symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Apr 6, 2019
1 parent 7641873 commit 2f948ea
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/librustc_codegen_ssa/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,11 @@ impl<'a> Linker for GccLinker<'a> {
}

fn export_symbols(&mut self, tmpdir: &Path, crate_type: CrateType) {
// If we're compiling a dylib, then we let symbol visibility in object
// files to take care of whether they're exported or not.
//
// If we're compiling a cdylib, however, we manually create a list of
// exported symbols to ensure we don't expose any more. The object files
// have far more public symbols than we actually want to export, so we
// hide them all here.
if crate_type == CrateType::Dylib ||
crate_type == CrateType::ProcMacro {
// We manually create a list of exported symbols to ensure we don't expose any more.
// The object files have far more public symbols than we actually want to export,
// so we hide them all here.

if crate_type == CrateType::ProcMacro {
return
}

Expand Down

0 comments on commit 2f948ea

Please sign in to comment.