Skip to content

Commit

Permalink
Make partial RELRO default on ppc64 due to segfault
Browse files Browse the repository at this point in the history
On at least RHEL6 there is a segfault caused by the older ld.so version
when BIND_NOW is used, so use partial RELRO by default on ppc64
architectures for now.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
  • Loading branch information
kyrias committed Jul 14, 2017
1 parent 94b9cc9 commit ecf3f6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_back/target/powerpc64_unknown_linux_gnu.rs
Expand Up @@ -9,14 +9,18 @@
// except according to those terms.

use LinkerFlavor;
use target::{Target, TargetResult};
use target::{Target, TargetResult, RelroLevel};

pub fn target() -> TargetResult {
let mut base = super::linux_base::opts();
base.cpu = "ppc64".to_string();
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);

// ld.so in at least RHEL6 on ppc64 has a bug related to BIND_NOW, so only enable partial RELRO
// for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
base.relro_level = RelroLevel::Partial;

// see #36994
base.exe_allocation_crate = None;

Expand Down

0 comments on commit ecf3f6d

Please sign in to comment.