[patch] Enabling EH in MCJIT

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed May 1 15:20:22 PDT 2013


Restarting a 5 month old thread :-(

This time I checked that all the dependencies were sorted out first
and that the test in the attached patch passes on both linux and OS X
64 bits.

On OS X __register_frame takes a single FDE, not the entire section
like on Linux. Fortunately passing a single frame also works on linux,
so this patch uses the same strategy on both systems.

On OS X the personality function is stored via a GOT, so we have to
add support for that. I treated the GOT as a degenerated stub
function. Any suggestions for a better name for "stuff that needs to
be close to this section"?

The patch also changes the Size field of the SectionEntry structure to
be the original size, not including any stubs. We need the original
size to walk over the CIEs in .eh_frame, and nothing was using the old
size.

And last, the patch implements a nasty part of MachO linking: The
assembler knows that the linker knows the format of .eh_frame, so it
doesn't produce relocations for it.  The patch then has to parse the
FDEs to update the offsets. Another option would be to load
__eh_frame, __text and __gcc_except_tab in one step so that the
offsets are not changed.

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


More information about the llvm-commits mailing list