<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55288>55288</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Incorrect offset in GetTls for x32
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hjl-tools
</td>
</tr>
</table>
<pre>
sanitizer_common/sanitizer_linux_libcdep.cpp has
```
#elif SANITIZER_GLIBC && defined(__x86_64__)
// For aarch64 and x86-64, use an O(1) approach which requires relatively
// precise ThreadDescriptorSize. g_tls_size was initialized in InitTlsSize.
asm("mov %%fs:16,%0" : "=r"(*addr));
```
Since x32 pointer size is 4 bytes, the offset should be 8, not 16.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUsFu3CAQ_Rp8Ga2FwRD74MMm241WqlqpyakXC2O8JmKNC3g36dd37DSKVFUaAY8Z3sx7ovP9WxPVZJP9bUKr_eXiJ8KOn1fOTssrrp3uzZzreYZRRUIPhO6JpH_jHTJunB3gaf_t9Hz6-eVH-_j1dP8AhEkM6M1gJ9MTVrXtayVbWbYtYfX7W8CqIwYcfQClgh5lCWrqASt3siTsAZZo8Aa-I0GB70DNc_BKj3AbLa7B_FpsMBEPTiV7Ne7tH-o5GG2R5HkMRvUHE3Wwc_LhCXXmcG6Ti23EM9xUBLvqVw5hj2c4IXx2cSv9oFXxgrMQxi7-ij0ExhAJ3xco9wEBxRQgxhwj_BDWba3fq74Pq3IMfv9fK5_spA28cgazt1MyAbbBbIQSurdk4mpIGg34YYgmQRz94nroDFRrZvIJCplnfcP7mtcqSzY505wm7QOakD6eobBHs-qCAW3HdtkSXDOmNK863m072zQuXY4_A4Fz149th-6_IBdCG-OyjnQUglVVNja8vpO0YFrUWpjqTpZclJqzoe66QlaDzpzqjIsNEfdoymRusFGsBolDZhtGGaOCikIWVPCcUi0oL2vBpazLQZKSmouyLl_nyH04Z6HZRuqWc8SkszHFz6SK0Z4nY7Z2yK-WNPrQjC9ul7x3MduaN9vwfwDWxvFQ">