summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCELFStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-11-28 16:22:59 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-11-28 16:22:59 +0000
commit1679580cc94fd814f33efff5d93245769bc992c1 (patch)
tree1c1762d4de0796c6f7df62334b56a4e9ca65dd54 /llvm/lib/MC/MCELFStreamer.cpp
parentd4b3feb3f7efabac49369683d97cbac642118728 (diff)
downloadbcm5719-llvm-1679580cc94fd814f33efff5d93245769bc992c1.tar.gz
bcm5719-llvm-1679580cc94fd814f33efff5d93245769bc992c1.zip
Revert previous patch while I debug the darwin bootstrap failure.
llvm-svn: 120246
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCELFStreamer.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index 0286991c106..2e0d85a1e2d 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -189,13 +189,26 @@ void MCELFStreamer::InitSections() {
}
void MCELFStreamer::EmitLabel(MCSymbol *Symbol) {
- MCObjectStreamer::EmitLabel(Symbol);
+ assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
+
+ Symbol->setSection(*CurSection);
+
+ MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
const MCSectionELF &Section =
static_cast<const MCSectionELF&>(Symbol->getSection());
- MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
if (Section.getFlags() & MCSectionELF::SHF_TLS)
SetType(SD, ELF::STT_TLS);
+
+ // FIXME: This is wasteful, we don't necessarily need to create a data
+ // fragment. Instead, we should mark the symbol as pointing into the data
+ // fragment if it exists, otherwise we should just queue the label and set its
+ // fragment pointer when we emit the next fragment.
+ MCDataFragment *F = getOrCreateDataFragment();
+
+ assert(!SD.getFragment() && "Unexpected fragment on symbol data!");
+ SD.setFragment(F);
+ SD.setOffset(F->getContents().size());
}
void MCELFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
OpenPOWER on IntegriCloud