[PATCH] D60470: [DWARF] Prefer larger DW_AT_low_pc when constructing aranges

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 09:41:54 PDT 2019


MaskRay created this revision.
MaskRay added reviewers: aprantl, dblaikie, echristo, probinson.
Herald added subscribers: llvm-commits, rupprecht.
Herald added a project: LLVM.

In a --gc-sections link, a .debug_info associated with a discarded section
may not be discarded and has zero DW_AT_low_pc. If its DW_AT_high_pc is
sufficiently large, it may overlap with a good one.

llvm-symbolizer may resolve an address in the good CU to the discarded
CU. In this patch, we pick the largest DW_AT_low_pc to avoid that.

It also drops the `Aranges.back().setHighPC(E.Address);` optimization because
that is not very useful. N CUs can have at most 2*N-1 ranges.

In practice, overlapping only happens with such [0,high_pc) sections.
This optimization saves no more than M ranges where M is the number of
garbage collected CUs that overlap with a good CU.


Repository:
  rL LLVM

https://reviews.llvm.org/D60470

Files:
  include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
  lib/DebugInfo/DWARF/DWARFDebugAranges.cpp
  test/tools/llvm-symbolizer/gc-sections-zero-low-pc.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60470.194356.patch
Type: text/x-patch
Size: 7849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190409/8f71cf29/attachment.bin>


More information about the llvm-commits mailing list