<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [COFF] LLD Crashing binary when compiling with LDC and build with LLD"
   href="https://bugs.llvm.org/show_bug.cgi?id=38645">38645</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[COFF] LLD Crashing binary when compiling with LDC and build with LLD
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>COFF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>radu.racariu@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20747" name="attach_20747" title="Program D source code">attachment 20747</a> <a href="attachment.cgi?id=20747&action=edit" title="Program D source code">[details]</a></span>
Program D source code

When compiling the attached program with LDC 1.11.0 (latest release ATM) and
linking with LLD for Win32 x86-64 the resulting binary will crash with an
access violation.

The same program linked with the MS linker works.

To get LDC 1.11.0, download the Window x86-64 variant
<a href="https://github.com/ldc-developers/ldc/releases/download/v1.11.0/ldc2-1.11.0-windows-x64.7z">https://github.com/ldc-developers/ldc/releases/download/v1.11.0/ldc2-1.11.0-windows-x64.7z</a>

The setup used Visual Studio Community 2017 for the system libraries.

Command line for building the binary:

```
%LDC_HOME%\bin\ldc2.exe -m64 -v -linker=lld-link bug.d
```

This will print the linker parameters also.

The probable cause is related with the size of the .rdata section, as by
reducing the size of the big enum string in the example program the crash
disappears.

This bug is also tracked at <a href="https://github.com/ldc-developers/ldc/issues/2823">https://github.com/ldc-developers/ldc/issues/2823</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>