Previously, Bionic's dl_phdr_info only included the first four
dl_iterate_phdr fields. Several other libc's have these additional fields:
unsigned long long dlpi_adds -- incremented when a library is loaded
unsigned long long dlpi_subs -- incremented when a library is unloaded
size_t dlpi_tls_modid -- TLS module ID
void* dlpi_tls_data -- pointer to current thread's TLS block or NULL
These extra fields are also exposed by glibc, musl, and FreeBSD. The
unwinder in libgcc.a, linked into shipping Android DSOs, has a
PC->eh_frame cache that activates if dl_phdr_info has the dlpi_adds and
dlpi_subs fields (indicated at run-time by a sufficiently-large size
argument to the callback).
Bug: https://github.com/android-ndk/ndk/issues/1062
Test: bionic unit tests
Change-Id: I6f0bab548cf8c828af2ddab9eb01c5c6d70cd81f
Match it against the dl_iterate_phdr list. It should have the same entries,
but they could be in a different order.
Test that the dl_iterate_phdr callback always provides at least a PT_LOAD
segment.
Verify that the executable comes first in the _r_debug list.
Test: bionic-unit-tests
Bug: http://b/110967431
Change-Id: I9b6ec77d1205c4c45848adf65456bb7b3da4a3a1
The dl_iterate_phdr test is new, but the exidx test is largely copy & paste
from ndk_translation.
Bug: http://b/31556066
Test: ran tests
Change-Id: If754f1459ef1d789ee98a89cd2215188edca51da