[Dwarf-discuss] Tables which have a unit_length header field must be contiguous.

Keith Walker Keith.Walker@arm.com
Wed Mar 29 09:14:52 GMT 2023


# 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

- The file is "stripped" to just contain line information (.debug_line /
.debug_line_str). The .debug_line_str was added for exactly this use case.
There is now the assumption that the .debug_line section can be processed
serially.

- File dump utilities which list the contents of the sections serially.

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.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dwarfstd.org/pipermail/dwarf-discuss/attachments/20230329/7ea99c3e/attachment.htm>


More information about the Dwarf-discuss mailing list