<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65114>65114</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
function multi-versioning: internal linkage resolvers should not use comdat
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:codegen
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
MaskRay
</td>
</tr>
</table>
<pre>
For function multi-versioning using the target and target_clones
function attributes, currently we incorrectly set comdat for internal
linkage functions. This is problematic for ELF linkers
as GRP_COMDAT deduplication will kick in even with STB_LOCAL signature
(https://groups.google.com/g/generic-abi/c/2X6mR-s2zoc
"GRP_COMDAT group with STB_LOCAL signature").
In short, two `__attribute((target_clones(...))) static void foo()`
in two translation units will be deduplicated.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0kk9v6ygUxT8N3lzFwvhP4oUXaTMejdSqo04Xs4sw3NhMCERwSdX59E920ry-J1WysUHcw-F3j4zRjA6xY_UDq3eZTDT50D3LeHyVH9ng9UfX-wCH5BQZ7-CULJnVBUM03hk3QorzSBMCyTAigXT69rtX1juMjO8Y394VJFEwQyKMTDyCSiGgI_sB7wjGKR8CqnkakUD5k5YEBx_AOMLgpL2KWeOOcsS7rZjD22QimAjn4AeLJ0lGLYV_PPUwb8dwMyIj_Pn69_7x5Xm3fQONOp2tUXLx9m6shaNRRzAO8ILzCk3wz9vD_unlcfsEMy1JKeBVi4nNRHSOrNwy0TPRj8Gnc8xH70eLufKneW1-0WEwaiUHw0SvmOjFv83pdRXF_159aokvvhah708Xgok2vxUu418O4uQDzVDp3QNr-H5_Z83EhonNr20RmzzPmWivD0RamF280XDwfqloWcOv8sYtqhSki_YKKzlD8YpswC8gUeeZ7krdlq3MsCuatqyKsq7W2dQVQjZFUbVaY6HrDYq2Epy3Uq7rasNrnZlOcFHyTcmLpmz5Oi8qXQ78MDRDxXGNnFUcT9LY3NrLKfdhzEyMCbumLooqs3JAG5c0C6GsdCMrt8prHNHN0OpdFrq5cjWkMbKKWxMp_tQiQxa7b9POyu09ifAZwoDR23nP3IBkNThPkCLe4pulYLvfUmJoSsMtHvPZt8_qHPx_qIiJfrlUZKJf7vUjAAD__xYbNnA">