[llvm-commits] [llvm] r122400 - /llvm/trunk/lib/MC/MachObjectWriter.cpp
Daniel Dunbar
daniel at zuster.org
Wed Dec 22 05:49:43 PST 2010
Author: ddunbar
Date: Wed Dec 22 07:49:43 2010
New Revision: 122400
URL: http://llvm.org/viewvc/llvm-project?rev=122400&view=rev
Log:
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.
Modified:
llvm/trunk/lib/MC/MachObjectWriter.cpp
Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=122400&r1=122399&r2=122400&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MachObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/MachObjectWriter.cpp Wed Dec 22 07:49:43 2010
@@ -235,6 +235,10 @@
/// @{
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 @@
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;
More information about the llvm-commits
mailing list