DWARF Standard


210113.1 Paul Robinson Zero-length entries in .debug_aranges Improvement Open Tom Russell

Section 6.1.2, pg 148

The .debug_aranges section provides information about the address ranges
associated with a particular compilation unit.  Given that compilers
produce the initial set of tuples for those ranges, and linkers are wont
to strip out unused portions, there could be tuples whose entire content
is omitted from the linked executable.  Simplistic patching of these
tuples will leave them in place, but with a zero length.  However,
section 6.1.2 specifically states that a tuple has a "non-zero length."
I propose removing that requirement.

Textual changes:

Section 6.1.2, p.148
- Line 13: Replace "non-zero" with "(possibly zero)".
- After the non-normative paragraph starting on line 19, add the following:

  A producer should not normally generate tuples with a zero length;
  however, post-processing to remove unused portions of an object could
  remove everything described by a given tuple, and the post-processor
  may update the length to zero. Note that in such a case, the address
  field must not also be set to zero, to avoid making the tuple look like
  a terminating entry.

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