Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: lib/MC/ELFObjectWriter.cpp

Issue 4703006: ttryB refactor of elfobjectwriter (Closed) Base URL: https://llvm.org/svn/llvm-project/llvm/trunk/
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/MC/ELFObjectWriter.cpp
===================================================================
--- lib/MC/ELFObjectWriter.cpp (revision 118714)
+++ lib/MC/ELFObjectWriter.cpp (working copy)
@@ -101,6 +101,7 @@
namespace {
class ELFObjectWriterImpl {
+ protected:
/*static bool isFixupKindX86RIPRel(unsigned Kind) {
return Kind == X86::reloc_riprel_4byte ||
Kind == X86::reloc_riprel_4byte_movq_load;
@@ -197,7 +198,7 @@
Is64Bit(_Is64Bit), HasRelocationAddend(_HasRelAddend),
OSType(_OSType), EMachine(_EMachine) {
}
-
+ virtual ~ELFObjectWriterImpl();
void Write8(uint8_t Value) { Writer->Write8(Value); }
void Write16(uint16_t Value) { Writer->Write16(Value); }
void Write32(uint32_t Value) { Writer->Write32(Value); }
@@ -277,28 +278,32 @@
F.getContents() += StringRef(buf, 8);
}
- void WriteHeader(uint64_t SectionDataSize, unsigned NumberOfSections);
+ /// @name new virtuals
+ /// @{
+ virtual void WriteHeader(uint64_t SectionDataSize, unsigned NumberOfSections);
- void WriteSymbolEntry(MCDataFragment *SymtabF, MCDataFragment *ShndxF,
+ virtual void WriteSymbolEntry(MCDataFragment *SymtabF, MCDataFragment *ShndxF,
uint64_t name, uint8_t info,
uint64_t value, uint64_t size,
uint8_t other, uint32_t shndx,
bool Reserved);
- void WriteSymbol(MCDataFragment *SymtabF, MCDataFragment *ShndxF,
+ virtual void WriteSymbol(MCDataFragment *SymtabF, MCDataFragment *ShndxF,
ELFSymbolData &MSD,
const MCAsmLayout &Layout);
- void WriteSymbolTable(MCDataFragment *SymtabF, MCDataFragment *ShndxF,
+ virtual void WriteSymbolTable(MCDataFragment *SymtabF, MCDataFragment *ShndxF,
const MCAssembler &Asm,
const MCAsmLayout &Layout,
unsigned NumRegularSections);
- void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
+ virtual void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFragment *Fragment, const MCFixup &Fixup,
- MCValue Target, uint64_t &FixedValue);
+ MCValue Target, uint64_t &FixedValue) {
+ assert(0 && "RecordRelocation is not specific enough");
+ };
- uint64_t getSymbolIndexInSymbolTable(const MCAssembler &Asm,
+ virtual uint64_t getSymbolIndexInSymbolTable(const MCAssembler &Asm,
const MCSymbol *S);
/// ComputeSymbolTable - Compute the symbol table data
@@ -306,40 +311,68 @@
/// \param StringTable [out] - The string table data.
/// \param StringIndexMap [out] - Map from symbol names to offsets in the
/// string table.
- void ComputeSymbolTable(MCAssembler &Asm);
+ virtual void ComputeSymbolTable(MCAssembler &Asm);
- void WriteRelocation(MCAssembler &Asm, MCAsmLayout &Layout,
+ virtual void WriteRelocation(MCAssembler &Asm, MCAsmLayout &Layout,
const MCSectionData &SD);
- void WriteRelocations(MCAssembler &Asm, MCAsmLayout &Layout) {
+ virtual void WriteRelocations(MCAssembler &Asm, MCAsmLayout &Layout) {
for (MCAssembler::const_iterator it = Asm.begin(),
ie = Asm.end(); it != ie; ++it) {
WriteRelocation(Asm, Layout, *it);
}
}
- void CreateMetadataSections(MCAssembler &Asm, MCAsmLayout &Layout);
+ virtual void CreateMetadataSections(MCAssembler &Asm, MCAsmLayout &Layout);
- void ExecutePostLayoutBinding(MCAssembler &Asm);
+ virtual void ExecutePostLayoutBinding(MCAssembler &Asm);
- void WriteSecHdrEntry(uint32_t Name, uint32_t Type, uint64_t Flags,
+ virtual void WriteSecHdrEntry(uint32_t Name, uint32_t Type, uint64_t Flags,
uint64_t Address, uint64_t Offset,
uint64_t Size, uint32_t Link, uint32_t Info,
uint64_t Alignment, uint64_t EntrySize);
- void WriteRelocationsFragment(const MCAssembler &Asm, MCDataFragment *F,
+ virtual void WriteRelocationsFragment(const MCAssembler &Asm, MCDataFragment *F,
const MCSectionData *SD);
- bool IsFixupFullyResolved(const MCAssembler &Asm,
+ virtual bool IsFixupFullyResolved(const MCAssembler &Asm,
const MCValue Target,
bool IsPCRel,
const MCFragment *DF) const;
- void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout);
+ virtual void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout);
+ /// @}
};
+
+class X86ELFObjectWriterImpl : public ELFObjectWriterImpl {
+public:
+ X86ELFObjectWriterImpl(ELFObjectWriter *_Writer, bool _Is64Bit,
+ uint16_t _EMachine, bool _HasRelAddend,
+ Triple::OSType _OSType);
+ virtual void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
+ const MCFragment *Fragment, const MCFixup &Fixup,
+ MCValue Target, uint64_t &FixedValue);
+ virtual ~X86ELFObjectWriterImpl();
+};
+
+class ARMELFObjectWriterImpl : public ELFObjectWriterImpl {
+public:
+ ARMELFObjectWriterImpl(ELFObjectWriter *_Writer, bool _Is64Bit,
+ uint16_t _EMachine, bool _HasRelAddend,
+ Triple::OSType _OSType);
+ virtual void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
+ const MCFragment *Fragment, const MCFixup &Fixup,
+ MCValue Target, uint64_t &FixedValue);
+ ~ARMELFObjectWriterImpl();
+};
+
}
+// new virtual destructor
+ELFObjectWriterImpl::~ELFObjectWriterImpl()
+{}
+
// Emit the ELF header.
void ELFObjectWriterImpl::WriteHeader(uint64_t SectionDataSize,
unsigned NumberOfSections) {
@@ -649,223 +682,7 @@
return false;
}
-// FIXME: this is currently X86/X86_64 only
-void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
- const MCAsmLayout &Layout,
- const MCFragment *Fragment,
- const MCFixup &Fixup,
- MCValue Target,
- uint64_t &FixedValue) {
- int64_t Addend = 0;
- int Index = 0;
- int64_t Value = Target.getConstant();
- const MCSymbol *Symbol = 0;
- const MCSymbol *Renamed = 0;
- bool IsPCRel = isFixupKindX86PCRel(Fixup.getKind());
- if (!Target.isAbsolute()) {
- Symbol = &AliasedSymbol(Target.getSymA()->getSymbol());
- Renamed = Renames.lookup(Symbol);
- if (!Renamed)
- Renamed = &Target.getSymA()->getSymbol();
- MCSymbolData &SD = Asm.getSymbolData(*Symbol);
- MCFragment *F = SD.getFragment();
-
- if (const MCSymbolRefExpr *RefB = Target.getSymB()) {
- const MCSymbol &SymbolB = RefB->getSymbol();
- MCSymbolData &SDB = Asm.getSymbolData(SymbolB);
- IsPCRel = true;
- MCSectionData *Sec = Fragment->getParent();
-
- // Offset of the symbol in the section
- int64_t a = Layout.getSymbolAddress(&SDB) - Layout.getSectionAddress(Sec);
-
- // Ofeset of the relocation in the section
- int64_t b = Layout.getFragmentOffset(Fragment) + Fixup.getOffset();
- Value += b - a;
- }
-
- // Check that this case has already been fully resolved before we get
- // here.
- if (Symbol->isDefined() && !SD.isExternal() &&
- IsPCRel &&
- &Fragment->getParent()->getSection() == &Symbol->getSection()) {
- llvm_unreachable("We don't need a relocation in this case.");
- return;
- }
-
- bool RelocOnSymbol = ShouldRelocOnSymbol(SD, Target, *Fragment);
- if (!RelocOnSymbol) {
- Index = F->getParent()->getOrdinal();
-
- MCSectionData *FSD = F->getParent();
- // Offset of the symbol in the section
- Value += Layout.getSymbolAddress(&SD) - Layout.getSectionAddress(FSD);
- } else {
- UsedInReloc.insert(Renamed);
- MCSymbolData &RenamedSD = Asm.getSymbolData(*Renamed);
- if (RenamedSD.getFlags() & ELF_Other_Weakref) {
- WeakrefUsedInReloc.insert(Symbol);
- }
- Index = -1;
- }
- Addend = Value;
- // Compensate for the addend on i386.
- if (Is64Bit)
- Value = 0;
- }
-
- FixedValue = Value;
-
- // determine the type of the relocation
-
- MCSymbolRefExpr::VariantKind Modifier = Target.getSymA()->getKind();
- unsigned Type;
- if (Is64Bit) {
- if (IsPCRel) {
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- Type = ELF::R_X86_64_PC32;
- break;
- case MCSymbolRefExpr::VK_PLT:
- Type = ELF::R_X86_64_PLT32;
- break;
- case MCSymbolRefExpr::VK_GOTPCREL:
- Type = ELF::R_X86_64_GOTPCREL;
- break;
- case MCSymbolRefExpr::VK_GOTTPOFF:
- Type = ELF::R_X86_64_GOTTPOFF;
- break;
- case MCSymbolRefExpr::VK_TLSGD:
- Type = ELF::R_X86_64_TLSGD;
- break;
- case MCSymbolRefExpr::VK_TLSLD:
- Type = ELF::R_X86_64_TLSLD;
- break;
- }
- } else {
- switch ((unsigned)Fixup.getKind()) {
- default: llvm_unreachable("invalid fixup kind!");
- case FK_Data_8: Type = ELF::R_X86_64_64; break;
- case X86::reloc_signed_4byte:
- case X86::reloc_pcrel_4byte:
- assert(isInt<32>(Target.getConstant()));
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- Type = ELF::R_X86_64_32S;
- break;
- case MCSymbolRefExpr::VK_GOT:
- Type = ELF::R_X86_64_GOT32;
- break;
- case MCSymbolRefExpr::VK_GOTPCREL:
- Type = ELF::R_X86_64_GOTPCREL;
- break;
- case MCSymbolRefExpr::VK_TPOFF:
- Type = ELF::R_X86_64_TPOFF32;
- break;
- case MCSymbolRefExpr::VK_DTPOFF:
- Type = ELF::R_X86_64_DTPOFF32;
- break;
- }
- break;
- case FK_Data_4:
- Type = ELF::R_X86_64_32;
- break;
- case FK_Data_2: Type = ELF::R_X86_64_16; break;
- case X86::reloc_pcrel_1byte:
- case FK_Data_1: Type = ELF::R_X86_64_8; break;
- }
- }
- } else {
- if (IsPCRel) {
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- Type = ELF::R_386_PC32;
- break;
- case MCSymbolRefExpr::VK_PLT:
- Type = ELF::R_386_PLT32;
- break;
- }
- } else {
- switch ((unsigned)Fixup.getKind()) {
- default: llvm_unreachable("invalid fixup kind!");
-
- case X86::reloc_global_offset_table:
- Type = ELF::R_386_GOTPC;
- break;
-
- // FIXME: Should we avoid selecting reloc_signed_4byte in 32 bit mode
- // instead?
- case X86::reloc_signed_4byte:
- case X86::reloc_pcrel_4byte:
- case FK_Data_4:
- switch (Modifier) {
- default:
- llvm_unreachable("Unimplemented");
- case MCSymbolRefExpr::VK_None:
- Type = ELF::R_386_32;
- break;
- case MCSymbolRefExpr::VK_GOT:
- Type = ELF::R_386_GOT32;
- break;
- case MCSymbolRefExpr::VK_GOTOFF:
- Type = ELF::R_386_GOTOFF;
- break;
- case MCSymbolRefExpr::VK_TLSGD:
- Type = ELF::R_386_TLS_GD;
- break;
- case MCSymbolRefExpr::VK_TPOFF:
- Type = ELF::R_386_TLS_LE_32;
- break;
- case MCSymbolRefExpr::VK_INDNTPOFF:
- Type = ELF::R_386_TLS_IE;
- break;
- case MCSymbolRefExpr::VK_NTPOFF:
- Type = ELF::R_386_TLS_LE;
- break;
- case MCSymbolRefExpr::VK_GOTNTPOFF:
- Type = ELF::R_386_TLS_GOTIE;
- break;
- case MCSymbolRefExpr::VK_TLSLDM:
- Type = ELF::R_386_TLS_LDM;
- break;
- case MCSymbolRefExpr::VK_DTPOFF:
- Type = ELF::R_386_TLS_LDO_32;
- break;
- }
- break;
- case FK_Data_2: Type = ELF::R_386_16; break;
- case X86::reloc_pcrel_1byte:
- case FK_Data_1: Type = ELF::R_386_8; break;
- }
- }
- }
-
- if (RelocNeedsGOT(Modifier))
- NeedsGOT = true;
-
- ELFRelocationEntry ERE;
-
- ERE.Index = Index;
- ERE.Type = Type;
- ERE.Symbol = Renamed;
-
- ERE.r_offset = Layout.getFragmentOffset(Fragment) + Fixup.getOffset();
-
- if (HasRelocationAddend)
- ERE.r_addend = Addend;
- else
- ERE.r_addend = 0; // Silence compiler warning.
-
- Relocations[Fragment->getParent()].push_back(ERE);
-}
-
uint64_t
ELFObjectWriterImpl::getSymbolIndexInSymbolTable(const MCAssembler &Asm,
const MCSymbol *S) {
@@ -1374,8 +1191,20 @@
bool HasRelocationAddend)
: MCObjectWriter(OS, IsLittleEndian)
{
- Impl = new ELFObjectWriterImpl(this, Is64Bit, EMachine,
+ switch (EMachine) {
+ case ELF::EM_MBLAZE:
+ case ELF::EM_386:
+ case ELF::EM_X86_64:
+ Impl = new X86ELFObjectWriterImpl(this, Is64Bit, EMachine,
HasRelocationAddend, OSType);
+ break;
+ case ELF::EM_ARM:
+ Impl = new ARMELFObjectWriterImpl(this, Is64Bit, EMachine,
+ HasRelocationAddend, OSType);
+ break;
+ default:
+ assert(0 && "Unsupported EMachine"); break;
+ }
}
ELFObjectWriter::~ELFObjectWriter() {
@@ -1407,3 +1236,255 @@
const MCAsmLayout &Layout) {
((ELFObjectWriterImpl*) Impl)->WriteObject(Asm, Layout);
}
+
+
+//===- X86ELFObjectWriterImpl ---------------------------------------===//
+
+X86ELFObjectWriterImpl::X86ELFObjectWriterImpl(ELFObjectWriter *_Writer, bool _Is64Bit,
+ uint16_t _EMachine, bool _HasRelAddend,
+ Triple::OSType _OSType)
+ : ELFObjectWriterImpl(_Writer, _Is64Bit, _EMachine, _HasRelAddend, _OSType)
+{}
+
+
+X86ELFObjectWriterImpl::~X86ELFObjectWriterImpl()
+{}
+
+void X86ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
+ const MCAsmLayout &Layout,
+ const MCFragment *Fragment,
+ const MCFixup &Fixup,
+ MCValue Target,
+ uint64_t &FixedValue) {
+ int64_t Addend = 0;
+ int Index = 0;
+ int64_t Value = Target.getConstant();
+ const MCSymbol *Symbol = 0;
+ const MCSymbol *Renamed = 0;
+
+ bool IsPCRel = isFixupKindX86PCRel(Fixup.getKind());
+ if (!Target.isAbsolute()) {
+ Symbol = &AliasedSymbol(Target.getSymA()->getSymbol());
+ Renamed = Renames.lookup(Symbol);
+ if (!Renamed)
+ Renamed = &Target.getSymA()->getSymbol();
+ MCSymbolData &SD = Asm.getSymbolData(*Symbol);
+ MCFragment *F = SD.getFragment();
+
+ if (const MCSymbolRefExpr *RefB = Target.getSymB()) {
+ const MCSymbol &SymbolB = RefB->getSymbol();
+ MCSymbolData &SDB = Asm.getSymbolData(SymbolB);
+ IsPCRel = true;
+ MCSectionData *Sec = Fragment->getParent();
+
+ // Offset of the symbol in the section
+ int64_t a = Layout.getSymbolAddress(&SDB) - Layout.getSectionAddress(Sec);
+
+ // Ofeset of the relocation in the section
+ int64_t b = Layout.getFragmentOffset(Fragment) + Fixup.getOffset();
+ Value += b - a;
+ }
+
+ // Check that this case has already been fully resolved before we get
+ // here.
+ if (Symbol->isDefined() && !SD.isExternal() &&
+ IsPCRel &&
+ &Fragment->getParent()->getSection() == &Symbol->getSection()) {
+ llvm_unreachable("We don't need a relocation in this case.");
+ return;
+ }
+
+ bool RelocOnSymbol = ShouldRelocOnSymbol(SD, Target, *Fragment);
+ if (!RelocOnSymbol) {
+ Index = F->getParent()->getOrdinal();
+
+ MCSectionData *FSD = F->getParent();
+ // Offset of the symbol in the section
+ Value += Layout.getSymbolAddress(&SD) - Layout.getSectionAddress(FSD);
+ } else {
+ UsedInReloc.insert(Renamed);
+ MCSymbolData &RenamedSD = Asm.getSymbolData(*Renamed);
+ if (RenamedSD.getFlags() & ELF_Other_Weakref) {
+ WeakrefUsedInReloc.insert(Symbol);
+ }
+ Index = -1;
+ }
+ Addend = Value;
+ // Compensate for the addend on i386.
+ if (Is64Bit)
+ Value = 0;
+ }
+
+ FixedValue = Value;
+
+ // determine the type of the relocation
+
+ MCSymbolRefExpr::VariantKind Modifier = Target.getSymA()->getKind();
+ unsigned Type;
+ if (Is64Bit) {
+ if (IsPCRel) {
+ switch (Modifier) {
+ default:
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ Type = ELF::R_X86_64_PC32;
+ break;
+ case MCSymbolRefExpr::VK_PLT:
+ Type = ELF::R_X86_64_PLT32;
+ break;
+ case MCSymbolRefExpr::VK_GOTPCREL:
+ Type = ELF::R_X86_64_GOTPCREL;
+ break;
+ case MCSymbolRefExpr::VK_GOTTPOFF:
+ Type = ELF::R_X86_64_GOTTPOFF;
+ break;
+ case MCSymbolRefExpr::VK_TLSGD:
+ Type = ELF::R_X86_64_TLSGD;
+ break;
+ case MCSymbolRefExpr::VK_TLSLD:
+ Type = ELF::R_X86_64_TLSLD;
+ break;
+ }
+ } else {
+ switch ((unsigned)Fixup.getKind()) {
+ default: llvm_unreachable("invalid fixup kind!");
+ case FK_Data_8: Type = ELF::R_X86_64_64; break;
+ case X86::reloc_signed_4byte:
+ case X86::reloc_pcrel_4byte:
+ assert(isInt<32>(Target.getConstant()));
+ switch (Modifier) {
+ default:
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ Type = ELF::R_X86_64_32S;
+ break;
+ case MCSymbolRefExpr::VK_GOT:
+ Type = ELF::R_X86_64_GOT32;
+ break;
+ case MCSymbolRefExpr::VK_GOTPCREL:
+ Type = ELF::R_X86_64_GOTPCREL;
+ break;
+ case MCSymbolRefExpr::VK_TPOFF:
+ Type = ELF::R_X86_64_TPOFF32;
+ break;
+ case MCSymbolRefExpr::VK_DTPOFF:
+ Type = ELF::R_X86_64_DTPOFF32;
+ break;
+ }
+ break;
+ case FK_Data_4:
+ Type = ELF::R_X86_64_32;
+ break;
+ case FK_Data_2: Type = ELF::R_X86_64_16; break;
+ case X86::reloc_pcrel_1byte:
+ case FK_Data_1: Type = ELF::R_X86_64_8; break;
+ }
+ }
+ } else {
+ if (IsPCRel) {
+ switch (Modifier) {
+ default:
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ Type = ELF::R_386_PC32;
+ break;
+ case MCSymbolRefExpr::VK_PLT:
+ Type = ELF::R_386_PLT32;
+ break;
+ }
+ } else {
+ switch ((unsigned)Fixup.getKind()) {
+ default: llvm_unreachable("invalid fixup kind!");
+
+ case X86::reloc_global_offset_table:
+ Type = ELF::R_386_GOTPC;
+ break;
+
+ // FIXME: Should we avoid selecting reloc_signed_4byte in 32 bit mode
+ // instead?
+ case X86::reloc_signed_4byte:
+ case X86::reloc_pcrel_4byte:
+ case FK_Data_4:
+ switch (Modifier) {
+ default:
+ llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ Type = ELF::R_386_32;
+ break;
+ case MCSymbolRefExpr::VK_GOT:
+ Type = ELF::R_386_GOT32;
+ break;
+ case MCSymbolRefExpr::VK_GOTOFF:
+ Type = ELF::R_386_GOTOFF;
+ break;
+ case MCSymbolRefExpr::VK_TLSGD:
+ Type = ELF::R_386_TLS_GD;
+ break;
+ case MCSymbolRefExpr::VK_TPOFF:
+ Type = ELF::R_386_TLS_LE_32;
+ break;
+ case MCSymbolRefExpr::VK_INDNTPOFF:
+ Type = ELF::R_386_TLS_IE;
+ break;
+ case MCSymbolRefExpr::VK_NTPOFF:
+ Type = ELF::R_386_TLS_LE;
+ break;
+ case MCSymbolRefExpr::VK_GOTNTPOFF:
+ Type = ELF::R_386_TLS_GOTIE;
+ break;
+ case MCSymbolRefExpr::VK_TLSLDM:
+ Type = ELF::R_386_TLS_LDM;
+ break;
+ case MCSymbolRefExpr::VK_DTPOFF:
+ Type = ELF::R_386_TLS_LDO_32;
+ break;
+ }
+ break;
+ case FK_Data_2: Type = ELF::R_386_16; break;
+ case X86::reloc_pcrel_1byte:
+ case FK_Data_1: Type = ELF::R_386_8; break;
+ }
+ }
+ }
+
+ if (RelocNeedsGOT(Modifier))
+ NeedsGOT = true;
+
+ ELFRelocationEntry ERE;
+
+ ERE.Index = Index;
+ ERE.Type = Type;
+ ERE.Symbol = Renamed;
+
+ ERE.r_offset = Layout.getFragmentOffset(Fragment) + Fixup.getOffset();
+
+ if (HasRelocationAddend)
+ ERE.r_addend = Addend;
+ else
+ ERE.r_addend = 0; // Silence compiler warning.
+
+ Relocations[Fragment->getParent()].push_back(ERE);
+}
+
+
+
+//===- ARMELFObjectWriterImpl ---------------------------------------===//
+
+ARMELFObjectWriterImpl::ARMELFObjectWriterImpl(ELFObjectWriter *_Writer, bool _Is64Bit,
+ uint16_t _EMachine, bool _HasRelAddend,
+ Triple::OSType _OSType)
+ : ELFObjectWriterImpl(_Writer, _Is64Bit, _EMachine, _HasRelAddend, _OSType)
+{}
+
+
+ARMELFObjectWriterImpl::~ARMELFObjectWriterImpl()
+{}
+
+void ARMELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
+ const MCAsmLayout &Layout,
+ const MCFragment *Fragment,
+ const MCFixup &Fixup,
+ MCValue Target,
+ uint64_t &FixedValue) {
+ assert(0 && "ARM RecordRelocation unimplemented");
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698