000410.4 B N D. Weatherford Representation Size of pointers into .debug_* sections

This proposal concerns the size of pointers into .debug_loc etc. In
the current draft (April 5), Section 7.4, it says:

    In a 64-bit safe DWARF description, all lengths of section
    contributions and all offsets into DWARF sections are 8 bytes
    in size.

I take this to mean that any attribute which has a value that is an
offset into .debug_loc, .debug_line, .debug_str, or .debug_macinfo must
be 8 bytes if the compilation unit is "64-bit safe." That means using
DW_FORM_data8 for loc, line, and macinfo, but what about str? The
document defines DW_FORM_strp as

    a 4-byte offset into a string table contained in the
    .debug_str section of the object file

PROPOSAL

Modify all occurrences of the phrase "4-byte offset" which appear in
Section 7.5.4 to read "4- or 8-byte offset" and add the following
paragraph (in italics) after the first paragraph of Section 7.5.4:

    <i> The value of any attribute which contains the offset of
    data within any DWARF section will be 8 bytes in size if it
    appears within a compilation unit which is "64-bit safe"
    (see Section 7.4), otherwise it will be 4 bytes.<i>


DISCUSSION

This makes the interpretation of one (or four, if my proposal (2)
passes) more FORM(s) dependent upon the "64-bit safety" of the current
CU. They become like DW_FORM_addr, the only FORM with a variable size
(currently) that does not encode its own size explicitly.