[llvm-bugs] [Bug 47617] New: Delay load stubs are not marked as CFG targets

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 22 12:38:29 PDT 2020


            Bug ID: 47617
           Summary: Delay load stubs are not marked as CFG targets
           Product: new-bugs
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dmajor at mozilla.com
                CC: andrew.paverd at microsoft.com, htmldeveloper at gmail.com,
                    llvm-bugs at lists.llvm.org, rnk at google.com,
                    sylvestre at debian.org, tom at ritter.vg

#include <windows.h>
#include <wininet.h>

int main(int, char**)
  decltype(InternetOpenA)* volatile ptr = &InternetOpenA;
  ptr(nullptr, 0, nullptr, nullptr, 0);
  return 0;

With MSVC, it runs OK:
cl -c -O2 test.cpp -guard:cf -nologo test.cpp && link test.obj -debug
wininet.lib -guard:cf -delayload:wininet.dll delayimp.lib -nologo && test.exe

With LLVM, this reports a CFG failure:
clang-cl -c -O2 test.cpp -guard:cf -nologo && lld-link test.obj -debug
wininet.lib -guard:cf -delayload:wininet.dll delayimp.lib -nologo && test.exe

It happens because the following stub is not marked for CFG:

0:000> u @rax
00007ff6`7a6b38a0 488d05f9470800  lea     rax,[test!_imp_InternetOpenA
00007ff6`7a6b38a7 e906000000      jmp     test!_tailMerge_wininet_dll

Seen in clang 10, 11, trunk 12.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200922/c08693e2/attachment.html>

More information about the llvm-bugs mailing list