]> granicus.if.org Git - llvm/commitdiff
Default to Secure PLT on PPC for musl libc.
authorBrad Smith <brad@comstyle.com>
Fri, 28 Jun 2019 19:48:31 +0000 (19:48 +0000)
committerBrad Smith <brad@comstyle.com>
Fri, 28 Jun 2019 19:48:31 +0000 (19:48 +0000)
This matches the default settings of clang.

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

lib/Target/PowerPC/PPCSubtarget.cpp
test/CodeGen/PowerPC/ppc32-pic-large.ll

index 82f71806e5d0a82fb9cc909a94bc1d9bf43ecd80..6aa7528634d3f4b8cb90e006123a720ed27d19c0 100644 (file)
@@ -145,7 +145,8 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
   if (isDarwin())
     HasLazyResolverStubs = true;
 
-  if (TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD())
+  if (TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+      TargetTriple.isMusl())
     SecurePlt = true;
 
   if (HasSPE && IsPPC64)
index 272138e5121bf4c89894dfccdf6032afc45fadfc..266d539024ea90e1441a7e59efeb474c4d55a3b9 100644 (file)
@@ -4,6 +4,8 @@
 ; RUN: llc < %s -mtriple=powerpc-unknown-netbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
 ; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
 ; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
+; RUN: llc < %s -mtriple=powerpc-linux-musl -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
+; RUN: llc < %s -mtriple=powerpc-linux-musl -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
 @bar = common global i32 0, align 4
 
 declare i32 @call_foo(i32, ...)