000410.1 | B | X | D. Weatherford | Editorial | FORM_ref_addr |
I now believe that FORM_ref_addr should *always* point to a DIE,
and
the intended encoding for location lists was class "constant". The
value is relocatable and relative to the beginning of the .debug_loc
section. Most likely, FORM_data4 (or data8) would be used for
location lists.
In order to clear up the (evident!) confusion surrounding the proper
encoding of loclists, etc., I propose to make the following changes
(all editorial, no substantive differences):
1. In the discussion of location lists (2.5.3 in Draft 1), add to the
end of the first paragraph, after the sentence, "A location list is
indicated by a location attribute whose value is represented as a
constant offset from the beginning of the .debug_loc section to the
first byte of the list for the object in question.":
This offset is relocatable in a relocatable object file and
relocated in an executable or shared object.
2. Similarly, in the discussion of DW_AT_stmt_list, (3.1, number 5),
add just before the last sentence of the second paragraph,
This offset is relocatable in a relocatable object file and
relocated in an executable or shared object.
3. Same section, number 6 (DW_AT_macro_info), second paragraph, add
This offset is relocatable in a relocatable object file and
relocated in an executable or shared object.
4. In section 7.5.4, Attribute Encodings, add the following paragraphs
after the existing paragraph describing class "constant":
Constants are also used to represent offsets into the .debug_loc
section. Any attribute that takes a DWARF expression as its
value may have either a block or a constant form. The former
indicates a single DWARF expression; the latter a location
list (see Section 2.5.3). DW_AT_data_member_location is an
exception; see Section 5.5.4.
Attributes that reference .debug_line or .debug_macinfo also
have a constant form.
5. In Figure 17, Attribute encodings, modify the "Classes" entry of
the following attributes as shown:
DW_AT_data_member_location block, constant
DW_AT_vtable_elem_location block, constant
Withdrawn by proposer in favor of 000410.3.