Issue 230329.1: Tables which have a unit_length header field must be contiguous

Author: Keith Walker
Champion: Keith Walker
Date submitted: 2023-03-29
Date revised:
Date closed: 2023-11-27
Type: Clarification
Status: Accepted
DWARF Version: 6

Problem

There is no statement if tables must be contiguous or if there can be padding between the tables.

Background

Some sections have an implicit assumption that the tables in a section are contiguous so the section can be processed by serially reading the section. Sections in this category are:

.debug_info (Unit Headers, Section 7.5.1)
.debug_aranges (Address Lookup Tables, Section 6.1.2)
.debug_names (Name Index Section Header, Section 6.1.1)
.debug_frame (Section 6.4.1)

All other tables may be accessed indirectly via an offset into a section, so in theory there is no need to ensure the tables are contiguous, provided the tables are only accessed via these offsets.

However there are use cases when this can be a problem:

Sections with tables which have headers with a unit_length field:

.debug_aranges (Section 6.1.2)
.debug_addr (Section 7.27)
.debug_info / .debug_info.dwo (Section 7.5.1)
.debug_line / .debug_line.dwo  (Section 6.2.4)
.debug_loclists / .debug_loclists.dwo (Section 7.29)
.debug_names (Section 6.1.1)
.debug_rnglists / .debug_rnglists.dwo (Section 7.28)
.debug_str_offsets / .debug_str_offsets.dwo (Section 7.26)

Sections with tables/contributions without headers:

.debug_abbrev / .debug_abbrev.dwo (Section 7.5.3)
.debug_frame (Section 6.4.1)
.debug_line_str
.debug_macro / .debug_macro.dwo (Section 6.3.1)
.debug_str / .debug_str.dwo

It is a point for discussion on whether to only require the tables with a unit_length header field be contiguous, or should all tables be made contiguous.

Proposed Addition

7.34 Contiguous Tables

Tables which start with a unit_length field must be contiguous with the preceding table in the section or start of the section if there is no preceding table.

Alternative Proposed Addition

7.34 Contiguous Tables

Tables must be contiguous with the preceding table in the section or start of the section if there is no preceding table.


2023-11-27: Accepted with the alternative wording given.