HomePhabricator

[dsymutil] Add preliminary support for DWARF 5.

Authored by JDevlieghere on Jan 12 2021, 9:55 PM.

Description

[dsymutil] Add preliminary support for DWARF 5.

Currently dsymutil will silently fail when processing binaries with
Dwarf 5 debug info. This patch adds rudimentary support for Dwarf 5 in
dsymutil.

  • Recognize relocations in the debug_addr section.
  • Recognize (a subset of) Dwarf 5 form values.
  • Emits valid Dwarf 5 compile unit header chains.

To simplify things (and avoid having to emit indexed sections) I decided
to emit the relocated addresses directly in the debug info section.

  • DW_FORM_strx gets relocated and rewritten to DW_FORM_strp
  • DW_FORM_addrx gets relocated and rewritten to DW_FORM_addr

Obviously there's a lot of work left, but this should be a step in the
right direction.

rdar://62345491

Differential revision: https://reviews.llvm.org/D94323

Details

Committed
JDevlieghereJan 12 2021, 9:55 PM
Differential Revision
D94323: [dsymutil] Add preliminary support for DWARF 5.
Parents
rG8a20e2b3d3e1: [llvm] Use Optional::getValueOr (NFC)
Branches
Unknown
Tags
Unknown