Skip to content

Commit 21f32a9

Browse files
committed
Merging r355033:
------------------------------------------------------------------------ r355033 | joerg | 2019-02-27 13:46:01 -0800 (Wed, 27 Feb 2019) | 2 lines Use Secure PLT as default on NetBSD/PowerPC. ------------------------------------------------------------------------ llvm-svn: 364258
1 parent d375592 commit 21f32a9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clang/lib/Driver/ToolChains/Arch/PPC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ ppc::ReadGOTPtrMode ppc::getPPCReadGOTPtrMode(const Driver &D, const llvm::Tripl
116116
const ArgList &Args) {
117117
if (Args.getLastArg(options::OPT_msecure_plt))
118118
return ppc::ReadGOTPtrMode::SecurePlt;
119-
if (Triple.isOSOpenBSD())
119+
if (Triple.isOSNetBSD() || Triple.isOSOpenBSD())
120120
return ppc::ReadGOTPtrMode::SecurePlt;
121121
else
122122
return ppc::ReadGOTPtrMode::Bss;

clang/test/Driver/netbsd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,3 +446,8 @@
446446
// PTHREAD-NOT: _POSIX_THREADS
447447
// PTHREAD: _REENTRANT
448448
// PTHREAD-NOT: _POSIX_THREADS
449+
450+
// Check PowerPC for Secure PLT
451+
// RUN: %clang -target powerpc-unknown-netbsd -### -c %s 2>&1 \
452+
// RUN: | FileCheck -check-prefix=POWERPC-SECUREPLT %s
453+
// POWERPC-SECUREPLT: "-target-feature" "+secure-plt"

0 commit comments

Comments
 (0)