summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/MC/MCDwarf.cpp8
-rw-r--r--llvm/test/DebugInfo/X86/dbg-asm.s2
2 files changed, 6 insertions, 4 deletions
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
diff --git a/llvm/test/DebugInfo/X86/dbg-asm.s b/llvm/test/DebugInfo/X86/dbg-asm.s
index 66a0292461d..de4e8e4a97b 100644
--- a/llvm/test/DebugInfo/X86/dbg-asm.s
+++ b/llvm/test/DebugInfo/X86/dbg-asm.s
@@ -12,11 +12,13 @@ _a:
# CHECK-COFF: Relocations [
# CHECK-COFF: Section {{.*}} .debug_info {
# CHECK-COFF: 0x6 IMAGE_REL_I386_SECREL .debug_abbrev
+# CHECK-COFF: 0xC IMAGE_REL_I386_SECREL .debug_line
# CHECK-COFF: }
# CHECK-COFF: ]
# CHECK-ELF: Relocations [
# CHECK-ELF: Section {{.*}} .rel.debug_info {
# CHECK-ELF: 0x6 R_386_32 .debug_abbrev
+# CHECK-ELF: 0xC R_386_32 .debug_line
# CHECK-ELF: }
# CHECK-ELF: ]
OpenPOWER on IntegriCloud