forked from OSchip/llvm-project
[PowerPC] Set the default PLT mode on OpenBSD/powerpc to Secure PLT.
OpenBSD/powerpc only supports Secure PLT. llvm-svn: 347179
This commit is contained in:
parent
58ceba6e46
commit
a7b204b44f
|
@ -107,15 +107,19 @@ void ppc::getPPCTargetFeatures(const Driver &D, const llvm::Triple &Triple,
|
|||
if (FloatABI == ppc::FloatABI::Soft)
|
||||
Features.push_back("-hard-float");
|
||||
|
||||
ppc::ReadGOTPtrMode ReadGOT = ppc::getPPCReadGOTPtrMode(D, Args);
|
||||
ppc::ReadGOTPtrMode ReadGOT = ppc::getPPCReadGOTPtrMode(D, Triple, Args);
|
||||
if (ReadGOT == ppc::ReadGOTPtrMode::SecurePlt)
|
||||
Features.push_back("+secure-plt");
|
||||
}
|
||||
|
||||
ppc::ReadGOTPtrMode ppc::getPPCReadGOTPtrMode(const Driver &D, const ArgList &Args) {
|
||||
ppc::ReadGOTPtrMode ppc::getPPCReadGOTPtrMode(const Driver &D, const llvm::Triple &Triple,
|
||||
const ArgList &Args) {
|
||||
if (Args.getLastArg(options::OPT_msecure_plt))
|
||||
return ppc::ReadGOTPtrMode::SecurePlt;
|
||||
return ppc::ReadGOTPtrMode::Bss;
|
||||
if (Triple.isOSOpenBSD())
|
||||
return ppc::ReadGOTPtrMode::SecurePlt;
|
||||
else
|
||||
return ppc::ReadGOTPtrMode::Bss;
|
||||
}
|
||||
|
||||
ppc::FloatABI ppc::getPPCFloatABI(const Driver &D, const ArgList &Args) {
|
||||
|
|
|
@ -38,7 +38,7 @@ FloatABI getPPCFloatABI(const Driver &D, const llvm::opt::ArgList &Args);
|
|||
|
||||
std::string getPPCTargetCPU(const llvm::opt::ArgList &Args);
|
||||
const char *getPPCAsmModeForCPU(StringRef Name);
|
||||
ReadGOTPtrMode getPPCReadGOTPtrMode(const Driver &D,
|
||||
ReadGOTPtrMode getPPCReadGOTPtrMode(const Driver &D, const llvm::Triple &Triple,
|
||||
const llvm::opt::ArgList &Args);
|
||||
|
||||
void getPPCTargetFeatures(const Driver &D, const llvm::Triple &Triple,
|
||||
|
|
|
@ -112,3 +112,8 @@
|
|||
// RUN: | FileCheck -check-prefix=CHECK-ARM-FLOAT-ABI %s
|
||||
// CHECK-ARM-FLOAT-ABI-NOT: "-target-feature" "+soft-float"
|
||||
// CHECK-ARM-FLOAT-ABI: "-target-feature" "+soft-float-abi"
|
||||
|
||||
// Check PowerPC for Secure PLT
|
||||
// RUN: %clang -target powerpc-unknown-openbsd -### -c %s 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=CHECK-POWERPC-SECUREPLT %s
|
||||
// CHECK-POWERPC-SECUREPLT: "-target-feature" "+secure-plt"
|
||||
|
|
Loading…
Reference in New Issue