Skip to content

Commit ecf3f6d

Browse files
committed
Make partial RELRO default on ppc64 due to segfault
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 <[email protected]>
1 parent 94b9cc9 commit ecf3f6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_back/target/powerpc64_unknown_linux_gnu.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@
99
// except according to those terms.
1010

1111
use LinkerFlavor;
12-
use target::{Target, TargetResult};
12+
use target::{Target, TargetResult, RelroLevel};
1313

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

20+
// ld.so in at least RHEL6 on ppc64 has a bug related to BIND_NOW, so only enable partial RELRO
21+
// for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
22+
base.relro_level = RelroLevel::Partial;
23+
2024
// see #36994
2125
base.exe_allocation_crate = None;
2226

0 commit comments

Comments
 (0)