[libcxx-commits] [PATCH] D75781: Rework findUnwindSectionsByPhdr to be more optimal.

Sterling Augustine via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 9 16:45:23 PDT 2020


saugustine marked an inline comment as done.
saugustine added inline comments.


================
Comment at: libunwind/src/AddressSpace.hpp:463-464
 
-  if (cbdata->targetAddr < pinfo->dlpi_addr)
+int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo, size_t, void *data) {
+  auto cbdata = static_cast<dl_iterate_cb_data *>(data);
+  if (pinfo->dlpi_phnum == 0)
     return 0;
 
----------------
jgorbe wrote:
> Is this early check no longer necessary/beneficial?
I think it is still needed by the reverse-iteration below, which assumes there is one or more phdrs.

This is likely always true--Would dl_iterate_phdr ever pass a phdr-less pinfo? But I don't think dl_iterate_phdr actually guarantees that, at least not in any documentation I have read.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75781/new/

https://reviews.llvm.org/D75781





More information about the libcxx-commits mailing list