Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use PIE (full ASLR) by default on Android too #17448

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ fn link_args(cmd: &mut Command,
// relocation model of position independent code is not changed. This is a requirement to take
// advantage of ASLR, as otherwise the functions in the executable are not randomized and can
// be used during an exploit of a vulnerability in any code.
if sess.targ_cfg.os == abi::OsLinux {
if sess.targ_cfg.os == abi::OsLinux || sess.targ_cfg.os == abi::OsAndroid {
let mut args = sess.opts.cg.link_args.iter().chain(used_link_args.iter());
if !dylib && sess.opts.cg.relocation_model.as_slice() == "pic" &&
!args.any(|x| x.as_slice() == "-static") {
Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

// no-pretty-expanded FIXME #15189
// ignore-windows FIXME #13259
// ignore-android FIXME #17520
extern crate native;

use std::os;
Expand Down