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

    <tr>
        <th>Summary</th>
        <td>
            [avr] Code links agains __do_clear_bss and __do_copy_data even if respective sections are empty.
        </td>
    </tr>

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

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

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

<pre>
    clang will issue 
```
.globl  __do_copy_data
.globl  __do_clear_bss
```
even for modules that don't have objects in .data or .bss or COMMON, (or in .rodata for devices that do not see flash in RAM address space).

Result is that useless code from libgcc is dragged, which just increases code size without any benefit or purpose.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUttu2zAM_Rr5hZhhy3biPPghS7G3rEB_INCFttUpkiHKCbKvn-RmKAoUEEQRPDwkDyW9fgzKCjfB3VgLhmhFYNULq45sVz3P5paT9dKy6nC5aH9RfnlctIji26BFES6S6FsivKGD0Qe4er1aJIiziKC9Y3wfYRY3BC_fUUUC46DMRSChy8SX7en1fH79zfgJGO-TnzHBb6hMqvFm1CcpOB-BEGG0guYMfjueQWgdMNHRIhQyfiifjW73G9JqY5Lig2MltBmrvE4swV_BGjkplQE6iGlCnZu5z0bN8L5SynQqoCB85pD5i0ndOPs1gnAPkOhwNDEPs6xh8YTP-gUO9W6377uuartCD40-NAdRRBMtDqz7KW6BdS9wyqzWuD8EYhLGEXxVPRXR8HVLsIluRkhjL0lak0SmbH3KFgEBr0t8lMUa7DDHuBBrjoz_SmdKja-yVP6aHGtv_82PJfi8pORun4bSo-v7bl_MQ60a2bejGtta6n2rW910I1eyl13V8x0vrJBoKY_EOHd4__h36Z3GK8zAK87rutrzumqrrtRybHps-r7puOS6Z22FV2FsmfsofZiKMGwtyXWiFLSGIn0GBZGZHG4KZn6xplWEgZZgXMRAstiqD1v3_wC-vAGp">