On 12/20/2011 03:07 PM, Ian Lance Taylor wrote:
>  __morestack_non_split:
> +     .cfi_startproc
>  
>  #ifndef __x86_64__
> -     addl    $0x4000,4(%esp)
> +
> +     # See below for an extended explanation of the CFI instructions.
> +     .cfi_offset 8, 8                # New PC stored at CFA + 8
> +     .cfi_escape 0x15, 4, 0x7d       # DW_CFA_val_offset_sf, %esp, 12/-4
> +                                     # i.e., next %esp is CFA + 12
> +
> +     pushl   %eax                    # Save %eax in case it is a parameter.
> +
> +     .cfi_def_cfa %esp,8             # Account for pushed register.
> +
> +     movl    %esp,%eax               # Current stack,

You'd be better off leaving the CFA where it belongs, at the desired location
of esp after unwind, i.e. esp+12.  That way you don't need to adjust the default
location of the return register, nor use a .cfi_escape.

Begin with ".cfi_def_cfa esp, 12" and that's about it.  Except for the fact you
need to alter your push/pop adjustments.  Those almost certainly should use
.cfi_adjust_cfa_offset instead of explicit absolute adjustments.


r~

Reply via email to