<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/121286>121286</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
unexpected link behavior
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
FFreestanding
</td>
</tr>
</table>
<pre>
Hi, I meet a unexpected link behavior.
I have four bitcode files: a.bc, b.bc, c.bc, d.bc.
All of them had defined three structures which are listed below.
```
%struct.atomic_t = type { i32 }
%struct.kuid_t = type { i32 }
%struct.inode = type { i16, i16, %struct.kuid_t, /*...*/ }
```
Then, using llvm-link to link them
```
llvm-link a.bc b.bc c.bc d.bc -S -o out.ll
```
```
%struct.inode = type { i16, i16, %struct.atomic_t, /*...*/ }
```
`%struct.kuid_t` (and other structures which is defined as `type { i32 }`) was replaced by `%struct.atomic_t` in `%struct.inode` (or other some structures)
The incident may be caused by LTO.
I wonder how to prevent this from happening.
Thanks for your help.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVF2P4joM_TXpi0UVTCnw0Afmjqo70pXuw877Kk1ckp00qZIUln-_SmE-YHalWQlhqXGOj49PLGI0B0fUsPUDWz8WYkrah6ZtA1FMwinjDkXn1bn51zD8B55gIEogYHL0cySZSIE17gU60uJofCgZ3zO-fwItjgS9nwJ0JkmvCHpjKbLVHkTZyQzWXaO8RlV2Mt_fWwu-h6RpAC0UKOqNIwVJByKIKUwyTYEinLSRGkQgsCZmKh1Zf5op1Pz643uG68udUiQ_GPk9AVs9QjqPBGzzAGaFwDaPN5kvk1FfyTMud3abtqxzM9dwD3n51jLcl2XJcM-wfQX9QPlZk8uZUzTuANYeh8WscvIXtbM0d1fek7K8s7azsLOqsPgGCw9-SqW19_L8Vqq_aOxV1a-1lv_vNak5MNwKp8AnTeHziE18M4GIwGr-aSgZdQcnESHQaIXMZjjDTbE3njUH427P5navPHx4peGHj3ZjuLuMBoyTRpFLMIgzdARSTPFS8L_n_8vZ_ifvFAXQ_pSHNgY65vykTYQ--OzrcSRn3KGcMYV7idD7AOf8YjTZsSxUs1K71U4U1Cw3q3VVI6-qQjco11RXChXtOCHxXkkkvhIC-265EZvCNMixWiLu-LbaYFXSVql6uVayWm95xwWrOA3C2DKbpvThUJgYJ2qWuMRtXVjRkY3zSkB0dIL5lCHmDRGa2WnddIis4vndxXeYZJKl5k-7oZiCbXRKY94Cs1Pag0l66krpB4ZthrmGxRj8D5KJYTsXjwzbK7tjg78CAAD__9cfdYE">