From 5c70de1072b1ac25a3e318c9a2cd68f34d10959b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 5 Sep 2014 04:15:00 +0000 Subject: MC: correct DWARF header for PE/COFF assembly input The header contains an offset to the DWARF line table for the CU. The offset must be section relative for COFF and absolute for others. The non-assembly code path for the DWARF header generation already has the correct emission for the headers. This corrects the assembly input path. This was identified by BFD objecting to the LLVM generated DWARF information. llvm-svn: 217222 --- llvm/lib/MC/MCDwarf.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/MC/MCDwarf.cpp') diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index a592c094655..5bc0e43f59d 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -693,11 +693,11 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS, // DW_AT_stmt_list, a 4 byte offset from the start of the .debug_line section, // which is at the start of that section so this is zero. - if (LineSectionSymbol) { - MCOS->EmitSymbolValue(LineSectionSymbol, 4); - } else { + if (LineSectionSymbol) + MCOS->EmitSymbolValue(LineSectionSymbol, 4, + AsmInfo.needsDwarfSectionOffsetDirective()); + else MCOS->EmitIntValue(0, 4); - } if (RangesSectionSymbol) { // There are multiple sections containing code, so we must use the -- cgit v1.2.3