summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2013-05-04 16:40:58 +0000
committerRichard Osborne <richard@xmos.com>2013-05-04 16:40:58 +0000
commit0c66f30325848014eda3203da5fae4c2e71a2884 (patch)
tree1fe2d7c9ba543197b2cccb1c27164a137f83666a /lib
parentd66ad6c57115e85487e8a29b1e073305690a9be2 (diff)
downloadllvm-0c66f30325848014eda3203da5fae4c2e71a2884.tar.gz
llvm-0c66f30325848014eda3203da5fae4c2e71a2884.tar.bz2
llvm-0c66f30325848014eda3203da5fae4c2e71a2884.tar.xz
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp3
-rw-r--r--lib/Target/XCore/XCoreISelLowering.cpp6
-rw-r--r--lib/Target/XCore/XCoreISelLowering.h2
-rw-r--r--lib/Target/XCore/XCoreTargetObjectFile.cpp5
4 files changed, 11 insertions, 5 deletions
diff --git a/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp b/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp
index b5b072dcbd..c1773653f5 100644
--- a/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp
+++ b/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp
@@ -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;
}
diff --git a/lib/Target/XCore/XCoreISelLowering.cpp b/lib/Target/XCore/XCoreISelLowering.cpp
index a5d2be88db..f0346f6715 100644
--- a/lib/Target/XCore/XCoreISelLowering.cpp
+++ b/lib/Target/XCore/XCoreISelLowering.cpp
@@ -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
//===----------------------------------------------------------------------===//
diff --git a/lib/Target/XCore/XCoreISelLowering.h b/lib/Target/XCore/XCoreISelLowering.h
index 8d258f5054..7362b0c44a 100644
--- a/lib/Target/XCore/XCoreISelLowering.h
+++ b/lib/Target/XCore/XCoreISelLowering.h
@@ -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;
diff --git a/lib/Target/XCore/XCoreTargetObjectFile.cpp b/lib/Target/XCore/XCoreTargetObjectFile.cpp
index 820389935b..88e3bfd7b8 100644
--- a/lib/Target/XCore/XCoreTargetObjectFile.cpp
+++ b/lib/Target/XCore/XCoreTargetObjectFile.cpp
@@ -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;
}