[LLVMdev] Exception handling code works with JIT but not when compiled offline to object files.

edA-qa mort-ora-y eda-qa at disemia.com
Sat May 4 21:02:35 PDT 2013

On 05/05/13 00:24, Christian Schafmeister wrote:
> However, when I compile the bitcode files to object files with llc
> and then link them into a bundle with ld and load the bundle back
> into my executable the exception handling occasionally fails.

I had this problem with my exception handling code as well. I was
testing on Linux but perhaps a similar issue exists. What I discovered
is that for some reason the exception handling in JIT is more lenient
than in a compiled executable. That is, I discovered two things in my
exception code which were wrong but nonetheless working in the JIT.

1. In some cases I was calling Unwind_Resume even though I wasn't
technically in an exception anymore (I had reported it was already handled).

2. For cleanup code I wasn't setting the selector correctly (the value
you pass to Unwind_SetGR in regno(1)). I'm still not positive why this
caused it to fail, but it did.

edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130505/f027cbe8/attachment.sig>

More information about the llvm-dev mailing list