https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99490

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 50348
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50348&action=edit
gcc11-pr99490-wip.patch

Incomplete patch I've been playing with.  It clearly isn't enough though.
If I add void foo () {} void bar () {} to your testcase and compile with
clang -gdwarf-5 -gsplit-dwarf -O2 -ffunction-sections, I see it emits both
.debug_rnglists and .debug_rnglists.dwo, the former contains only the single
range list that the DW_TAG_skeleton_unit needs (and uses DW_AT_ranges and
DW_AT_rnglists_base in it), while the latter contains what the DW_AT_ranges in
.debug_info.dwo DIEs need (and doesn't contain DW_AT_rnglists_base).

The question is if it has to be that way.  Can't e.g. the DW_AT_ranges
attribute
for the CU not be present on the DW_TAG_skeleton_unit in .debug_info, but
instead on the DW_TAG_compile_unit DIE in .debug_info.dwo?  In that case we
wouldn't need the .debug_rnglists section, nor DW_AT_rnglists_base attribute.

Reply via email to