<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56059>56059</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[lld/macho] LLD should force-load with -ObjC when the library is passed via LC_LINKER_OPTION and explicitly
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tapthaker
</td>
</tr>
</table>
<pre>
Assuming that `main.o` has an `LC_LINKER_OPTION: -lfoo` as a load command and the library foo is written in Objective-C.
Then the following command should import all `Objective-C` symbols in `libfoo.a`
```
lld main.o -ObjC -L <search-path> -lfoo -o main
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxdUkuPmzAQ_jXmMgI5vLI5cMgmW2lVtKmqva8GMNitwcg2SfPvOyZFXa1kYAYP38s0prtXR-eWUU0DeIkeWMlHVFNiqACJDnAK7-rTR_369v3l58flx_vr5Y1lR4h1b9axMAXaYAetGUecOgiXlwK0aizaO9AgKAc3q7wXE6gJLs0v0Xp1FfEpAcbPjB8f93dJA-Hb3mhtbkHYhuqkWXQHapyN9YBaB2WfgIIWdx8bo12goJb4iTpBKj9zhPax1lYT6MM0xAR3grgGlp2cQNvKeEYvWfYCD78Qm3X2C1DUVVl3yA4YeeW1qFjxTKgs_TZiKw0rzlDX581Ab2wr4jWwm_LyHyncNudbapTYjM6JDq4K4esRrCGLP7NWLVHeo8XqSno_OzobIqY1EPjSJBQfNVpft0c8WxNCo1bR4QtHRVHy4hDJKs3yXdqVh5JjVmRi3xXdHou8wLwp2jJPI42N0C4YZGk6iRusEFSTyUhVKU9TXu5KXqZPOU_2eY4E1wv-1GOzK1nOBcWnk6AjMXaIbLVKapbB0aZWzrv_m-ReDZNY8wz4uHhpbOVxpp_1t7DRSl6t4v8CaeXi7A">