From fcefa21b0832d122bf3abdf93be6648fc5d643f7 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 6 Sep 2014 19:57:48 +0000 Subject: MC: correct DWARF line info for PE/COFF DWARF address ranges contain a reference to the debug_info section. This offset is an absolute relocation except on non-PE/COFF targets where it is section relative. We would emit this incorrectly, and trying to map the debug info from the address would fail. llvm-svn: 217317 --- llvm/lib/MC/MCDwarf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/MC/MCDwarf.cpp') diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index 5bc0e43f59d..95cfe24eaae 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -613,7 +613,8 @@ static void EmitGenDwarfAranges(MCStreamer *MCOS, // The 4 byte offset to the compile unit in the .debug_info from the start // of the .debug_info. if (InfoSectionSymbol) - MCOS->EmitSymbolValue(InfoSectionSymbol, 4); + MCOS->EmitSymbolValue(InfoSectionSymbol, 4, + asmInfo->needsDwarfSectionOffsetDirective()); else MCOS->EmitIntValue(0, 4); // The 1 byte size of an address. -- cgit v1.2.3