<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59848>59848</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            llvm-strip breaks symlink
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          pawelsopensource
      </td>
    </tr>
</table>

<pre>
    please consider following shell testcase:

```
touch empty.c
clang empty.c -shared -o empty.so.1
ln -sf empty.so.1 empty.so
strip --strip-unneeded empty.so
[ -L empty.so ] || echo "KO1"
llvm-strip --strip-unneeded empty.so
[ -L empty.so ] || echo "KO2"
```

llvm-strip (15.0.6) breaks empty.so symlink and reports "KO2". binutils strip works fine.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysUsGOozAM_ZpwsUDUNIUcOOxM1cuutN8QgoFs0wTFYav-_aqUaUez15GiOHl23oufrJnt6IlaId-EPGZ6SVOI7ayv5DjM5Dks0VDWhf7Wzo40E5jg2fYUYQjOhav1I_BEzkEiTkYzieqHKI-i_NgP5bbWawqLmYAuc7oV5gEZp_34AUHOk47UQx42iEOxexQ6DzkPn-Dn8ZHnFO0Meb7GfPGeqKf-S5GQb5D_eoIg5BFE_S7qdyAzBRCIP3_vBOKm6f5e8u8jxifxF1_-UxPY7GRRFgeBCrpI-swvbr5dnPVn0L6HSHOIiV_8BXTWL8k6hgfVNcQzw2A9FVnfVr2qlM6o3R1qVFIhYja1vcKuqerqUO0HJRtlmqY51LKSpNAMDWa2xRKrcldKRFlVdaFLI6WSNOx11xlFYl_SRVtX3JsoQhwzy7xQK1WzbzKnO3K8Dhqipyusybsb8pjFdm28W0YW-9JZTvxiSTY5aj85s5mxeZAt0bVTSjPfBw9PAk-jTdPSFSZcBJ7uD7eQzzH8IZMEnlZ1Fnhaf_cvAAD__55e8yc">