<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/109558>109558</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
How to use llvm-link appropriately?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
HoshinoStranding
</td>
</tr>
</table>
<pre>
I have encountered some problems when using the command `llvm-link` under llvm-15.
There are two bitcode files from the same project: file1.bc and file2.bc, and they don't have any multiple definiton. When I try to use llvm-link to link them, some problems occured:
(1) When I execute the command
`llvm-link file1.bc file2.bc -o result.bc` or `llvm-link file2.bc file1.bc -o result.bc`, no symbol is included in result.bc
(2) When I execute the command `llvm-link file1.bc --override=file2.bc -o result.bc` or `llvm-link file2.bc --override=file1.bc -o result.bc`, only symbols from file2.bc or file1.bc are included in result.bc
Then I execute the command `llvm-link file1.bc --override=file1.bc --override=file2.bc -o result.bc`, I finally link the files correctly.
My question is:
(1) What is the cause of the problem I encountered?
(2) How to use `llvm-link` and the option `--override` correctly when two files have multiple definition or don't have any multiple definition?
(3) How to use llvm-link to link multiple files?
I would be very grateful if someone answer my question.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyklMuSszYQhZ9GbLpMCXGxWbCYZMr1zyKrpCprIRqjRKgdXezw9ilhe-zxTPInlQ2UgG59pzlH0nt9sIgdq39g9WsmY5jIdd_IT9rSz8FJO2h7yHoalu4NJnlCQKso2oAOB_A0Ixwd9QZnD-cJLUSv7QHChKBonqUdgDXcmNO8Mdr-zhoO0Q7oYH1U1Dkw_sr4yy8TOgTpEMKZoNdB0YAwaoMeRkfz2tHLy3a_oQqsfFlfF3mvIG2TFiLvFRM_rusw4QIDWSa24UIu7QJzNEEfDcKAo7Y6kM3h18T9BsEtEAiiR3jnTQ8u9wnn1PmjYlIqOhxY-XJRwcSuYKK9dcQ_UcWAH6dx-fBhJncZNwmwIXDoowlJT8OBHHyqELeK4ouKhGoJ_DL3ZEB70FaZOOAA2j58eIMW34P-EnezoRM6pwdk5et_Z_9U_ndCyJrlKuVqhvce5B5M4PAfZd589j9F_nvpif0NRm2lMcu7ja6mVuQcqmCW_BHvpwX-iOiDJgvaJ48_G0uG9DtXbpmsSuO6uFoySbvnk5X7j7_4G51vFn9O5TUyQMd1c9bwB40Nv_NeYp5SehGyRus5VqkFue_HT5N9hCyfID_n8L3Buvm9dr2-wZmiGaBHOKFb4OBkwDEa0OMaXLKJwp_RwXwfdJ4NXTm0ZSsz7IqtaNptVW5FNnVFo7a7XSu3O15x2Za1UHWlpCiEKFVVtJnuBBcVb4XgJW8KkY_NtuhrUZV925bV2LOK4yy1yZOSnNwh095H7Are1vUuM7JH49fTVwiLZ1jfMiHSYey6VX4fD55V3Ggf_L1N0MFg9-Wo5PHo6Oi0DGgWVu6z6Ew3hXBMfmJiz8T-oMMU-1zRzMQ-VV5vm9vhKvYriWdif0U9deKvAAAA__83xwqt">