DWARF Standard


HOME
SPECIFICATIONS
FAQ
ISSUES



161114.1 Paul Robinson DW_FORM_ref_sup unspecified size Error Accepted with modification Paul Robinson


Section 7.5.5, pg 216
In section 7.5.5, p.216 (public review draft), class 'reference',
fourth type is DW_FORM_ref_sup which is an offset into the supplementary file's
.debug_info section.  The description fails to specify the size of this reference.

Naively it would be 4 or 8 bytes depending on whether the containing .debug_info
section format is DWARF32 or DWARF64, like other 'reference' classes.  However,
the reference might be in a DWARF32 section while the supplementary file might
be DWARF64, which leaves part of the supplementary file inaccessible.

It seems like there are three difference ways to address this.
(a) Make DW_FORM_ref_sup 8-bytes, so it can always work regardless of format.
(b) Replace DW_FORM_ref_sup with two size-specific forms, something like
    DW_FORM_ref_sup4 and DW_FORM_ref_sup8.  This works because the supplementary
    file already exists and the producer knows what format it uses.  In fact the
    producer could use sup4 to save space even if the supplementary file is in
    DWARF64 format, if the reference value is small enough.
(c) Require that if the supplementary file is DWARF64, all referencing units must
    also be DWARF64, and then DW_FORM_ref_sup is 4 or 8 bytes depending on the
    referencing unit's format just like all other 'reference' forms.


--
12/06/2016 -- Accepted option (b): Replace DW_FORM_ref_sup with DW_FORM_ref_sup4 
and DW_FORM_ref_sup8. 


All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2007-2017 by DWARF Standards Committee.