File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 2626
2727TSRMLS_CACHE_EXTERN ();
2828
29+ struct TLSDescriptor {
30+ void * (* thunk )(struct TLSDescriptor * );
31+ uintptr_t key ;
32+ uintptr_t offset ;
33+ };
34+
2935zend_result zend_jit_resolve_tsrm_ls_cache_offsets (
3036 size_t * tcb_offset ,
3137 size_t * module_index ,
@@ -37,17 +43,22 @@ zend_result zend_jit_resolve_tsrm_ls_cache_offsets(
3743 }
3844
3945#if defined(__x86_64__ )
40- size_t * ti ;
46+ const struct TLSDescriptor * desc ;
4147 __asm__ __volatile__(
42- "leaq __tsrm_ls_cache(%%rip),%0"
43- : "=r" (ti ));
44- * module_offset = ti [2 ];
45- * module_index = ti [1 ] * 8 ;
48+ "leaq __tsrm_ls_cache@TLVP(%%rip), %0\n"
49+ "movq (%0), %0"
50+ : "=&r" (desc )
51+ :
52+ : "memory"
53+ );
4654
47- return SUCCESS ;
48- #endif
55+ * module_index = ( size_t ) desc -> key ;
56+ * module_offset = ( size_t ) desc -> offset ;
4957
58+ return SUCCESS ;
59+ #else
5060 return FAILURE ;
61+ #endif
5162}
5263
5364/* Used for testing */
You can’t perform that action at this time.
0 commit comments