Skip to content

Commit a12d2aa

Browse files
mati865Mark-Simulacrum
authored andcommitted
Revert "Enable ASLR for windows-gnu"
This reverts commit 0ad3da0.
1 parent d7ff9b0 commit a12d2aa

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

compiler/rustc_target/src/spec/windows_gnu_base.rs

-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ pub fn opts() -> TargetOptions {
1111
"-fno-use-linker-plugin".to_string(),
1212
// Always enable DEP (NX bit) when it is available
1313
"-Wl,--nxcompat".to_string(),
14-
// Enable ASLR
15-
"-Wl,--dynamicbase".to_string(),
16-
// ASLR will rebase it anyway so leaving that option enabled only leads to confusion
17-
"-Wl,--disable-auto-image-base".to_string(),
1814
],
1915
);
2016

compiler/rustc_target/src/spec/x86_64_pc_windows_gnu.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ use crate::spec::{LinkerFlavor, LldFlavor, Target};
33
pub fn target() -> Target {
44
let mut base = super::windows_gnu_base::opts();
55
base.cpu = "x86-64".to_string();
6-
let gcc_pre_link_args = base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap();
7-
gcc_pre_link_args.push("-m64".to_string());
8-
// Use high-entropy 64 bit address space for ASLR
9-
gcc_pre_link_args.push("-Wl,--high-entropy-va".to_string());
6+
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
107
base.pre_link_args
118
.insert(LinkerFlavor::Lld(LldFlavor::Ld), vec!["-m".to_string(), "i386pep".to_string()]);
129
base.max_atomic_width = Some(64);

compiler/rustc_target/src/spec/x86_64_uwp_windows_gnu.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ use crate::spec::{LinkerFlavor, LldFlavor, Target};
33
pub fn target() -> Target {
44
let mut base = super::windows_uwp_gnu_base::opts();
55
base.cpu = "x86-64".to_string();
6-
let gcc_pre_link_args = base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap();
7-
gcc_pre_link_args.push("-m64".to_string());
8-
// Use high-entropy 64 bit address space for ASLR
9-
gcc_pre_link_args.push("-Wl,--high-entropy-va".to_string());
6+
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
107
base.pre_link_args
118
.insert(LinkerFlavor::Lld(LldFlavor::Ld), vec!["-m".to_string(), "i386pep".to_string()]);
129
base.max_atomic_width = Some(64);

0 commit comments

Comments
 (0)