[LLVMbugs] [Bug 21886] New: MCJIT/ELF should support MSVC C++ mangled symbols

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 11 14:18:43 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21886

            Bug ID: 21886
           Summary: MCJIT/ELF should support MSVC C++ mangled symbols
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: benoit.belley at autodesk.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13517
  --> http://llvm.org/bugs/attachment.cgi?id=13517&action=edit
[PATCH] Proposed fix & regression test

We have found a problem while using the MCJIT engine on Windows. Our jitted
code is invoking some external C++ functions. These external functions have
names  that are mangled using the MSVC C++ naming convention. These were not
handled properly by the ELObjectWriter.

The ELF format is used on Windows by the MCJIT engine. Thus, on Windows, the
ELFObjectWriter can encounter symbols mangled using the MS Visual Studio C++
name mangling. Symbols mangled using the MSVC C++ name mangling can legally
have "@@@" as a substring. The EFLObjectWriter should not interpret the "@@@"
substring as specifying
GNU-style symbol versioning. The ELFObjectWriter therefore check for the MSVC
C++ name mangling prefix which is either "?", "@?", "__imp_?" or "__imp_?@".

The attached patch addresses this issue. The patch is against the LLVM
release_35 branch (Revision 223459). The patch also includes a regression test. 

We have successfully ran all LLVM & Clang regression tests after applying the
patch on both Debug+Assert and Release builds.

-- 
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/20141211/3e60d107/attachment.html>


More information about the llvm-bugs mailing list