<div dir="ltr">Yep, that's intentional. <br><br>It's useful to have the ranges for the CU in the .o file/linked executable (& I imagine it's /necessary/ for things like gdb_index) to allow quick lookup (without consulting .dwo/.dwp files) of which CU contains debug info for a certain program address.<br><br>So the CU's DW_AT_ranges is in the skeleton CU and refers to debug_rnglists in the .o/executable. All other ranges are in the DIEs in the .dwo file and refer to debug_rnglists.dwo in there.<br><br>Check this example: <a href="https://godbolt.org/z/wWkU8V">https://godbolt.org/z/wWkU8V</a> - the lexical scope for the 'if' statement is perhaps buggy (should the call to 'f2()' be within the lexical scope or not? unclear to me) but it's good for demonstrating this issue - the lexical_scope's range is in debug_rnglist.dwo, but the CU's ranges are in the debug_rnglist section.<br><br>(I guess we could optimize the .o/linked executable side of this a bit by not using rnglistx there (& using a direct relocation to the range list) - since there's exactly one range so there's no opportunity to benefit from sharing the rnglists_base relocation (because there's only one range))</div><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 29, 2019 at 3:59 AM Sourabh Singh Tomar <<a href="mailto:sourav0311@gmail.com" target="_blank">sourav0311@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello Everyone,<div><br></div><div>LLVM now support DWARFv5 rangelist section rnglists and rnglists.dwo. But while working on a typical test case, I noticed --</div><div>rnglists/rnglists.dwo both are populated in primary object and DWO object respectively, when we compile with "-gdwarf-5 -gsplit-dwarf". Is this desired behavior?</div><div><br></div><div><i>Referring Spec, Fig B.2 Split DWARF section relationships</i> -- depicts, for split case, their has to be rnglists.dwo section located in DWO object. </div><div>Not both rnglists{in primary object} and rnglists.dwo{in DWO object}.</div><div><br></div><div>This is also contrary, WRT to loclists/loclist.dwo. Here generation is fine split mode, only loclists.dwo gets populated in DWO object. And no loclists section in primary object.</div><div><br></div><div>Is this behavior desirable/part of functionality?  </div><div><div><br></div><div><div>Thank You,</div></div><div>Sourabh Singh Tomar.</div></div></div>
</blockquote></div></div>