forked from OSchip/llvm-project
Rework logic and comment out the default relocation models for PPC.
llvm-svn: 305630
This commit is contained in:
parent
5ec30ef4e4
commit
c70d07b7ea
|
@ -192,16 +192,19 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
|
|||
|
||||
static Reloc::Model getEffectiveRelocModel(const Triple &TT,
|
||||
Optional<Reloc::Model> RM) {
|
||||
if (!RM.hasValue()) {
|
||||
if (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le) {
|
||||
if (!TT.isOSBinFormatMachO() && !TT.isMacOSX())
|
||||
return Reloc::PIC_;
|
||||
}
|
||||
if (RM.hasValue())
|
||||
return *RM;
|
||||
|
||||
// Darwin defaults to dynamic-no-pic.
|
||||
if (TT.isOSDarwin())
|
||||
return Reloc::DynamicNoPIC;
|
||||
|
||||
// Non-darwin 64-bit platforms are PIC by default.
|
||||
if (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le)
|
||||
return Reloc::PIC_;
|
||||
|
||||
// 32-bit is static by default.
|
||||
return Reloc::Static;
|
||||
}
|
||||
return *RM;
|
||||
}
|
||||
|
||||
// The FeatureString here is a little subtle. We are modifying the feature
|
||||
|
|
Loading…
Reference in New Issue