MCJIT + Win64 SEH handling problem (missing unwinding info)

Hi all,

I’m using MCJIT for running the manually generated code under both Win32 and Win64 environments. Unfortunately catching exceptions under Win64 doesn’t work. As I understand the main problem is the lack of function table that is needed to unwind a call stack.

Microsoft says
Function tables are used on 64-bit Windows to determine how to unwind or walk the stack. These tables are usually generated by the compiler and stored as part of the image. However, applications must provide the function table for dynamically generated code.

As I can see LLVM usually creates Function Table when generating COFF (Win64EH::UnwindEmitter). But MCJIT can load only ELF files.

Is there any way to workaround the problem? Maybe it is already planned to implement COFF loading in MCJIT?

Best regards,