[PATCH] D45589: [DWARF] Defer emitting type units until the compile units are done.

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 15:31:17 PDT 2018


probinson added a comment.

CUs don't come out right away...  Huh.  In my first attempt at emitting TUs to .debug_info, I just had MC reuse the .debug_info section when it was asked about .debug_types.  And I was definitely seeing intermixed headers, and otherwise unparseable sections.

I think intra-unit references are using section-relative offsets, or something, and that doesn't work well when "somebody else" is trying to stuff data into the same section.  I didn't look into it too deeply because my immediate thought was, duh, we have effectively two streams pointing to the same section, so just defer one until we know the other one is done.

I'll go back to my first attempt tomorrow and see if it might be as simple as needing to use an actual label instead of the section-symbol as the base for the offsets.  It means in DWARF 5, we'd see type units first in the .debug_info section, followed by the CU, which might break somebody's assumptions; but it's legal DWARF, so probably worth finding.


Repository:
  rL LLVM

https://reviews.llvm.org/D45589





More information about the llvm-commits mailing list