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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

The Microsoft tools will make a DLL that exports "@foo@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@8
00000000 T __imp_@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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to