<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 should not allow delay loading data symbols"
   href="https://bugs.llvm.org/show_bug.cgi?id=33106">33106</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>COFF LLD should not allow delay loading data symbols
          </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>enhancement
          </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>peter@pcc.me.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre><span class="quote">>type dll.c</span >
__declspec(dllexport) int i = 42;

<span class="quote">>type exe.c</span >
#include <stdio.h>

__declspec(dllimport) extern int i;

int main() {
  printf("%d\n", i);
}

<span class="quote">>cl /c dll.c</span >
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

dll.c

<span class="quote">>link dll.obj /out:dll.dll /dll</span >
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

   Creating library dll.lib and object dll.exp

<span class="quote">>cl /c exe.c</span >
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

exe.c

<span class="quote">>link exe.obj dll.lib /delayload:dll.dll /out:exe.exe</span >
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

LINK : fatal error LNK1194: cannot delay-load 'dll.dll' due to import of data
symbol '__imp_i'; link without /DELAYLOAD:dll.dll

<span class="quote">>lld-link exe.obj dll.lib /delayload:dll.dll /out:exe.exe /alternatename:__delayLoadHelper2=main</span >

<span class="quote">>exe</span >
1346458193</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>