about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_codegen_ssa/src/back/linker.rs10
-rw-r--r--compiler/rustc_middle/src/middle/exported_symbols.rs3
2 files changed, 8 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
index 3d8ff3fbf56..556aa4ed616 100644
--- a/compiler/rustc_codegen_ssa/src/back/linker.rs
+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
@@ -1882,11 +1882,11 @@ pub(crate) fn linked_symbols(
             // We really only need symbols from upstream rlibs to end up in the linked symbols list.
             // The rest are in separate object files which the linker will always link in and
             // doesn't have rules around the order in which they need to appear.
-            // When doing LTO, some of the symbols in the linked symbols list may end up getting
-            // internalized, which then prevents referencing them from symbols.o. When doing LTO,
-            // all object files that get linked in will be local object files rather than pulled in
-            // from rlibs, so an empty linked symbols list works fine to avoid referencing all those
-            // internalized symbols from symbols.o.
+            // When doing LTO, some of the symbols in the linked symbols list happen to be
+            // internalized by LTO, which then prevents referencing them from symbols.o. When doing
+            // LTO, all object files that get linked in will be local object files rather than
+            // pulled in from rlibs, so an empty linked symbols list works fine to avoid referencing
+            // all those internalized symbols from symbols.o.
             return Vec::new();
         }
     }
diff --git a/compiler/rustc_middle/src/middle/exported_symbols.rs b/compiler/rustc_middle/src/middle/exported_symbols.rs
index 491bba98c19..c70ff398cea 100644
--- a/compiler/rustc_middle/src/middle/exported_symbols.rs
+++ b/compiler/rustc_middle/src/middle/exported_symbols.rs
@@ -31,6 +31,9 @@ pub enum SymbolExportKind {
 
 /// The `SymbolExportInfo` of a symbols specifies symbol-related information
 /// that is relevant to code generation and linking.
+///
+/// The difference between `used` and `rustc_std_internal_symbol` is that the
+/// former is exported by LTO while the latter isn't.
 #[derive(Eq, PartialEq, Debug, Copy, Clone, TyEncodable, TyDecodable, HashStable)]
 pub struct SymbolExportInfo {
     pub level: SymbolExportLevel,