<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64974>64974</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
MIPSr6: try to use bal call functions which need t9 to get GOT
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wzssyqa
</td>
</tr>
</table>
<pre>
One example is
compiler-rt/lib/sanitizer_common/sanitizer_allocator_dlsym.h
```
static void *Allocate(uptr size_in_bytes) {
void *ptr = InternalAlloc(size_in_bytes, nullptr, kWordSize);
CHECK(internal_allocator()->FromPrimary(ptr));
Details::OnAllocate(ptr,
internal_allocator()->GetActuallyAllocatedSize(ptr));
return ptr;
}
```
`Allocate` call `InternalAlloc` by `bal` instead of `jar $t9`, while needs `t9` to compute its GOT.
Let's use pcrel instructions to compute GOT instead of t9 for MIPSr6.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U91u8jgQfZrJzQgUnB_IRS4olG61u6JSK-0lcpKBuOvYrD0pG57-kwNtaVV9UpTEMz7nzBx7pPfqYIhKyO4gW0ey59a68nT2fvhPRpVthnJrCOl_2R01ofIQryFeYm27o9LkJo5BbLSqQGy8NIrVmdyutl1nzZeQ1NrWkq3bNdoP3bS9EF3feXx9LuyeJasa36xqEMRyecESiEV_ZIdenWmnzK4amDyIAmF-d0UifqDCTkjW-GiYnJF6ZAGx-IZeoem1PrILv__-Y13zrM4EooDknXT1x_3qTxALdWX6bAbEAkQxgeR-42z35FQn3QBiMdIVX0jWxFJpD8kSkuXW3PR00b5u-53GA_Gy5l5qPbzDr8X-JIiIjrh3BkPyIwzz9Y-mfzuPj_ryGGupNUIef3Uyj7EaQriSOiyU8UyyQbsPwVfpEETKRRAQKzy1ShMaosaH9BhHtuNF6plQsceH7cv0toy_iEHMPfae8Fg70qOG62tW1vhb9MP25VafC9xbh38_Pj27fBo1ZdIUSSEjKmd5IYo0y-ZF1JZ5lWYil1lSUTbL0znN9hXRPptlMpGzRkaqFLFI4oXI4jwpkmIq0lks8mQRx_k8L-IG0pg6qfRU67duat0hUt73VOZpMU8jLSvSfpwtIQydcEyCEGHUXBkwk6o_eEhjrTz7TxZWrKm81A_JEtkNod1gRCX15UD2vbkacWpV3Y7ehs7Z4oE4WBL1Tpct83G8dWIDYnNQ3PbVtLZdGFv99v6ZHJ19pToM81ikB7EZm_gVAAD__-0USdc">