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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151655 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2012-02-28 21:13:05 +00:00
parent 3c2e5f2140
commit 489d679271
5 changed files with 106 additions and 12 deletions

View File

@@ -266,12 +266,13 @@ void MCObjectStreamer::EmitGPRel32Value(const MCExpr *Value) {
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();
}