From 7d0ba3464eac2ba7965ce6501ff7ad1a75de2771 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 14 Nov 2010 04:17:37 +0000 Subject: 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 --- llvm/lib/MC/MCELFStreamer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'llvm/lib/MC/MCELFStreamer.cpp') 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(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); -- cgit v1.2.3