may be used to specify whether CFI directives should emit
section. If section_list
is emitted, if section_list
is emitted. To emit both use
. The default if this directive is not used is
On targets that support compact unwinding tables these can be generated by specifying
Some targets may support an additional name, such as
which is used by the target.
directive can be repeated, with the same or different arguments, provided that CFI generation has not yet started. Once CFI generation has started however the section list is fixed and any attempts to redefine it will result in an error.
is used along with parameter
it also emits some architecture dependent initial CFI instructions.
defines personality routine and its encoding. encoding
must be a constant determining how the personality should be encoded. If it is 255 (
), second argument is not present, otherwise second argument should be a constant or a symbol name. When using indirect encodings, the symbol provided should be the location where personality can be loaded from, not the personality routine itself. The default after
, no personality routine.
is used to describe the compact unwind opcodes to be used for the current function. These are emitted inline in the
section if small enough and there is no LSDA, or in the
section otherwise. Only valid when generating compact EH frames (i.e. with
defines LSDA and its encoding. encoding
must be a constant determining how the LSDA should be encoded. If it is 255 (
), the second argument is not present, otherwise the second argument should be a constant or a symbol name. The default after
, meaning that no LSDA is present.
marks the start of a LSDA data section and switches to the corresponding
section. Must be preceded by a CFI block containing a
directive. Only valid when generating compact EH frames (i.e. with
The table header and unwinding opcodes will be generated at this point, so that they are immediately followed by the LSDA data. The symbol referenced by the
directive should still be defined in case a fallback FDE based encoding is used. The LSDA data is terminated by a section directive.
The optional align
argument specifies the alignment required. The alignment is specified as a power of two, as with the
defines a rule for computing CFA as: take address from
modifies a rule for computing CFA. From now on register
will be used instead of the old one. Offset remains the same.
modifies a rule for computing CFA. Register remains the same, but offset
is new. Note that it is the absolute offset that will be added to a defined register to compute CFA address.
is a relative value that is added/subtracted from the previous offset.
Previous value of register is saved at offset offset from CFA.
Previous value of register is CFA + offset .
Previous value of register
is saved at offset offset
from the current CFA register. This is transformed to
using the known displacement of the CFA register from the CFA. This is often easier to use, because the number will match the code it's annotating.
Previous value of register1 is saved in register register2 .
says that the rule for register
is now the same as it was at the beginning of the function, after all initial instruction added by
From now on the previous value of register can't be restored anymore.
Current value of register is the same like in the previous frame, i.e. no restoration needed.
pushes the set of rules for every register onto an implicit stack, while
pops them off the stack and places them in the current row. This is useful for situations where you have multiple
directives that need to be undone due to the control flow of the program. For example, we could have something like this (assuming the CFA is the value of
je label popq %rbx .cfi_restore %rbx popq %r12 .cfi_restore %r12 popq %rbp .cfi_restore %rbp .cfi_def_cfa %rsp, 8 ret label: /* Do something else */
Here, we want the
directives to affect only the rows corresponding to the instructions before
. This means we'd have to add multiple
to recreate the original save locations of the registers, as well as setting the CFA back to the value of
. This would be clumsy, and result in a larger binary size. Instead, we can write:
je label popq %rbx .cfi_remember_state .cfi_restore %rbx popq %r12 .cfi_restore %r12 popq %rbp .cfi_restore %rbp .cfi_def_cfa %rsp, 8 ret label: .cfi_restore_state /* Do something else */
That way, the rules for the instructions after
will be the same as before the first
without having to use multiple
Change return column register , i.e. the return address is either directly in register or can be accessed by rules for register .
Mark current function as signal trampoline.
SPARC register window has been saved.
.cfi_escapeexpression [, ... ]
Allows the user to add arbitrary bytes to the unwind info. One might use this to add OS-specific CFI opcodes, or generic CFI opcodes that GAS does not yet support.
The current value of register
. The value of label
will be encoded in the output file according to encoding
; see the description of
for details on this encoding.
The usefulness of equating a register to a fixed label is probably limited to the return address register. Here, it can be useful to mark a code segment that has only one return address which is reached by a direct branch and no copy of the return address exists in memory or another register.