summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2019-10-16 02:38:47 +0000
committerRyan Prichard <rprichard@google.com>2019-10-16 02:38:47 +0000
commit8200dbbcae933e79682b0f50f344befd3890c882 (patch)
treec7189d05a8388687198a53b69a5a61cf356d204a /lldb/packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py
parent5e34ad109ced8dbdea9500ee28180315b2aeba3d (diff)
downloadbcm5719-llvm-8200dbbcae933e79682b0f50f344befd3890c882.tar.gz
bcm5719-llvm-8200dbbcae933e79682b0f50f344befd3890c882.zip
[libunwind][Android] Improve workaround for PIE zero-dlpi_addr bug
Summary: The workaround added in https://reviews.llvm.org/rL299575 appears to be working around a bug in Android JB 4.1.x and 4.2.x (API 16 and 17). Starting in API 16, Android added support for PIE binaries, but the dynamic linker failed to initialize dlpi_addr to the address that the executable was loaded at. The bug was fixed in Android JB 4.3.x (API 18). Improve the true load bias calculation: * The code was assuming that the first segment would be the PT_PHDR segment. I think it's better to be explicit and search for PT_PHDR. (It will be almost as fast in practice.) * It's more correct to use p_vaddr rather than p_offset. If a PIE executable is linked with a non-zero image base (e.g. lld's -Wl,--image-base=xxxx), then we must use p_vaddr here. The "phdr->p_vaddr < image_base" condition seems unnecessary and maybe slightly wrong. If the OS were to load a binary at an address smaller than a vaddr in the binary, we would still want to do this workaround. The workaround is safe when the linker bug isn't present, because it should calculate an image_base equal to dlpi_addr. Note that with API 21 and up, this workaround should never activate for dynamically-linked objects, because non-PIE executables aren't allowed. Consolidate the fix into a single block of code that calculates the true image base, and make it clear that the fix no longer applies after API 18. See https://github.com/android/ndk/issues/505 for details. Reviewers: mclow.lists, srhines, danalbert, compnerd Reviewed By: compnerd Subscribers: srhines, krytarowski, christof, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D68971 llvm-svn: 374969
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud