summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-09-06 19:57:48 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-09-06 19:57:48 +0000
commitfcefa21b0832d122bf3abdf93be6648fc5d643f7 (patch)
tree24cec3d66810c4c28f9731d76139eb8333e9183f /llvm/lib/MC/MCDwarf.cpp
parentc839c2bc206d92873f2a41c5c02353514dcfa0ac (diff)
downloadbcm5719-llvm-fcefa21b0832d122bf3abdf93be6648fc5d643f7.tar.gz
bcm5719-llvm-fcefa21b0832d122bf3abdf93be6648fc5d643f7.zip
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
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp3
1 files changed, 2 insertions, 1 deletions
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.
OpenPOWER on IntegriCloud