[PATCH] D108261: [DebugInfo] Fix end_sequence of debug_line in LTO Object
Kyungwoo Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 17 17:59:41 PDT 2021
kyulee created this revision.
Herald added subscribers: ormris, steven_wu, hiraditya, inglorion.
Herald added a reviewer: JDevlieghere.
kyulee requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
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 bookkeep the end label of function range for each CU's line table. If the end label can be resolved fully then use it to encode `end_sequence` address or fall back to use the section end label same as before.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D108261
Files:
llvm/include/llvm/MC/MCDwarf.h
llvm/include/llvm/MC/MCObjectStreamer.h
llvm/include/llvm/MC/MCStreamer.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/lib/MC/MCAsmStreamer.cpp
llvm/lib/MC/MCDwarf.cpp
llvm/lib/MC/MCObjectStreamer.cpp
llvm/test/DebugInfo/Inputs/lto-debugline-foo.ll
llvm/test/DebugInfo/lto-debugline-main.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108261.367079.patch
Type: text/x-patch
Size: 15144 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210818/81e344e2/attachment.bin>
More information about the llvm-commits
mailing list