This patch contains three parts of work:
- As Android doesn't support __thread, use a tls slot to store the
pointer to ThreadState for current thread. Add check for thr->is_inited
as bionic libc can call intercepted functions before ThreadStart().
Add dead_thread_state as bionic libc can call intercepted functions
after DestroyThreadState().
- Add special considerations to intercept bionic libc functions, like
removing unsupported functions.
- Add address space support for android aarch64 devices. I have tested
on N9 and N5X, but I can't guarantee it is suitable for all android
aarch64 devices.
I can't say much for the rest of the change, but the is_inited checks can easily be a separate, smaller patch, and I can pretty much guarantee that someone else would say so if I didn't :)