diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-14 04:17:37 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-14 04:17:37 +0000 |
commit | 7d0ba3464eac2ba7965ce6501ff7ad1a75de2771 (patch) | |
tree | e4c6e7eb5ff82929ccc1a6841971ca41a7fd177e /llvm/lib/MC/MCELFStreamer.cpp | |
parent | d477fe544ca6aee2d148a4317e104a4b8d0ed964 (diff) | |
download | bcm5719-llvm-7d0ba3464eac2ba7965ce6501ff7ad1a75de2771.tar.gz bcm5719-llvm-7d0ba3464eac2ba7965ce6501ff7ad1a75de2771.zip |
Handle a peculiar comdat case: Creating a section with an undefined
signature symbol causes a local symbol to be created unless there is
some other use of the symbol.
llvm-svn: 119026
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCELFStreamer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp index 830bd4f4ea5..1f4f1461a57 100644 --- a/llvm/lib/MC/MCELFStreamer.cpp +++ b/llvm/lib/MC/MCELFStreamer.cpp @@ -84,6 +84,7 @@ public: virtual void EmitThumbFunc(MCSymbol *Func); virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value); virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol); + virtual void SwitchSection(const MCSection *Section); virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute); virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) { assert(0 && "ELF doesn't support this directive"); @@ -282,6 +283,13 @@ public: }; } // end anonymous namespace +void MCELFStreamer::SwitchSection(const MCSection *Section) { + const MCSymbol *Grp = static_cast<const MCSectionELF *>(Section)->getGroup(); + if (Grp) + getAssembler().getOrCreateSymbolData(*Grp); + this->MCObjectStreamer::SwitchSection(Section); +} + void MCELFStreamer::EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) { getAssembler().getOrCreateSymbolData(*Symbol); MCSymbolData &AliasSD = getAssembler().getOrCreateSymbolData(*Alias); |