.cfi_sections
section_list.cfi_sections
may be used to specify whether CFI directives
should emit .eh_frame
section and/or .debug_frame
section.
If section_list is .eh_frame
, .eh_frame
is emitted,
if section_list is .debug_frame
, .debug_frame
is emitted.
To emit both use .eh_frame, .debug_frame
. The default if this
directive is not used is .cfi_sections .eh_frame
.
On targets that support compact unwinding tables these can be generated
by specifying .eh_frame_entry
instead of .eh_frame
.
.cfi_startproc [simple]
.cfi_startproc
is used at the beginning of each function that
should have an entry in .eh_frame
. It initializes some internal
data structures. Don't forget to close the function by
.cfi_endproc
.
Unless .cfi_startproc
is used along with parameter simple
it also emits some architecture dependent initial CFI instructions.
.cfi_endproc
.cfi_endproc
is used at the end of a function where it closes its
unwind entry previously opened by
.cfi_startproc
, and emits it to .eh_frame
.
.cfi_personality
encoding [,
exp]
.cfi_personality
defines personality routine and its encoding.
encoding must be a constant determining how the personality
should be encoded. If it is 255 (DW_EH_PE_omit
), 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 .cfi_startproc
is .cfi_personality 0xff
,
no personality routine.
.cfi_personality_id
idcfi_personality_id
defines a personality routine by its index as
defined in a compact unwinding format.
Only valid when generating compact EH frames (i.e.
with .cfi_sections eh_frame_entry
.
.cfi_fde_data [
opcode1 [, ...]]
cfi_fde_data
is used to describe the compact unwind opcodes to be
used for the current function. These are emitted inline in the
.eh_frame_entry
section if small enough and there is no LSDA, or
in the .gnu.extab
section otherwise.
Only valid when generating compact EH frames (i.e.
with .cfi_sections eh_frame_entry
.
.cfi_lsda
encoding [,
exp]
.cfi_lsda
defines LSDA and its encoding.
encoding must be a constant determining how the LSDA
should be encoded. If it is 255 (DW_EH_PE_omit
), the second
argument is not present, otherwise the second argument should be a constant
or a symbol name. The default after .cfi_startproc
is .cfi_lsda 0xff
,
meaning that no LSDA is present.
.cfi_inline_lsda
[align].cfi_inline_lsda
marks the start of a LSDA data section and
switches to the corresponding .gnu.extab
section.
Must be preceded by a CFI block containing a .cfi_lsda
directive.
Only valid when generating compact EH frames (i.e.
with .cfi_sections eh_frame_entry
.
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 .cfi_lsda
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
.p2align
directive.
.cfi_def_cfa
register,
offset.cfi_def_cfa
defines a rule for computing CFA as: take
address from register and add offset to it.
.cfi_def_cfa_register
register.cfi_def_cfa_register
modifies a rule for computing CFA. From
now on register will be used instead of the old one. Offset
remains the same.
.cfi_def_cfa_offset
offset.cfi_def_cfa_offset
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.
.cfi_adjust_cfa_offset
offsetSame as .cfi_def_cfa_offset
but offset is a relative
value that is added/substracted from the previous offset.
.cfi_offset
register,
offsetPrevious value of register is saved at offset offset from CFA.
.cfi_rel_offset
register,
offsetPrevious value of register is saved at offset offset from
the current CFA register. This is transformed to .cfi_offset
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.
.cfi_register
register1,
register2Previous value of register1 is saved in register register2.
.cfi_restore
register.cfi_restore
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 .cfi_startproc
were executed.
.cfi_undefined
registerFrom now on the previous value of register can't be restored anymore.
.cfi_same_value
registerCurrent value of register is the same like in the previous frame, i.e. no restoration needed.
.cfi_remember_state
,First save all current rules for all registers by .cfi_remember_state
,
then totally screw them up by subsequent .cfi_*
directives and when
everything is hopelessly bad, use .cfi_restore_state
to restore
the previous saved state.
.cfi_return_column
registerChange return column register, i.e. the return address is either directly in register or can be accessed by rules for register.
.cfi_signal_frame
Mark current function as signal trampoline.
.cfi_window_save
SPARC register window has been saved.
.cfi_escape
expression[, ...]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.
.cfi_val_encoded_addr
register,
encoding,
labelThe current value of register is label. The value of label
will be encoded in the output file according to encoding; see the
description of .cfi_personality
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.