]> granicus.if.org Git - llvm/commitdiff
On PowerPC, Secure-PLT by default for FreeBSD 13 and higher
authorDimitry Andric <dimitry@andric.com>
Wed, 18 Sep 2019 20:57:45 +0000 (20:57 +0000)
committerDimitry Andric <dimitry@andric.com>
Wed, 18 Sep 2019 20:57:45 +0000 (20:57 +0000)
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 llvm's PPC subtarget.

Reviewers: emaste, jhibbits, hfinkel

Reviewed By: jhibbits

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372260 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCSubtarget.cpp

index 6aa7528634d3f4b8cb90e006123a720ed27d19c0..6239decf15392c7e1aeace84acb6bb5a9eb06148 100644 (file)
@@ -145,7 +145,8 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
   if (isDarwin())
     HasLazyResolverStubs = true;
 
-  if (TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+  if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+      TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
       TargetTriple.isMusl())
     SecurePlt = true;