[LLVMdev] EHABI: Remaining issues

Keith Walker kwalker at arm.com
Thu Mar 13 09:48:56 PDT 2014


Renato

> -----Original Message-----
> From: Renato Golin [mailto:renato.golin at linaro.org]
>
> Last time we spoke about ARM unwinding, we agreed to have both CFI and
> directive variants in ARM, so that both EH and debuggers/profilers
> could correctly unwind the stack. The problem, obviously, is that we
> now have redundant information and I decided to have a go commoning
> them up.
> 
> One of the issues, I think, is GNU compatibility (so GAS can generate
> the tables correctly when not using the integrated assembler), and it
> seems there GCC also emits both EHABI directives and Dwarf, so I don't
> think we'll be able to move away from it. Since this is only relevant
> in debug/profiling mode, and the only problem is code size, I think
> this is something we can live with. Do you guys agree with it?

I think for the moment this is a sensible stance as it ensure maximum
compatibility with debuggers who might understand DWARF but not EHABI
generated tables.

> Another issue is the usage of EH tables in C code. I believe the
> consensus is that it may not be the most optimal for never-exceptional
> code, but it's the safest default option. The only thing remaining is
> to choose a way to disable them via some flag. As weird as
> -fno-exceptions sounds for C code, I think we'll have to go with it.
> Any other ideas?

It does seem strange if you are only compiling C code you have to specify
-fno-exceptions in order to not generated the overhead of the exception
tables.

Personally, it would appear to be more correct to require the use of
-fexceptions if you want the overhead of exception tables when compiling C.

However I can see that this may result in people not using -fexecptions when
they should and programs failing at runtime because of it.   Whilst not
specifying -fno-exceptions just results in a slightly larger image.

> Finally, Keith, do you have some internal EHABI test you can run Clang
> on? Does any one know of a large, self contained code, that makes
> heavy use of exceptions?

The EHABI specific tests that we have, test the ARM EHABI personality
routines whilst clang generates exception handling that use the GCC
personality routines.

Otherwise the tests we have are generic exception handling tests that are
part of C++ language tests suites.

Keith






More information about the llvm-dev mailing list