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

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

"""
$"??_7exception@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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to