DW FORM sec offset

From Dwarf Wiki
Jump to: navigation, search

We should add a new form called DW_FORM_sec_offset which is used to record offsets into an elf section. In a non-ELF implementation it can be an offset into any other sub-component of an executable or library. It should be sized according to dwarf 32/64 in the same way DW_FORM_strp is sized. (4 bytes for 32-bit dwarf. 8 bytes of 64-bit dwarf) It's essentially a more general form of DW_FORM_strp that can be used to replace those uses of DW_FORM_data4/8 which record section offsets.

The dwarf standard has the abstract notion of "classes" which are used to group forms together. The classes serve as an organizational aid in specifying which attributes can use which FORMs.

If we create DW_FORM_sec_offset, we should also reword the class names "lineptr" to be "section offset (lineptr)". Or possibly "section offset (.debug_line)". This will make the list of classes in 7.5.4 (and in Figure 3) a little more compact and easier to understand.

But 7.5.4 also says a few words about each class that explain exactly where it points inside the relevant section. So maybe that specificity is useful....