[patch] Enabling EH in MCJIT

Kaylor, Andrew andrew.kaylor at intel.com
Thu May 2 14:31:38 PDT 2013


Hi Rafael,

I've read through this quickly, but I haven't had time for a careful review yet.  On first pass, it looks pretty good.  Thanks for returning to this issue!

Have you tested your patch with ARM?  As I recall the extra size thing was introduced for ELF on ARM, but the way you're handling it may be sufficient.

-Andy

-----Original Message-----
From: Rafael EspĂ­ndola [mailto:rafael.espindola at gmail.com] 
Sent: Wednesday, May 01, 2013 3:20 PM
To: llvm-commits
Cc: Kaylor, Andrew
Subject: [patch] Enabling EH in MCJIT

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




More information about the llvm-commits mailing list