[XCore] Use static relocation model by default.

This allows us to get get rid of a hack in XCoreTargetObjectFile where the
the DataRel* sections were overridden.

llvm-svn: 181116
This commit is contained in:
Richard Osborne 2013-05-04 16:40:58 +00:00
parent b2d998f356
commit df9e574105
4 changed files with 11 additions and 5 deletions

View File

@ -66,6 +66,9 @@ static MCCodeGenInfo *createXCoreMCCodeGenInfo(StringRef TT, Reloc::Model RM,
CodeModel::Model CM,
CodeGenOpt::Level OL) {
MCCodeGenInfo *X = new MCCodeGenInfo();
if (RM == Reloc::Default) {
RM = Reloc::Static;
}
X->InitMCCodeGenInfo(RM, CM, OL);
return X;
}

View File

@ -1623,6 +1623,12 @@ XCoreTargetLowering::isLegalAddressingMode(const AddrMode &AM,
}
}
bool XCoreTargetLowering::
isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const {
// The XCore target isn't yet aware of offsets.
return false;
}
//===----------------------------------------------------------------------===//
// XCore Inline Assembly Support
//===----------------------------------------------------------------------===//

View File

@ -106,6 +106,8 @@ namespace llvm {
virtual bool isLegalAddressingMode(const AddrMode &AM,
Type *Ty) const;
virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
private:
const XCoreTargetMachine &TM;
const XCoreSubtarget &Subtarget;

View File

@ -57,9 +57,4 @@ void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
ELF::SHF_ALLOC |
ELF::XCORE_SHF_CP_SECTION,
SectionKind::getReadOnlyWithRel());
// Dynamic linking is not supported. Data with relocations is placed in the
// same section as data without relocations.
DataRelSection = DataRelLocalSection = DataSection;
DataRelROSection = DataRelROLocalSection = ReadOnlySection;
}