diff options
| author | Marcel Hlopko <hlopko@google.com> | 2021-09-10 15:11:56 +0200 |
|---|---|---|
| committer | Marcel Hlopko <hlopko@google.com> | 2021-10-01 08:06:42 +0200 |
| commit | 198d90786b9fb429928d70c423bad5d65374a532 (patch) | |
| tree | dfe7e0753b3e6071471f9a29075fb134b2679f72 /compiler/rustc_codegen_llvm/src/mono_item.rs | |
| parent | 497ee321af3b8496eaccd7af7b437f18bab81abf (diff) | |
| download | rust-198d90786b9fb429928d70c423bad5d65374a532.tar.gz rust-198d90786b9fb429928d70c423bad5d65374a532.zip | |
Add `pie` as another `relocation-model` value
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/mono_item.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/mono_item.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/mono_item.rs b/compiler/rustc_codegen_llvm/src/mono_item.rs index 8ba3e870fbb..17bf55bf512 100644 --- a/compiler/rustc_codegen_llvm/src/mono_item.rs +++ b/compiler/rustc_codegen_llvm/src/mono_item.rs @@ -144,6 +144,12 @@ impl CodegenCx<'ll, 'tcx> { return true; } + // With pie relocation model calls of functions defined in the translation + // unit can use copy relocations. + if self.tcx.sess.relocation_model() == RelocModel::Pie && !is_declaration { + return true; + } + return false; } } |
