<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/72899>72899</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[BOLT] Fix handling of __builtin_unreachable() target at the end of the section
</td>
</tr>
<tr>
<th>Labels</th>
<td>
BOLT
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
maksfb
</td>
</tr>
</table>
<pre>
The original test case for #72737 had a jump to the end of `.text` as a result of `__builtin_unreachable()` call. It caused a build-time assertion:
```
void llvm::bolt::BinaryContext::processInterproceduralReferences(): Assertion `Section && "cannot get section for referenced address"' failed.
```
While handling `__builtin_unreachable()`, it is a good idea to move modification of jump instructions into a separate pass.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEUsFq5DgQ_Rr5UsTIcttuH3zopGkILCzsBvYYylLZVlaWGpUckr8f5O6QOQwzYPCzVap69d5DZjt7okE0j6I5F7ilJcRhxf95GosxmM_hZSEI0c7Wo4NEnEAjE0whglB1p7q6gwUNILxt6xVSgLQQkDcQJhCtLBN9JNFKQAaESLy5dD96fR0365L1r5uPhHrB0ZFQR6H6fEGjcyU854EbU56Qy81DsisBMlNMNnhRn4Q8C3kSrbw_--d7sAace19zQX0ag0s39Gg9xs-n4Hdi-69rDJqYn32iuGOzRXT_0ESRvCa-c6pPcPoam_n_S_oGVStUC0Ipjd6HBDMl4PthFip-dTKAxkRiFkoJ1cGE1pEpf7nAf4t1BAt646yf_6yXUE9gE9gs8xyCAWsIsx9reCdYg7GT1bhzCtPNLOs5xW3nyWB9CoDAdMWIieCKzGVhhtr0dY8FDVUnZSNbeZTFMui-7vpqRDOprqmnXjdVVeumUV3bt82oCzsoqeqqUrI6HrqmL03bmUo3hwqPciQ04iBpRevKbFIZ4lxY5o2GTh37vnA4kuM9l0o9_v3XS1asORdxyOUP4zazOEhnOfF3g2ST27O8X2jOcLEf3wqGCX6jICSM2TdMPwc4w7uTxRbdsKR05RwadRHqMtu0bGOpwyrUZc_a7fVwjeGNdBLqsu_EQl32tX4EAAD__-fGHIo">