aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCELFStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-11-14 04:17:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-11-14 04:17:37 +0000
commit1f4f9e3d35a2264d86f97dfb6d1e4ccb434f449b (patch)
tree071695192ff1caf0cdfbb9d3d96a3475afa155a4 /lib/MC/MCELFStreamer.cpp
parent9f6e03fa1e05f7c59379e68d7626400ca508cfb0 (diff)
downloadexternal_llvm-1f4f9e3d35a2264d86f97dfb6d1e4ccb434f449b.zip
external_llvm-1f4f9e3d35a2264d86f97dfb6d1e4ccb434f449b.tar.gz
external_llvm-1f4f9e3d35a2264d86f97dfb6d1e4ccb434f449b.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCELFStreamer.cpp')
-rw-r--r--lib/MC/MCELFStreamer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp
index 830bd4f..1f4f146 100644
--- a/lib/MC/MCELFStreamer.cpp
+++ b/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);