This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bad unwinder data for __kernel_sigtramp_rt64 in PPC 64 vDSO corrupts Condition Register
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- Cc: Alan Modra <amodra at au dot ibm dot com>, Benjamin Herrenschmuidt <benh at kernel dot crashing dot org>, gcc at gcc dot gnu dot org, Deepak Bhole <dbhole at redhat dot com>
- Date: Tue, 16 Oct 2007 20:47:52 +0200
- Subject: Re: Bad unwinder data for __kernel_sigtramp_rt64 in PPC 64 vDSO corrupts Condition Register
- References: <18196.61077.605560.598232@zebedee.pink> <20071016182155.GM2896@sunsite.mff.cuni.cz> <18197.359.138111.739125@zebedee.pink>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Oct 16, 2007 at 07:22:31PM +0100, Andrew Haley wrote:
> > and similarly linux-unwind.h should do:
> >
> > fs->regs.reg[R_CR2].loc.offset = (long) ®s->ccr - new_cfa;
> > /* CR? regs are just 32-bit and PPC is big-endian. */
> > fs->regs.reg[R_CR2].loc.offset += sizeof (long) - 4;
>
> Won't this generate an alignment fault?
Why? The reg size is 32-bit, so it only should be read/written
as 32-bit value.
E.g. a brief look at _Unwind_RaiseException shows:
lwz 12,5656(1)
...
mtcrf 32,12 #,
ld 15,5368(1) #,
ld 16,5376(1) #,
mtcrf 16,12 #,
ld 17,5384(1) #,
ld 18,5392(1) #,
mtcrf 8,12 #,
so it shouldn't have any problems with 4 byte alignment (rather than 8 byte
alignment).
Jakub