On 28 Jun 2011, at 12:21 AM, yoni londner wrote: > 1. I looked at a generated assembler from gcc. So I am not 100% sure what is > the 'most correct', but this is what gcc emits.
I was concerned that since this routine isn't compiler-generated it might be
doing something different from what .cfi_startproc was designed for. However, I
checked gas's behavior and the non-"simple" seems to be the right one after
all: it sets up the CFA in the normal place, located through the stack pointer,
and defines the return address's location relative to that. ("Simple" emits no
opcodes at all.)
> 2. This is possible, but the frame is the most important.
I agree entirely, but why not fix the other registers while we're at it? I've
attached a version of your diff with the extra registers' unwind info added---
untested, unfortunately--- it'll also need a
sub ::cfi_restore { &::emit(".cfi_restore",@_); }
in x86gas.pl and the corresponding stub for MASM.
Several of the other assembly files could use the same treatment as well:
md5-x86_64.pl uses %rbp to point to one of its arguments, sha1-586.pl uses %ebp
as a scratch register, etc.
cfi_fpo_2.diff
Description: Binary data
