// Insert a nop between .cfi_startproc and the trampoline symbol so that unwinders can find the FDE.
// A function's last instruction can be a call instruction (e.g. to __cxa_throw), in which case the
// return address (e.g. from __cxa_throw to the caller) will be just after the function. This
// address may also be the start of the next function, so to avoid ambiguity, unwinders assume that
// a return address PC can refer to the address just after a function, but never to the start of a
// function. (This is implemented by subtracting 1 from the return address PC before looking it up.)
// This is fine for ordinary functions, but breaks on trampolines. Inserting a nop fixes it.
//
// N.B. Unwinders have two other strategies for recognizing the signal trampoline:
// - Read the instructions that the return address PC points at and look for a sigreturn syscall.
// (Hence, the instructions must not change at all.)
// - Do a symbol table lookup and check that against the PC (e.g. LLDB looks for
// __kernel_rt_sigreturn and __restore_rt.)
// Either way, the nop is needed to avoid ambiguity if the function before the trampoline could end
// with a call.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.