[LLVMdev] ARM EABI Exceptions

Renato Golin renato.golin at arm.com
Thu May 20 01:55:49 PDT 2010


Hi Anton,

> Because both tables are "standard" ?

Ok, we're in different pages, I think. 

I trust that LLVM is binary compatible with GCC, including the exception tables, for x86. What I was referring to is about the LLVM's x86 EH table compatibility with ARM GCC's personality routine.

I'm not an expert in exception handling, so I don't know all the idiosyncrasies of both standards, but I guessed that hoping ARM PRs to understand x86 tables was a bit too far. As far as I read and dug, both standards are very similar, but I can't yet guarantee that all PRs will read all tables, not without spending months reading and testing every combination.


> Here is how EH was implemented first for x86:
> 1. LLVM was made to emit tables for some "easy" examples, this
> involves some low-level stuff like register moves, encoding, etc. At
> this point one can use LLVM-generated .s files with gcc-provided
> unwinding library.

That's my road...

Just by turning on Dwarf debugging and lowering exception address and selection, I could get an ARM assembly with the default exception table. I've investigated the assembly code and it seems that clang is preparing the intrinsics the same way arm-gcc does, which is good. 

Up until __cxa_throw, everything is fine. The parameters are the same, in the same registers and the table header is similar. The failures come when getting into __cxa_begin_catch, when the PR recognizes the type thrown ('int') but still calls terminate. I'm guessing the action table is different, but there is no documentation on neither LLVM nor GCC intrinsics I could find.

Does LLVM have implementations of __cxa_* intrinsics? If so, where are they?


> 2. Necessary EH intrinsics was implemented
> 3. More refinements (PIC mode, etc.)

I didn't want to go that far, for now.

Cheers,
--renato






More information about the llvm-dev mailing list