Page MenuHomePhabricator

[libunwind] Combine dl_iterate_phdr codepaths for DWARF and EHABI

Authored by rprichard on Sep 17 2020, 9:16 PM.



dl_iterate_phdr is used to search for unwind info provided by either
PT_GNU_EH_FRAME or PT_ARM_EXIDX. Most of the code between the two is
the same, so combine them, and factor out what's different into


  • The FrameHeaderCache can now be enabled for ARM EHABI.
  • findUnwindSectionsByPhdr now finds the last PT_ARM_EXIDX rather than the first. There should only be one segment.
  • The dso_base and text_segment_length fields of UnwindInfoSections are now needed for dl_iterate_phdr when using EHABI, to hold the low and high PC values for a cache entry.

Diff Detail

Event Timeline

rprichard created this revision.Sep 17 2020, 9:16 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 17 2020, 9:16 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
rprichard requested review of this revision.Sep 17 2020, 9:16 PM
rprichard updated this revision to Diff 292702.

Apply clang-format fix.

This change enables the FrameHeaderCache for EHABI.

Harbormaster completed remote builds in B72128: Diff 292701.
danielkiss accepted this revision.Sep 21 2020, 2:15 AM

LGTM, refactor looks correct. in case of _LIBUNWIND_ARM_EHABI the director of the iteration over the phdrs changed but that is fine.

saugustine accepted this revision.Sep 21 2020, 10:56 AM

Thanks for the review. It looks like I still need someone from the libunwind group to accept it, though.

compnerd accepted this revision.Sep 22 2020, 9:33 AM
This revision is now accepted and ready to land.Sep 22 2020, 9:33 AM
This revision was landed with ongoing or failed builds.Sep 23 2020, 3:42 PM
This revision was automatically updated to reflect the committed changes.