[llvm-bugs] [Bug 44520] New: lld's COFF driver ignores ordinal, PRIVATE, NONAME in .def for forwards

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jan 11 13:22:53 PST 2020


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

            Bug ID: 44520
           Summary: lld's COFF driver ignores ordinal, PRIVATE, NONAME in
                    .def for forwards
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: CFSworks at gmail.com
                CC: llvm-bugs at lists.llvm.org

This one seems like an easy enough fix; the for loop in
COFF/Driver.cpp:parseModuleDefs just needs to set e2.{ordinal,noname,isPrivate}
in the forwarding case.

Steps to repro:

$ touch example.c
$ cl /nologo /c example.c
$ cat example.def
EXPORTS
  Sleep=kernel32.Sleep @123 NONAME PRIVATE

$ link /nologo /subsystem:windows /dll /out:example.dll /implib:example.lib
example.obj /def:example.def
$ dumpbin /exports example.dll
<...>
    ordinal hint RVA      name

        123               [NONAME] (forwarded to kernel32.Sleep)
<...>
$ dumpbin /exports example.lib
<...no exports...>

$ lld-link /nologo /subsystem:windows /dll /out:example.dll /implib:example.lib
example.obj /def:example.def
$ dumpbin /exports example.dll
<...>
    ordinal hint RVA      name

          1    0          Sleep (forwarded to kernel32.Sleep)
<...>
$ dumpbin /exports example.lib
<...>
       ordinal    name

                  Sleep
<...>

-- 
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/20200111/c02f3570/attachment.html>


More information about the llvm-bugs mailing list