[Clang] Pass -z rel to linker for Fuchsia

Fuchsia already supports the more compact relocation format.
Make it the default.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D113136
This commit is contained in:
Roland McGrath 2021-11-10 12:28:51 -08:00
parent 58ebc79a64
commit ff11f0aa5d
2 changed files with 3 additions and 1 deletions

View File

@ -60,6 +60,8 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("rodynamic");
CmdArgs.push_back("-z");
CmdArgs.push_back("separate-loadable-segments");
CmdArgs.push_back("-z");
CmdArgs.push_back("rel");
CmdArgs.push_back("--pack-dyn-relocs=relr");
}

View File

@ -35,7 +35,7 @@
// CHECK-X86_64: "-fsanitize=safe-stack"
// CHECK: "-stack-protector" "2"
// CHECK-NOT: "-fcommon"
// CHECK: {{.*}}ld.lld{{.*}}" "-z" "max-page-size=4096" "-z" "now" "-z" "rodynamic" "-z" "separate-loadable-segments" "--pack-dyn-relocs=relr"
// CHECK: {{.*}}ld.lld{{.*}}" "-z" "max-page-size=4096" "-z" "now" "-z" "rodynamic" "-z" "separate-loadable-segments" "-z" "rel" "--pack-dyn-relocs=relr"
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"