<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/142412>142412</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
riscv hwasan: tagged globals use GOT even in non-pic mode
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
shuffle2
</td>
</tr>
</table>
<pre>
https://github.com/michaelmaitland/llvm-project/blob/df284ab221affb66799c9889f697efcf4625aab2/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp#L1111
Generates `auipc %got_pcrel_hi(sym)`, which will introduce dependency on GOT being used and present in final binary, even if it otherwise would not be required.
It seems like the same behavior could be achieved (albeit with possible size increase) via literal pools located closer to pc. Is there some reason it isn't done that way already?
In any case, it would be very nice to not have this GOT dependency e.g. for existing code which is non-pic and doesn't already use GOT.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8k0-PrDYQxD-N59J6CHqAgQOHzUazWilSpOxTrk9tu4FOjE1sM2Ty6SMms_lzyQkhq6t_VXZRSjJ55kE136nm-xNteQ5xSPM2jo7xpIO9D3POa1LnF4VXhddJ8rzpwoRF4XURMxO7hSQ78lbh1bnb8mWN4Rc2WeFVu6AVXu2IXU0asaJx1G176XvTd10_tv2FRzPWLTZEGp8Cx0eOua8UJz50fnr_eP1Z4fXt_YPd5_-7TzluJkvwH-zY5BALs64Kzz9UVVWp8kWVL2_sOVLmBKotaZPVgMJmCvnbaiK7b7Mo7NJ9UdirtlT4CvssZoZdnAPxOQa7GQbLK3vL3twheHj78StoFj_BltgCeQtr5MQ-g3gYxZMDLZ7i_RDkG3uQESRDyDPHXRLDHjZnwYcMmiHyb5tEtsVfzO8ZEvOSwMmvDHlmSLQwaJ7pJiGCecxqBjKz8I0tKOzIaZYMu-QZ1pCSaMeQ5A8G8SYyJVbYw00InGSO5GANwSVwwVBmC8aFxBFygNUU8J6OvZEhheXgoxT8YUCSV3jJYIM_yCjDTncgF5nsXZ2vTwMeyN_BPJa-HnP7J_KN4x28GD42HfZnuh1Kkh6p_itnLqYCxhCBf5eUj7BNsPy8Hkngg_-yinmkbwM_wZ4ox8UcgsXJDmfbn3s68VBd6q67dGXfnuahMxaruqmpI41l2ZaEvb6MLXXI7fncn2TAEpuyLbFqsKvaom0ueG6aWhvdUG2NqkteSFxxvNkixOkkKW08VDXWFZ4caXbpUS1Ezzs8ThXi0bQ4PJqitympunSScvpHJkt2PERJ5gbzTom8Or9ApmliC5MLmlz6NPh8Xf7vOJZg-bRF93-9_SzZf8v64EsKr08DtwH_DAAA__8wIGBu">