diff options
| author | Thom Chiovoloni <chiovolonit@gmail.com> | 2022-02-06 13:51:11 -0800 |
|---|---|---|
| committer | Thom Chiovoloni <chiovolonit@gmail.com> | 2022-05-11 01:29:56 -0700 |
| commit | 54133cfcf49c68886a7cd8046007ea14e3d3944d (patch) | |
| tree | 09f22cb6e789c937d4edccc8f8450b0328d31efe /compiler/rustc_codegen_ssa | |
| parent | ecd44958e0a21110d09862ee080d95a4ca6c52f8 (diff) | |
| download | rust-54133cfcf49c68886a7cd8046007ea14e3d3944d.tar.gz rust-54133cfcf49c68886a7cd8046007ea14e3d3944d.zip | |
Only compile #[used] as llvm.compiler.used for ELF targets
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/traits/statics.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/traits/statics.rs b/compiler/rustc_codegen_ssa/src/traits/statics.rs index a2a3cb56c78..413d31bb942 100644 --- a/compiler/rustc_codegen_ssa/src/traits/statics.rs +++ b/compiler/rustc_codegen_ssa/src/traits/statics.rs @@ -13,7 +13,9 @@ pub trait StaticMethods: BackendTypes { /// Same as add_used_global(), but only prevent the compiler from potentially removing an /// otherwise unused symbol. The linker is still permitted to drop it. /// - /// This corresponds to the semantics of the `#[used]` attribute. + /// This corresponds to the documented semantics of the `#[used]` attribute, although + /// on some targets (non-ELF), we may use `add_used_global` for `#[used]` statics + /// instead. fn add_compiler_used_global(&self, global: Self::Value); } |
