summaryrefslogtreecommitdiff
path: root/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-12-22 13:49:43 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-12-22 13:49:43 +0000
commit532c456d48c40623631ab9b3e7322a93af8d7700 (patch)
treed824ed794436df78e60f70f8994e15acb4110c05 /lib/MC/MachObjectWriter.cpp
parent37bf92b5238434b00fde79347ba5336e7554e562 (diff)
downloadllvm-532c456d48c40623631ab9b3e7322a93af8d7700.tar.gz
llvm-532c456d48c40623631ab9b3e7322a93af8d7700.tar.bz2
llvm-532c456d48c40623631ab9b3e7322a93af8d7700.tar.xz
MC/Mach-O: Split out RecordARMRelocation for now, it is weird enough it isn't
clear how to keep in the generic path (yet). - Will revisit when it actually works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MachObjectWriter.cpp')
-rw-r--r--lib/MC/MachObjectWriter.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp
index 386f4517b6..a4c612d0d6 100644
--- a/lib/MC/MachObjectWriter.cpp
+++ b/lib/MC/MachObjectWriter.cpp
@@ -235,6 +235,10 @@ public:
/// @{
bool is64Bit() const { return TargetObjectWriter->is64Bit(); }
+ bool isARM() const {
+ uint32_t CPUType = TargetObjectWriter->getCPUType() & mach::CTFM_ArchMask;
+ return CPUType == mach::CTM_ARM;
+ }
/// @}
@@ -839,9 +843,20 @@ public:
Relocations[Fragment->getParent()].push_back(MRE);
}
+ void RecordARMRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
+ const MCFragment *Fragment, const MCFixup &Fixup,
+ MCValue Target, uint64_t &FixedValue) {
+ // FIXME!
+ }
+
void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFragment *Fragment, const MCFixup &Fixup,
MCValue Target, uint64_t &FixedValue) {
+ // FIXME: These needs to be factored into the target Mach-O writer.
+ if (isARM()) {
+ RecordARMRelocation(Asm, Layout, Fragment, Fixup, Target, FixedValue);
+ return;
+ }
if (is64Bit()) {
RecordX86_64Relocation(Asm, Layout, Fragment, Fixup, Target, FixedValue);
return;