auto merge of #16566 : thestinger/rust/aslr, r=pcwalton
This is enough for dynamic libraries, but not executables because MinGW does not output a .reloc section even with `--dynamicbase`. It could either be worked around by exporting a DLL symbol from the executable or fixed in MinGW itself.
This commit is contained in:
commit
3b65124063
1 changed files with 3 additions and 0 deletions
|
|
@ -1475,6 +1475,9 @@ fn link_args(cmd: &mut Command,
|
|||
|
||||
// Always enable DEP (NX bit) when it is available
|
||||
cmd.arg("-Wl,--nxcompat");
|
||||
|
||||
// Mark all dynamic libraries and executables as compatible with ASLR
|
||||
cmd.arg("-Wl,--dynamicbase");
|
||||
}
|
||||
|
||||
if sess.targ_cfg.os == abi::OsAndroid {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue