[llvm-commits] [patch] Trying to enable EH support in the MCJIT

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Nov 25 21:37:14 PST 2012


I am trying to port examples/ExceptionDemo to use MCJIT. Except for
one nasty problem most of the changes  are fairly simple. The attached
patch gets the demo to work on Linux.

The nasty problem is that a shared library is linked with crtendS.o
and that file has a .eh_frame with 4 zero bytes in it. The runtime
library (__register_frame) depends on that to find the end of the
.eh_frame section. The old JIT solves the problem by adding two
pointer sized ints to the end of every FDE!

In a real solution the RuntimeDyldImpl::registerEHFrames
implementation should move to RuntimeDyldELF, but what should I do
with the change to d RuntimeDyldImpl::emitSection? Should it call a
virtual function to see how much padding (if any) it needs to add?

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 5884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121126/d796da46/attachment.obj>


More information about the llvm-commits mailing list