<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60451>60451</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
--strip-all-gnu not stripping the same sections as GNU objcopy
</td>
</tr>
<tr>
<th>Labels</th>
<td>
tools:llvm-objcopy/strip
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jh7370
</td>
</tr>
</table>
<pre>
The --strip-all-gnu option is intended to strip the same sections as GNU objcopy, but that doesn't seem to be quite happening. In particular, a SHF_ALLOC + SHT_SYMTAB section is not stripped by llvm-objcopy --strip-all-gnu, but is by objcopy --strip-all. There may be other similar cases for other section types.
Arguably, SHF_ALLOC sections should never be stripped, as this can have strange implications on the output, but as `--strip-all-gnu` is intended to provide 100% compatibility to support corner cases that are different between `llvm-objcopy --strip-all` and `objcopy --strip-app`, we should make sure we do actually match that behaviour correctly.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEk09v4zYTxj8NdRnYoGn9eXPQwdmF3y2wbQ9JDz0tRtRYZEqRLDn0wt--oBI3RdqiFwkgR_P8nmc0mLNdPNEoukfRfW6wsAlpfDHDcZDNFObb-GwIdrvMycYdOrdbfIEQ2QYPNoP1TH6mGTjAVgNsCDKuBJl0rcqAGf7_0y8Qphcd4k2oTzAVBjbIMAfKXqiBIROttclE8HuxTGAwRvLWL3v4wUPExFYXh6l-j_D05fzt9PXrz59AqEd4-vL87enXH59Pj3fVyuYDvzJFmmG6gXPXdfdG8dHSncrmWvkPRXt4NpQIVrxVxsCGEmS7WocJNGbKcAnpfv4GwbdIeS_kZyFPr89TWgpObkvh3cOfUWUTipvB05VSlbnjb6YzsLEZNHoweN0u0S8Edo3OanztUFUNQSgcC99dYQbRy4-We_lxgjGFq50JDlIK1YEOa0S2k3WWb9uES4whMeiQPN1tb4PERDDby4USeYaJ-DuRr6L_FnpVRz_Xkr_dxih6Wdm_0z2RFX8jyCVRPZsDoOaCzt1gRdbmlWEig1cbSqp8iTS7276Zx-P8cHzAhsZDP3SqP3RqaMyIl8P_UHaDuui27R6GY3vRl6HrZ637uZvbxo5KqqNU8nBoVaeG_aDmFuVFtodey04_iFbSitbtq8V9SEtjcy409rLtDo3DiVze9kopDsFlcTz9NQyhzptdoVTdvDRul1NZsmils5nze2O27Gj8uIXv_7f1y3_uXVOSGw1zrCBCnYU6L5ZNmfY6rEKdq9jbaxdTeCHNQp03S1mo8-bqjwAAAP__ells7g">