We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd74a77 commit 1709391Copy full SHA for 1709391
ext/opcache/jit/tls/zend_jit_tls_darwin.c
@@ -37,12 +37,12 @@ zend_result zend_jit_resolve_tsrm_ls_cache_offsets(
37
}
38
39
#if defined(__x86_64__)
40
- size_t *ti;
41
- __asm__ __volatile__(
42
- "leaq __tsrm_ls_cache(%%rip),%0"
43
- : "=r" (ti));
44
- *module_offset = ti[2];
45
- *module_index = ti[1] * 8;
+ struct tlv_descriptor { void*(*thunk)(struct tlv_descriptor*); uintptr_t key; uintptr_t offset; };
+ struct tlv_descriptor *desc;
+ __asm__ __volatile__("leaq __tsrm_ls_cache(%%rip), %0"
+ : "=r" (desc) );
+ *module_index = desc->key * sizeof(void*); // module index in bytes (dtv offset)
+ *module_offset = desc->offset; // offset of _tsrm_ls_cache in TLS block
46
47
return SUCCESS;
48
#endif
0 commit comments