[llvm-bugs] [Bug 33284] New: LLD .def file parser cannot resolve names of fastcall exports

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 2 11:00:26 PDT 2017


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

            Bug ID: 33284
           Summary: LLD .def file parser cannot resolve names of fastcall
                    exports
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at lists.llvm.org

The Microsoft tools will make a DLL that exports "@foo at 8" out of the following
.c file and .def file:

$ cat foo.c
int __fastcall foo(int x, int y) { return x + y; }

$ cat foo.def
EXPORTS
        foo

# Use a 32-bit compiler
$ cl -c foo.c && link -dll -out:foo.dll foo.obj
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

foo.c
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

   Creating library foo.lib and object foo.exp

$ llvm-nm foo.lib
...
foo.dll:
00000000 T @foo at 8
00000000 T __imp_ at foo@8

If you substitute lld-link into the above command, I get:
C:\src\llvm-project\build\bin\lld-link.exe: warning: <root>: undefined symbol:
_foo
error: link failed

-- 
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/20170602/085d78a5/attachment.html>


More information about the llvm-bugs mailing list