Questions about 1/2/4/8

From Dwarf Wiki
Jump to: navigation, search

Several kinds of FORMs have multiple sized variants and also have a LEB-based variant which could be used in place of the others.

  • DW_FORM_data1/2/4/8 -- DW_FORM_udata / DW_FORM_sdata
  • DW_FORM_block1/2/4 -- DW_FORM_block
  • DW_FORM_ref1/2/4/8 -- DW_FORM_ref_udata

DW_FORM_ref_addr must be relocatable, so it can't be an LEB. Some uses of DW_FORM_data4/8 must be relocatable, so we need to keep them or replace them with a new form like DW_FORM_sec_offset.

What is the rationale for having fixed-size variants? Why not deprecate them in favor of the LEB variants?

Perhaps some assemblers might not be able to use LEBs in all the cases where they need to?

Marking them as "don't use this, use this other thing instead" would be helpful in drawing out implementations that require the feature. I'd like to hear from them if possible, so that we can streamline future versions of dwarf.