diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2021-10-01 09:18:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-01 09:18:16 -0700 |
| commit | 6f1e93058137eb606cbee5ef778d30b379903f7c (patch) | |
| tree | 1840b8bb51958a08a03e4a76d5ce698ff07d58c6 /compiler/rustc_codegen_ssa/src/back | |
| parent | 37df2753fc52ff80625430aa7e8cdcdc6f16e362 (diff) | |
| parent | 198d90786b9fb429928d70c423bad5d65374a532 (diff) | |
| download | rust-6f1e93058137eb606cbee5ef778d30b379903f7c.tar.gz rust-6f1e93058137eb606cbee5ef778d30b379903f7c.zip | |
Rollup merge of #88820 - hlopko:add_pie_relocation_model, r=petrochenkov
Add `pie` as another `relocation-model` value MCP: https://github.com/rust-lang/compiler-team/issues/461
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 1c0442a231a..43affdebbaf 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1490,9 +1490,13 @@ fn exec_linker( fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) { (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe, - (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe, + (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => { + LinkOutputKind::DynamicPicExe + } (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe, - (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe, + (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => { + LinkOutputKind::StaticPicExe + } (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe, (_, true, _) => LinkOutputKind::StaticDylib, (_, false, _) => LinkOutputKind::DynamicDylib, |
