[clang] ff11f0a - [Clang] Pass -z rel to linker for Fuchsia
Roland McGrath via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 10 13:31:32 PST 2021
Author: Roland McGrath
Date: 2021-11-10T13:31:22-08:00
New Revision: ff11f0aa5de1fffaec5f0dde53fad2ba333116b1
URL: https://github.com/llvm/llvm-project/commit/ff11f0aa5de1fffaec5f0dde53fad2ba333116b1
DIFF: https://github.com/llvm/llvm-project/commit/ff11f0aa5de1fffaec5f0dde53fad2ba333116b1.diff
LOG: [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
Added:
Modified:
clang/lib/Driver/ToolChains/Fuchsia.cpp
clang/test/Driver/fuchsia.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Fuchsia.cpp b/clang/lib/Driver/ToolChains/Fuchsia.cpp
index ee79007fe9a61..b8570fce9eb7d 100644
--- a/clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ b/clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -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");
}
diff --git a/clang/test/Driver/fuchsia.c b/clang/test/Driver/fuchsia.c
index 926594da95c3a..ecf811d9401ba 100644
--- a/clang/test/Driver/fuchsia.c
+++ b/clang/test/Driver/fuchsia.c
@@ -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"
More information about the cfe-commits
mailing list