Rework findUnwindSectionsByPhdr to be more optimal.
authorSterling Augustine <saugustine@google.com>
Fri, 6 Mar 2020 23:59:16 +0000 (15:59 -0800)
committerSterling Augustine <saugustine@google.com>
Tue, 10 Mar 2020 17:35:15 +0000 (10:35 -0700)
commitd67cf7a0a970df6e69db437514bf61a2ab283e67
tree52623576a303b53283640a7fa697f989f2aef6a3
parent5d3d84b5cd4bd6bfbc27e3e4133842fe65ec9593
Rework findUnwindSectionsByPhdr to be more optimal.

Summary:
- Executable segment is usually segment 3. Look there for the address first.
- GNU_EH_FRAME_HEADER segment is usually near the end. Iterate from the end.
- Exit early if both phdrs have been found.

This is the last cl before a patch to cache the information this function
finds.

Subscribers: libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D75781
libunwind/src/AddressSpace.hpp