<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 - Bad PE when linking with .dlls instead of .libs"
   href="https://bugs.llvm.org/show_bug.cgi?id=36440">36440</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Bad PE when linking with .dlls instead of .libs
          </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>alexandre.ganea@ubisoft.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=19905" name="attach_19905" title="left is link.exe dump (correct); right is lld-link.exe dump (incorrect).">attachment 19905</a> <a href="attachment.cgi?id=19905&action=edit" title="left is link.exe dump (correct); right is lld-link.exe dump (incorrect).">[details]</a></span>
left is link.exe dump (correct); right is lld-link.exe dump (incorrect).

While linking a fairly large project (300Mb .exe), the PE's
IMAGE_EXPORT_DIRECTORY doesn't seem correct. The RVA values seem to be out of
the current section's range. They actually point on data that isn't expected
for those fields.

Please see enclosed image, left is link.exe dump (correct); right is
lld-link.exe dump (incorrect).

The .objs are compiled with cl.exe, not clang-cl.exe. The libraries are created
using llvm-lib.exe. The same command-line is used for link.exe and lld-link.exe
(except for missing /WX because /IGNORE isn't supported in LLD):

When launching the executable, it terminates with code 0xc000007b.
The Visual Studio debug output says: "SXS: BasepCreateActCtx()
BasepSxsCreateStreams() failed"

This was caused by a mistake in our buildsystem, where two .dlls where linking
in, instead of using the .libs</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>