<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/155215>155215</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lld doesn't support TLSDESC (-mtls-dialect=gnu2) for arm
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
thesamesam
</td>
</tr>
</table>
<pre>
lld does not support TLSDESC (-mtls-dialect=gnu2) for arm. We are currently looking to make `-mtls-dialect=gnu2` the default for x86 in GCC. ARM may follow depending on how that goes.
```c
extern __thread int tlsdesc;
int get(void) { return tlsdesc; }
```
```
$ gcc a.c -shared -fuse-ld=lld -mtls-dialect=gnu2 -fPIC
ld.lld: error: /tmp/ccvULiJP.o:(function get: .text+0xc): unknown relocation (91) against symbol tlsdesc
ld.lld: error: internal linker error: cannot read addend for relocation R_ARM_TLS_CALL
ld.lld: error: /tmp/ccvULiJP.o:(function get: .text+0x24): unknown relocation (90) against symbol tlsdesc
ld.lld: error: internal linker error: cannot read addend for relocation R_ARM_TLS_GOTDESC
collect2: error: ld returned 1 exit status
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzEVE9v6zYM_zTyhYghy5FjH3xwk-VhQx720HbYMVAkxtYqS4FEt-m3H5R1r91Q7DAMGCDDgkz__pAUVUp29Ig9k3dM7gq10BRiTxMmNeenOAXz2jtnwARM4ANBWi6XEAkeDw-7Hx62wES7msmllbHKoSZW70a_CCY6OIcIKs4l_IqgIoJeYkRP7hVcCE_Wj0ABZvWEwBr-KUjDgSYEg2e1OLoBXtsGrIcv220Jw_1XmNUrnINz4QUMXtCbjBs8TOEFaFIEY8BUMj7k1fA_lmZ8wCth9HA80hRRGbCegFwymDSr7xgf8sGIxET7HKzJhtjmDiLSEv2HSGCb3Ufsv1HlvVjDqDWoUsMqTSqigdV5SbhyhtW7nN7P3MPq_O3HLeODM6XLkQNgjCHmDRN7mi9M7LV-_uVgf_pWBlYPTLTnxWuywd-U1wOUhFdi4o5fNRNdPln8kw8vHiK6oNUtlom2q7JBNSrrE0F6nU_BfTf5qQTrc_6UA2f9E8b3D1r53Ci3pCpj0Jtb4T7w3R-H-6_Hx8PDcTscDv-ZQ7H-Z4v8f7H45efHfFEYH3RwubziLxzOvLUUGqgAr5YgkaIlfWyiwvS16epOFdhXG9lUXPK2K6bedJ2sZaXadbPmm-YshUA0vBJSn1Rdq8L2ggvJWyF5I1velUo2EjemU7wzvOvWbM1xVtaVzj3PZYhjYVNasK-kFJUsnDqhS38OiNjnqNVpGRNbc2cTpff_yJLD78PCM7H5N9OiWKLrJ6JLupV7z8R-tDQtp1KHmYl9pnt7rS4x_JZBxP6mOTGxf5P93IvfAwAA__--5o7-">