Hi Jim,
The diff below is not intended to be a patch, but a starting point.
It is the shortest path (I hope) to getting LLVM to emit ARM mapping
symbols to the ELF without changing any shared interfaces. Could you
have a look at the FIXME comments and offer some pointers on how to
get this code out of MCELFStreamer?
Thanks,
Greg
diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp
index 8107005..153ca78 100644
--- a/lib/MC/MCELFStreamer.cpp
+++ b/lib/MC/MCELFStreamer.cpp
@@ -40,12 +40,14 @@ class MCELFStreamer : public MCObjectStreamer {
public:
MCELFStreamer(MCContext &Context, MCAsmBackend &TAB,
raw_ostream &OS, MCCodeEmitter *Emitter)
- : MCObjectStreamer(Context, TAB, OS, Emitter) {}
+ : MCObjectStreamer(Context, TAB, OS, Emitter),
+ IsThumb(false), MappingSymbolCounter(0) {}
MCELFStreamer(MCContext &Context, MCAsmBackend &TAB,
raw_ostream &OS, MCCodeEmitter *Emitter,
MCAssembler *Assembler)
- : MCObjectStreamer(Context, TAB, OS, Emitter, Assembler) {}
+ : MCObjectStreamer(Context, TAB, OS, Emitter, Assembler),
+ IsThumb(false), MappingSymbolCounter(0) {}
~MCELFStreamer() {}
@@ -58,6 +60,7 @@ public:
virtual void EmitLabel(MCSymbol *Symbol);
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
virtual void EmitThumbFunc(MCSymbol *Func);
+ virtual void EmitDataRegion(MCDataRegionType Kind);
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol);
virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute);
@@ -108,6 +111,7 @@ public:
private:
virtual void EmitInstToFragment(const MCInst &Inst);
virtual void EmitInstToData(const MCInst &Inst);
+ virtual void EmitMappingSymbol(bool IsData);
void fixSymbolsInTLSFixups(const MCExpr *expr);
@@ -119,6 +123,11 @@ private:
std::vector<LocalCommon> LocalCommons;
SmallPtrSet<MCSymbol *, 16> BindingExplicitlySet;