[PATCH] D84482: [Fuchsia] Use -z dead-reloc-in-nonalloc=*=0 for Fuchsia targets
Roland McGrath via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 23 18:52:57 PDT 2020
mcgrathr created this revision.
mcgrathr added reviewers: phosek, leonardchan.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D84482
Files:
clang/lib/Driver/ToolChains/Fuchsia.cpp
Index: clang/lib/Driver/ToolChains/Fuchsia.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -53,6 +53,13 @@
CmdArgs.push_back("-z");
CmdArgs.push_back("now");
+ // 0 is never a valid code address for Fuchsia (user or kernel), so using the
+ // traditional 0 value for references to discarded code is always fine on
+ // Fuchsia. The new defaults of -1 and such in lld confuse some older tools
+ // for no benefit to Fuchsia.
+ CmdArgs.push_back("-z");
+ CmdArgs.push_back("dead-reloc-in-nonalloc=*=0");
+
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
if (llvm::sys::path::filename(Exec).equals_lower("ld.lld") ||
llvm::sys::path::stem(Exec).equals_lower("ld.lld")) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84482.280311.patch
Type: text/x-patch
Size: 829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200724/553056f9/attachment.bin>
More information about the cfe-commits
mailing list