On Tue, Oct 16, 2007 at 08:21:55PM +0200, Jakub Jelinek wrote:
> On Tue, Oct 16, 2007 at 06:02:13PM +0100, Andrew Haley wrote:
> > The reason is that the unwinder data for CR in the vDSO is wrong.  The
> > line that affects the CR is here in

My fault.

> According to __builtin_init_dwarf_reg_size_table on ppc64-linux
> r0..r31, fp0..fp31, mq, lr, ctr, ap, vrsave, vscr, spe_acc, spefcsr, sfp
> are 64-bit, v0..v31 128-bit and cr0..cr7, xer 32-bit.
> So both kernel and gcc/config/rs6000/linux-unwind.h are wrong.
> 
> > arch/powerpc/kernel/vdso64/sigtramp.S:
> > 
> >   rsave (70, 38*RSIZE)              /* cr */
> 
> This should just be changed to
> /* Size of CR regs in DWARF unwind info.  */
> #define CRSIZE        4
> ...
>     rsave (70, 38*RSIZE + (RSIZE - CRSIZE))   /* cr */
> 
> and similarly linux-unwind.h should do:
> 
>     fs->regs.reg[R_CR2].loc.offset = (long) &regs->ccr - new_cfa;
>     /* CR? regs are just 32-bit and PPC is big-endian.  */
>     fs->regs.reg[R_CR2].loc.offset += sizeof (long) - 4;

This looks good to me.  I don't think we can change the unwinder to
use a different size for cr as that would break unwinding through
normal stack frames that save cr.

-- 
Alan Modra
Australia Development Lab, IBM

Reply via email to