From: David Howells <dhowells@redhat.com> Date: Fri, 26 Oct 2007 13:17:00 +0100 Subject: [ppc64] Make the vDSO handle C++ unwinding correctly Message-id: 5220.1193401020@redhat.com O-Subject: [RHEL5 PATCH] PPC64: Make the vDSO handle C++ unwinding correctly Bugzilla: 420551 This patch makes the ppc64 vDSO handle C++ exception stack unwinding correctly by indicating that the 32-bit CR register should be saved in the correct place in the 64-bit slot on the stack [BZ 350291]. This fix has been tested with the test program attached to the bugzilla log. David diff --git a/arch/powerpc/kernel/vdso64/sigtramp.S b/arch/powerpc/kernel/vdso64/sigtramp.S index 17a83fa..59eb59b 100644 --- a/arch/powerpc/kernel/vdso64/sigtramp.S +++ b/arch/powerpc/kernel/vdso64/sigtramp.S @@ -134,13 +134,16 @@ V_FUNCTION_END(__kernel_sigtramp_rt64) 9: /* This is where the pt_regs pointer can be found on the stack. */ -#define PTREGS 128+168+56 +#define PTREGS 128+168+56 /* Size of regs. */ -#define RSIZE 8 +#define RSIZE 8 + +/* Size of CR reg in DWARF unwind info. */ +#define CRSIZE 4 /* This is the offset of the VMX reg pointer. */ -#define VREGS 48*RSIZE+33*8 +#define VREGS 48*RSIZE+33*8 /* Describe where general purpose regs are saved. */ #define EH_FRAME_GEN \ @@ -178,7 +181,7 @@ V_FUNCTION_END(__kernel_sigtramp_rt64) rsave (31, 31*RSIZE); \ rsave (67, 32*RSIZE); /* ap, used as temp for nip */ \ rsave (65, 36*RSIZE); /* lr */ \ - rsave (70, 38*RSIZE) /* cr */ + rsave (70, 38*RSIZE + (RSIZE - CRSIZE)) /* cr */ /* Describe where the FP regs are saved. */ #define EH_FRAME_FP \