[llvm-bugs] [Bug 45822] New: Support COMDATs in ORC Core

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 6 20:58:28 PDT 2020


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

            Bug ID: 45822
           Summary: Support COMDATs in ORC Core
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OrcJIT
          Assignee: unassignedbugs at nondot.org
          Reporter: lhames at gmail.com
                CC: 1101.debian at gmail.com, llvm-bugs at lists.llvm.org

>From the llvm-dev mailing list thread "[llvm-dev] C++ JIT Compiler with LLVM on
Windows 10 - part 5":

"""
$"??_7exception at std@@6B@" = comdat largest

The JIT knows how to honor linkages, but it does not know about comdats yet
except in limited circumstances, so it sees these as conflicting definitions.

Adding support for comdats will be non-trivial as their selection rules are
more complex than the selection rules for linkage types.
"""

Actually it's worse than I thought: The IR model for COMDATs (see [1]) isn't
quite the same as the COFF model for COMDATs (see [2]), but we would need
something that can encapsulate both. I *think* COFF COMDATs are the most
general and could cover IR COMDATs, but we should check this with a COFF
expert.

Whatever model we settle on, I think we would need to implement it by
generalizing SymbolFlagsMap as this is our current vehicle for describing
MaterializationUnit interfaces to ORC Core. Once we can describe COMDAT symbols
the JITDylib::defineImpl method can be updated to apply COMDAT selection
criteria to choose which definitions are kept and which are discarded for any
given MaterializationUnit.


[1] https://llvm.org/docs/LangRef.html#comdats
[2]
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only

-- 
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/20200507/54fd996d/attachment.html>


More information about the llvm-bugs mailing list