diff options
author | Dan Albert <danalbert@google.com> | 2017-11-01 21:26:06 +0000 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2017-11-01 21:26:06 +0000 |
commit | 9288938561af7cb9ad18df553728ee01d31d2e37 (patch) | |
tree | 8866833ebb9174119e93059fdfa6a2893ee630d9 | |
parent | 5a4e27dfa6f346a8d1e5c4e834b4877a37c57b58 (diff) | |
download | bcm5719-llvm-9288938561af7cb9ad18df553728ee01d31d2e37.tar.gz bcm5719-llvm-9288938561af7cb9ad18df553728ee01d31d2e37.zip |
[libunwind] Don't use dl_iterate_phdr if __ANDROID_API__ < 21
Summary:
On ARM, dl_iterate_phdr is only implemented in the Android NDK version 21 or later:
https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/link.h#55
Reviewers: thakis, danalbert
Reviewed By: danalbert
Subscribers: dtzWill, aemerson, srhines, kristof.beyls
Differential Revision: https://reviews.llvm.org/D39468
llvm-svn: 317125
-rw-r--r-- | libunwind/src/AddressSpace.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libunwind/src/AddressSpace.hpp b/libunwind/src/AddressSpace.hpp index f7cb767d90c..32428400526 100644 --- a/libunwind/src/AddressSpace.hpp +++ b/libunwind/src/AddressSpace.hpp @@ -393,6 +393,14 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr, } } return false; +#elif defined(_LIBUNWIND_ARM_EHABI) && defined(__BIONIC__) && \ + (__ANDROID_API__ < 21) + int length = 0; + info.arm_section = + (uintptr_t)dl_unwind_find_exidx((_Unwind_Ptr)targetAddr, &length); + info.arm_section_length = (uintptr_t)length; + if (info.arm_section && info.arm_section_length) + return true; #elif defined(_LIBUNWIND_ARM_EHABI) || defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) struct dl_iterate_cb_data { LocalAddressSpace *addressSpace; |