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

    <tr>
        <th>Summary</th>
        <td>
            [llvm-strip] llvm-strip doesn't remove empty group sections
        </td>
    </tr>

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

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

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

<pre>
    `gcc -g3` produces ELF objects that contains group sections with `.debug_` sections inside.
If such ELF object will be processed with `llvm-strip --strip-debug` then the output ELF will contain
`group section [    1] `.group' [foo_grp] contains 0 sections:
` .
Such objects cannot be processed for example by GNU binutils (`file format not recognized`).
The Full test case:

`echo 'int main(){return 0;}' > test.c
gcc -g3 test.c -o test.o
llvm-strip --strip-debug test.o -o test.stripped.o
ld.bfd test.stripped.o -o test
test.stripped.o: file not recognized: file format not recognized
`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U02PozgQ_TXFpRTkmADhwKGjdFYrrfayO-eWMQV4xtgI292T-fUjO1890cwFI7-q5_eeXcI5NRqiFsoDlMdMBD_ZtZUTOW_O36ass_25hYqNUuJmLKBiuKy2D5Icvv5zQtt9Jekd-kl4lNZ4oYzDcbVhQUfSK2scfig_IVQs76kL41skuWPKONVTDuwI7OXvAV2Q0ydm_FBaY0fxVEnOUX9n0_p93ji_qgU3l3WT-CO9n8jED9rgl-ATYWK6SrwcF319VopQHhARt1Aek96EAq8jMFj7Nq5LhO4-Hz6geLlz4tXNf9HKLSApjLH-VyeDXZG-i3nRhN0Z__r3C3bKBK-0Q-B7qNigNMWyWXiM7StJOxr1g3qoGPDmetL_E-EpaI2enEcpHD303FSRnCwCr5XxOMcI-B54A_VhJR9WgwyKA9TH5LZ4TUy5vHRfL_-6hxt7-bMX9E_3cC26lydoof7e1-fd0D9jt_JLzXNj8YIpkqcsbtu_T-qWQNa3Rd8Ujcio3dbbptrxqiyzqe1rWYhKMkmDGOphT2xX92yod0W5l0LKTLWc8R2reMOqgpVlzrpBNLwTRJyxsuhgx2gWSucxjNyuY6acC9Q29bZoMi060i7NGOeGPjCBwHkcubVNAXZhdLBjWjnvHixeeZ2G8xFyfICfIu8tOQO8jo5n-05I8-LPTxOYhVW3k_dLeqf8BPw0Kj-FLpd2Bn6KfNdls6w2vljgp6TSAT9dXLy3_GcAAAD__6ddXE4">