[PATCH] D52444: [DWARF] Make llvm-dwarfdump display the .debug_loc.dwo section (fixes PR38991)

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 3 10:38:09 PDT 2018


dblaikie added a comment.

In https://reviews.llvm.org/D52444#1253929, @probinson wrote:

> In https://reviews.llvm.org/D52444#1253212, @dblaikie wrote:
>
> > (also, I did go back and read the spec - and you're right that call_ref uses an address-width-sized value, and that it could be used in debug_loclists.dwo.
>
>
> Where do you see that? In DWARF 5, section 2.5.1.5, item 4 (p.36) it says call_ref is a reference not an address; its size depends on format (32/64) not target address size.


sorry, yes, I meant format

> 
> 
>> Appendix B of DWARF5 even states specifically (in (fo)) that DW_OP_call_ref can be used to reference from somewhere in debug_info.dwo to somewhere else in debug_info.dwo - though interestingly it doesn't mention any chance of referencing debug_info.dwo from debug_loc.dwo - so maybe it isn't valid in debug_loclists.dwo (or debug_loc.dwo)?
>> 
>> And honestly I'm not sure it makes sense to use it in debug_info.dwo either - because DWP tools are meant to work without relocations - and this form would require a relocation)
> 
> This is probably a spec bug; DW_OP_call_ref (and DW_FORM_ref_addr) shouldn't be allowed in a .dwo section.  I see call_ref is already prohibited in type units, and .dwo sections should follow the same reasoning, I think.  I'll file this as a DWARF issue.

SGTM - thanks!


https://reviews.llvm.org/D52444





More information about the llvm-commits mailing list