Skip to content

Commit 1ce910e

Browse files
committed
android-changes-for-ndk-developers.md: mention ELF TLS.
I can't explain why this wasn't here already. Change-Id: Idcf3c8fb92478d3e6127df70377bfa36f4961a97
1 parent 1009c5d commit 1ce910e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

android-changes-for-ndk-developers.md

+12
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,18 @@ are possible workarounds.
445445
| No `dlclose` | Works | Works | Works |
446446

447447

448+
## ELF TLS (Available for API level >= 29)
449+
450+
Android supports [ELF TLS](docs/elf-tls.md) starting at API level 29. Since
451+
NDK r26, clang will automatically enable ELF TLS for `minSdkVersion 29` or
452+
higher. Otherwise, the existing emutls implementation (which uses
453+
`pthread_key_create()` behind the scenes) will continue to be used. This
454+
means that convenient C/C++ thread-local syntax is available at any API level;
455+
at worst it will perform similarly to "roll your own" thread locals using
456+
`pthread_key_create()` but at best you'll get the performance benefit of
457+
ELF TLS, and the NDK will take care of the details.
458+
459+
448460
## Use of IFUNC in libc (True for all API levels on devices running Android 10)
449461

450462
On devices running API level 29, libc uses

0 commit comments

Comments
 (0)