[Driver] Always use -z rodynamic for Fuchsia

Fuchsia uses read-only .dynamic section.

Differential Revision: https://reviews.llvm.org/D35582

llvm-svn: 308390
This commit is contained in:
Petr Hosek 2017-07-18 23:23:16 +00:00
parent 483506562c
commit dcf3d49a8e
3 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,9 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (llvm::sys::path::stem(Exec).equals_lower("lld")) {
CmdArgs.push_back("-flavor");
CmdArgs.push_back("gnu");
CmdArgs.push_back("-z");
CmdArgs.push_back("rodynamic");
}
if (!D.SysRoot.empty())

View File

@ -5,6 +5,7 @@
// CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
// CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include"
// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
// CHECK: "-z" "rodynamic"
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"

View File

@ -7,6 +7,7 @@
// CHECK: "-internal-isystem" "{{.*[/\\]}}x86_64-fuchsia{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
// CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include"
// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
// CHECK: "-z" "rodynamic"
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"