[all-commits] [llvm/llvm-project] 6747d4: [DebugInfo] Fix end_sequence of debug_line in LTO ...

kyulee-com via All-commits all-commits at lists.llvm.org
Sun Nov 14 20:25:19 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6747d44bda8c460c90c2276ac6e2402d434e0780
      https://github.com/llvm/llvm-project/commit/6747d44bda8c460c90c2276ac6e2402d434e0780
  Author: Kyungwoo Lee <kyulee at fb.com>
  Date:   2021-11-14 (Sun, 14 Nov 2021)

  Changed paths:
    M llvm/include/llvm/MC/MCDwarf.h
    M llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
    M llvm/lib/MC/MCDwarf.cpp
    M llvm/test/DebugInfo/XCOFF/empty.ll
    M llvm/test/DebugInfo/XCOFF/explicit-section.ll
    M llvm/test/DebugInfo/XCOFF/function-sections.ll
    A llvm/test/DebugInfo/debugline-endsequence.ll
    A llvm/test/DebugInfo/debugline-endsequence.s

  Log Message:
  -----------
  [DebugInfo] Fix end_sequence of debug_line in LTO Object

In a LTO build, the `end_sequence` in debug_line table for each compile unit (CU) points the end of text section which merged all CUs. The `end_sequence` needs to point to the end of each CU's range. This bug often causes invalid `debug_line` table in the final `.dSYM` binary for MachO after running `dsymutil` which tries to compensate an out-of-range address of `end_sequence`.
The fix is to sync the line table termination with the range operations that are already maintained in DwarfDebug. When CU or section changes, or nodebug functions appear or module is finished, the prior pending line table is terminated using the last range label. In the MC path where no range is tracked, the old logic is conservatively used to end the line table using the section end symbol.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D108261




More information about the All-commits mailing list