[PATCH] D70350: [DWARF] Allow cross-CU references of subprogram definitions

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 11:21:46 PST 2019


dblaikie added a comment.

In D70350#1765463 <https://reviews.llvm.org/D70350#1765463>, @vsk wrote:

> In D70350#1757600 <https://reviews.llvm.org/D70350#1757600>, @dblaikie wrote:
>
> > In D70350#1757579 <https://reviews.llvm.org/D70350#1757579>, @vsk wrote:
> >
> > > This breaks the dwarf produced in an LTO build of xnu. With the patch applied I start seeing a lot of verification failures, mostly about the ranges in a DIE lying outside of the parent DIE's ranges.
> >
> >
> > Given what's happening here, I would suspect the verification might be incorrect rather than the DWARF. Could you provide a small (or any sized, really) example of the DWARF that's being flagged as invalid?
>
>
> Apologies for the rushed update. Fred and I took a look and believe that the DWARF forms used for cross-CU references are not right, e.g.:
>
>   error: DW_FORM_ref4 CU offset 0x00006ecb is invalid (must be less than CU size of 0x00003c30):
>  
>   0x00001ebf: DW_TAG_inlined_subroutine
>                 DW_AT_abstract_origin     (0x00006ecb) // Should be DW_FORM_ref_addr.


Yep, cross-CU references should use FORM_ref_addr ( https://godbolt.org/z/zQZcyf shows these in use in cross-CU inlining). I'm surprised that there would be a bug here in this case - the code that deals with this seems pretty generic: https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/AsmPrinter/DwarfUnit.cpp#L391


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70350/new/

https://reviews.llvm.org/D70350





More information about the llvm-commits mailing list