[LLVMdev] [cfe-dev] Unwind behaviour in Clang/LLVM

Joerg Sonnenberger joerg at britannica.bec.de
Thu Feb 6 07:47:48 PST 2014


On Thu, Feb 06, 2014 at 03:18:02PM +0000, Renato Golin wrote:
> Debug and EH require unwinding, but one doesn't require the other and
> unwinding is not exclusive to either.

Correct.

> I can't decide that, but those decisions should stay in the front-end. To
> the back-end, function attributes should be able to control table emission
> (or maybe we need flags, I don't know).

I disagree on this. Table emission by itself doesn't involve code
generation and I don't think it makes sense as a per function attribute
either. You either want it for all functions or only when needed (e.g.
exceptions are possible). As such, it makes perfect sense to me as a
global flag.

> > That said, the option already exists for changing the default:
> > -funwind-tables. There shouldn't be another ARM specific flag.
> >
> 
> So, can I assume that -f{no-}unwind-tables's syntax is to completely
> enable/disable the unwind tables and add/remove the ELF sections from the
> objects? If that's so, I can easily remove -arm-disable-ehabi and check on
> that flag.

-funwind-tables says that the tables should always be emitted. If there
are no other reasons like exception handling, they will only destructive
stack unwind.

-fno-unwind-tables says that tables should only be emitted, if another
(language specific) reason requires them. So for C++, it would normally
be ignored as exception support is the default. For C code, it would
ensure that no .eh_frame* sections are emitted, even on platforms that
require them for the ABI like AMD64.

Joerg



More information about the llvm-dev mailing list