Skip to content

Commit 185dceb

Browse files
committed
Limit dylib symbols
1 parent 55cee44 commit 185dceb

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/librustc_codegen_ssa/back/linker.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -377,15 +377,11 @@ impl<'a> Linker for GccLinker<'a> {
377377
return;
378378
}
379379

380-
// If we're compiling a dylib, then we let symbol visibility in object
381-
// files to take care of whether they're exported or not.
382-
//
383-
// If we're compiling a cdylib, however, we manually create a list of
384-
// exported symbols to ensure we don't expose any more. The object files
385-
// have far more public symbols than we actually want to export, so we
386-
// hide them all here.
387-
if crate_type == CrateType::Dylib ||
388-
crate_type == CrateType::ProcMacro {
380+
// We manually create a list of exported symbols to ensure we don't expose any more.
381+
// The object files have far more public symbols than we actually want to export,
382+
// so we hide them all here.
383+
384+
if crate_type == CrateType::ProcMacro {
389385
return
390386
}
391387

0 commit comments

Comments
 (0)