r372261 - On PowerPC, Secure-PLT by default for FreeBSD 13 and higher

Dimitry Andric via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 18 13:58:03 PDT 2019


Author: dim
Date: Wed Sep 18 13:58:03 2019
New Revision: 372261

URL: http://llvm.org/viewvc/llvm-project?rev=372261&view=rev
Log:
On PowerPC, Secure-PLT by default for FreeBSD 13 and higher

Summary:
In https://svnweb.freebsd.org/changeset/base/349351, FreeBSD 13 and
higher transitioned to Secure-PLT for PowerPC.  This part contains the
changes in clang's PPC architecture defaults.

Reviewers: emaste, jhibbits, hfinkel

Reviewed By: jhibbits

Subscribers: wuzish, nemanjai, krytarowski, kbarton, MaskRay, jsji, shchenz, steven.zhang, cfe-commits

Tags: #clang

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

Modified:
    cfe/trunk/lib/Driver/ToolChains/Arch/PPC.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Arch/PPC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/PPC.cpp?rev=372261&r1=372260&r2=372261&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Arch/PPC.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Arch/PPC.cpp Wed Sep 18 13:58:03 2019
@@ -115,7 +115,8 @@ ppc::ReadGOTPtrMode ppc::getPPCReadGOTPt
                                               const ArgList &Args) {
   if (Args.getLastArg(options::OPT_msecure_plt))
     return ppc::ReadGOTPtrMode::SecurePlt;
-  if (Triple.isOSNetBSD() || Triple.isOSOpenBSD() || Triple.isMusl())
+  if ((Triple.isOSFreeBSD() && Triple.getOSMajorVersion() >= 13) ||
+      Triple.isOSNetBSD() || Triple.isOSOpenBSD() || Triple.isMusl())
     return ppc::ReadGOTPtrMode::SecurePlt;
   else
     return ppc::ReadGOTPtrMode::Bss;




More information about the cfe-commits mailing list