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
This commit is contained in:
Manish Goregaokar
2021-10-01 09:18:16 -07:00
committed by GitHub
11 changed files with 147 additions and 8 deletions

View File

@@ -143,6 +143,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;
}
}