Skip to content

Commit 9124fda

Browse files
committed
Merging r355038:
------------------------------------------------------------------------ r355038 | joerg | 2019-02-27 13:53:14 -0800 (Wed, 27 Feb 2019) | 3 lines Default to Secure PLT on PPC for NetBSD and OpenBSD. This matches the default settings of clang. ------------------------------------------------------------------------ llvm-svn: 360950
1 parent 4b1712f commit 9124fda

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Diff for: llvm/lib/Target/PowerPC/PPCSubtarget.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
138138
if (isDarwin())
139139
HasLazyResolverStubs = true;
140140

141+
if (TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD())
142+
SecurePlt = true;
143+
141144
if (HasSPE && IsPPC64)
142145
report_fatal_error( "SPE is only supported for 32-bit targets.\n", false);
143146
if (HasSPE && (HasAltivec || HasQPX || HasVSX || HasFPU))

Diff for: llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=pic | FileCheck -check-prefix=LARGE-BSS %s
22
; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
3+
; RUN: llc < %s -mtriple=powerpc-unknown-netbsd -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
4+
; RUN: llc < %s -mtriple=powerpc-unknown-netbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
5+
; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
6+
; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
37
@bar = common global i32 0, align 4
48

59
declare i32 @call_foo(i32, ...)

0 commit comments

Comments
 (0)