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

    <tr>
        <th>Summary</th>
        <td>
            --only-keep-debug should suppress default --strip-all
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            tools:llvm-objcopy/strip
      </td>
    </tr>

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

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

<pre>
    llvm-strip by default specifies `--strip-all` unless certain options are specified. `--only-keep-debug` should be one of those options, but it isn't currently, meaning that the debug data that is desired is subsequently stripped too, unless e.g. `--no-strip-all` is also specified. This differs to GNU strip's behaviour, so is a bug. The fix is to change `--only-keep-debug` for llvm-strip to suppress the default `--strip-all` (if it is specified explicitly, it should still work though).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U0GOnDAQfA1cLBAYmIEDh02iyS2n5AEGN-BZj03c9mbn92kDs7vRKhJg3K0qV1XDYOW91_rllqF3amXDnUmYRNCe4QqjmhQgS05FtvczoTXtWDAaENkIzgtlmF29sgaZcPAGk_mOs0bfs2eANZMwhDmicbFBSzYAs4buifnFIjxYEv6VDcEzRReahJ89G4NzYLy-x94NhFFmJpDw9AC28TIpvNhrCqmEyoGMrxgGhN9hg7PNxEoNb23kOnxAPh9qjf3XKBEIjfajq59LPEBNEzgkHvb9x6-dl6QimVrEi7LBRXoCRgKyM0ccsEm9xgqhxkWYGf4b0WQd-zAWAmBYVxfF7pb3GX2eTMJbNe3ZvYtm8LpqNaojQeoeI0CvtGZ_rHuOMwjzkvAuT2Vfya7qROoJAf0ngW_oh6SHnA9a0uB0v3i_YlI9JfxC16z8EoZ8tDfaRHPHkq3OXmH0tFWIAegLuDR1XZ7Tpe8kP03yxAde1PXUtaIbZFvXdSFk0zVtkWoxgMY-ab4knM_WSsrYYbRPTFSKfmmheeuoZDvPDtfRrhTF5ZgbT5pvqep5wXlRleeSl2XT5Keyha6rxgpGcZrqNqkLuAml80iSWzenbv91KBKkplbo8b0pENVsADZtxC8CRez663KuzkW66es3m38B5qAwGg">