summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2019-06-28 19:48:31 +0000
committerBrad Smith <brad@comstyle.com>2019-06-28 19:48:31 +0000
commit4b733ca617e8cf7c5ee8b2bc24439bb3fde0d49b (patch)
treeb7ac6f8a1fbce97531a94effb942afb78883cdfb
parentd900ef0a5b13b8f381280e5a16a0e409980a5bcd (diff)
downloadbcm5719-llvm-4b733ca617e8cf7c5ee8b2bc24439bb3fde0d49b.tar.gz
bcm5719-llvm-4b733ca617e8cf7c5ee8b2bc24439bb3fde0d49b.zip
Default to Secure PLT on PPC for musl libc.
This matches the default settings of clang. llvm-svn: 364675
-rw-r--r--llvm/lib/Target/PowerPC/PPCSubtarget.cpp3
-rw-r--r--llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll2
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
index 82f71806e5d..6aa7528634d 100644
--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
@@ -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)
diff --git a/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll b/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
index 272138e5121..266d539024e 100644
--- a/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
+++ b/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
@@ -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, ...)
OpenPOWER on IntegriCloud