Modern ABIs don't require frame pointers to be usedin functions. However missing FPs bring difficulties when doing a backtrace.One solution is to provide Dwarf-2 CFI data for each suchfunction. This can be easily done for example by GCC in it's output,but isn't that easy to write by hand for pure assembler functions.
With the help of these .cfi_* directivesone can add appropriate unwind info into his asm source without too muchtrouble.
Directives implemented so far:
.cfi_startproc
Use at thebeginning of each function. It initializes some internal data structures andemits initial CFI instructions.
.cfi_endproc
Opens .eh_frame,generates appropriate binary structures (CIE, FDE) and sets up relocationrecords.
.cfi_def_cfa reg,imm
Set a rule forcomputing CFA to: take content of register reg and add imm toit.
.cfi_def_cfa_register reg
Change rule forCFA to use reg. Offset remains the same.
.cfi_def_cfa_offset imm
Change rule forCFA to use offset imm. Register remains the same.
.cfi_adjust_cfa_offset imm
Like the previousone but imm is a relative value that will be added to currentoffset instead of an absolute value as in .cfi_def_cfa_offset.
.cfi_offset reg,imm
Generate a rulesaying that register reg is saved at offset imm fromCFA.