Merge "Reserve TLS slot for native bridge" into main am: 0144257234 am: 907d4dcae4

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2824791

Change-Id: Ie0925e3edb4f48ee23cd122a482ba251e02137db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-12-13 16:59:52 +00:00 committed by Automerger Merge Worker
commit 83b9c92266

View file

@ -68,6 +68,11 @@
//
// - TLS_SLOT_APP: Available for use by apps in Android Q and later. (This slot
// was used for errno in P and earlier.)
//
// - TLS_SLOT_NATIVE_BRIDGE_GUEST_STATE: Pointer to the guest state for native
// bridge implementations. It is (to be) used by debuggerd to access this
// state for guest aware crash reporting of the binary translated code.
// (Introduced in V)
#if defined(__arm__) || defined(__aarch64__)
@ -80,7 +85,8 @@
// [1] "Addenda to, and Errata in, the ABI for the ARM Architecture". Section 3.
// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0045e/IHI0045E_ABI_addenda.pdf
#define MIN_TLS_SLOT (-1) // update this value when reserving a slot
#define MIN_TLS_SLOT (-2) // update this value when reserving a slot
#define TLS_SLOT_NATIVE_BRIDGE_GUEST_STATE (-2)
#define TLS_SLOT_BIONIC_TLS (-1)
#define TLS_SLOT_DTV 0
#define TLS_SLOT_THREAD_ID 1
@ -112,7 +118,8 @@
#define TLS_SLOT_ART_THREAD_SELF 7
#define TLS_SLOT_DTV 8
#define TLS_SLOT_BIONIC_TLS 9
#define MAX_TLS_SLOT 9 // update this value when reserving a slot
#define TLS_SLOT_NATIVE_BRIDGE_GUEST_STATE 10
#define MAX_TLS_SLOT 10 // update this value when reserving a slot
#elif defined(__riscv)
@ -123,8 +130,9 @@
// [1]: RISC-V ELF Specification. Section: Thread Local Storage
// https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#thread-local-storage
#define MIN_TLS_SLOT (-9) // update this value when reserving a slot
#define MIN_TLS_SLOT (-10) // update this value when reserving a slot
#define TLS_SLOT_NATIVE_BRIDGE_GUEST_STATE (-10)
#define TLS_SLOT_BIONIC_TLS (-9)
#define TLS_SLOT_DTV (-8)
#define TLS_SLOT_THREAD_ID (-7)