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

    <tr>
        <th>Summary</th>
        <td>
            [LLD][COFF] Sections marked as `IMAGE_SCN_LNK_INFO` end up in the final binary
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lld
      </td>
    </tr>

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

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

<pre>
    When linking object files with `IMAGE_SCN_LNK_INFO` sections (e.g. ".retplne"), they end up appearing in the final image binary. This causes issues when an executable loader tries to load the section, but it doesn't have any other attributes (e.g. when loading a Windows driver binary linked with `lld-link`).

According to [this page](https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_section_header) documenting `IMAGE_SCN_LNK_INFO`:

> The section contains comments or other information. This is valid only for object files.

So it should be reasonable to discard these sections without any impact.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U09vqzgQ_zTmMgoi5l9y4JCUx-ppu32HVuoxMngA7xob2UO6-fYrE_alPfQCNoxmfvP7I7xXg0GsWH5meR2JhUbrqtrZucbprMhHrZW36n1EA1qZf5QZwLZ_Y0fQK40ePhSNwIrk51-nP35cXp9eLs8vf15-vjS_WJGAx46UNR4YP2A8xMA4jx3SrA0yzhk_Mv4ENOIN0EhYZhDzjMKFMcqEH9ArIzSoSQwIrTLC3WJ4G5WHTiwePSjvl4AjIBQG8F_sFhKtRtBWSHRATqEHsut9bbmhCqPbhUARSIveMF4SjOKKIMwNLI3oQBA51S6EjxXWSaFXACngXRlpPzxIp67oNogrVyh_s6O13IVPrEgYP8YsqVlyuj9PXWfd2osssPxMYbdZDMjymvHDSDR7lp4YbxhvNApn4kl1znrbU9zZifEGzW7xjDcfdyj3U8oZb8Ss7jdDjDfG79bjbmXzstFwGTHwxPgRpO2WCQ0FNN9pGrB8gs_SH_D24BQ6a0go46GzU2jlwbqNS2V66yYRyjYJlYer0EqCNfoGfaj85K0vNL3aoJMf7aIltAgOhbdm1ZksSOU74VZ1PT5cF-i3C616qmkWHcWRrFJ5TI8iwmpf8qw8lDzLorHquz7P92mZFkWZtntRZsdUtLxvk0OXyaSIVMUTniUHXu6PaZakcbrn8lCWad5mSZFiyrIEJ6F0rPV1iq0botWb1T4peJlHWrSo_Zo0zrWWwf95HbkqlO_aZfAsS7Ty5B8NSJFew_n8XAc_5OenX03D8hpe_99xEi44TfjvU7hF60ug7j6NFqerrxYbFI1LuzkrANleu9nZoA3jzT1yjDfbZteK_xcAAP__6jxoPw">