[llvm-bugs] [Bug 36440] New: Bad PE when linking with .dlls instead of .libs

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 19 14:15:29 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36440

            Bug ID: 36440
           Summary: Bad PE when linking with .dlls instead of .libs
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: alexandre.ganea at ubisoft.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19905
  --> https://bugs.llvm.org/attachment.cgi?id=19905&action=edit
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

-- 
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/20180219/4e9675d0/attachment.html>


More information about the llvm-bugs mailing list