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.

llvm-svn: 122400
This commit is contained in:
Daniel Dunbar 2010-12-22 13:49:43 +00:00
parent fbb9ac3cca
commit 1e5be3653c
1 changed files with 15 additions and 0 deletions

View File

@ -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;