diff options
author | Ryan Prichard <rprichard@google.com> | 2018-10-29 16:31:51 -0700 |
---|---|---|
committer | Ryan Prichard <rprichard@google.com> | 2018-10-30 12:30:21 -0700 |
commit | 25c34e0feba2d0c49971016117a5af4fb8d32c1e (patch) | |
tree | 46b26664f7fd968f0009981b5f25878239227d41 /libc | |
parent | f284a475441f612a0b48067a8bc7a59c72c4b47a (diff) | |
download | bionic-25c34e0feba2d0c49971016117a5af4fb8d32c1e.tar.gz |
Reverse two pthread_internal_t fields
The golang runtime currently expects to find the pthread key data after
the tls slots.
Bug: http://b/78026329
Bug: http://b/118381796
Test: run a golang-based app, bionic unit tests
Change-Id: Idc777d809b803093e1c81d9a2ce4eafcc7d61f8d
Merged-In: Idc777d809b803093e1c81d9a2ce4eafcc7d61f8d
(cherry picked from commit a2c30723dac6b570247ac1bc7190850616f4db93)
Diffstat (limited to 'libc')
-rw-r--r-- | libc/bionic/pthread_internal.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h index 9d55ebaba..bd706d7cd 100644 --- a/libc/bionic/pthread_internal.h +++ b/libc/bionic/pthread_internal.h @@ -144,11 +144,12 @@ class pthread_internal_t { bionic_tls* bionic_tls; - pthread_key_data_t key_data[BIONIC_PTHREAD_KEY_COUNT]; - // The thread pointer (__get_tls()) points at this field. This field must come last so that // an executable's TLS segment can be allocated at a fixed offset after the thread pointer. void* tls[BIONIC_TLS_SLOTS]; + + // The golang runtime currently expects this field to come after the slots. + pthread_key_data_t key_data[BIONIC_PTHREAD_KEY_COUNT]; }; __LIBC_HIDDEN__ int __init_thread(pthread_internal_t* thread); |