On ELF, create relocations to the abbreviation and line sections when producing
debug info for assembly files. We were already doing the right thing when
producing debug info for C/C++.
ELF linkers don't know dwarf, so they depend on these relocations to produce
valid dwarf output.
llvm-svn: 151655
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index f2911fa..a7eb8b0 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -266,12 +266,13 @@
void MCObjectStreamer::FinishImpl() {
// Dump out the dwarf file & directory tables and line tables.
+ const MCSymbol *LineSectionSymbol;
if (getContext().hasDwarfFiles())
- MCDwarfFileTable::Emit(this);
+ LineSectionSymbol = MCDwarfFileTable::Emit(this);
// If we are generating dwarf for assembly source files dump out the sections.
if (getContext().getGenDwarfForAssembly())
- MCGenDwarfInfo::Emit(this);
+ MCGenDwarfInfo::Emit(this, LineSectionSymbol);
getAssembler().Finish();
}