Add an android_unsafe_frame_pointer_chase function.

This function will be used by Scudo and GWP-ASan to efficiently collect
stack traces for frames built with frame pointers.

Bug: 135634846
Bug: 135772972
Change-Id: Ic63efdbafe11dfbb1226b5b4b403d53c4dbf28f3
Merged-In: Ic63efdbafe11dfbb1226b5b4b403d53c4dbf28f3
diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h
index 22b0558..ab8b955 100644
--- a/libc/bionic/pthread_internal.h
+++ b/libc/bionic/pthread_internal.h
@@ -125,6 +125,10 @@
   //    code to handle retries.
   void* shadow_call_stack_guard_region;
 
+  // A pointer to the top of the stack. This lets android_unsafe_frame_pointer_chase determine the
+  // top of the stack quickly, which would otherwise require special logic for the main thread.
+  uintptr_t stack_top;
+
   Lock startup_handshake_lock;
 
   void* mmap_base;