gcc/gcc41-ppc64-cr2-unwind.patch

21 lines
950 B
Diff

2007-10-20 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/linux-unwind.h (ppc_fallback_frame_state): Point
saved CR2 offset to low 32 bits of regs->ccr rather than the whole
64-bit register in 64-bit libgcc.
--- gcc/config/rs6000/linux-unwind.h.jj 2007-09-04 22:24:32.000000000 +0200
+++ gcc/config/rs6000/linux-unwind.h 2007-10-18 14:42:25.000000000 +0200
@@ -244,7 +244,10 @@ ppc_fallback_frame_state (struct _Unwind
}
fs->regs.reg[CR2_REGNO].how = REG_SAVED_OFFSET;
- fs->regs.reg[CR2_REGNO].loc.offset = (long) &regs->ccr - new_cfa;
+ /* CR? regs are always 32-bit and PPC is big-endian, so in 64-bit
+ libgcc loc.offset needs to point to the low 32 bits of regs->ccr. */
+ fs->regs.reg[CR2_REGNO].loc.offset = (long) &regs->ccr - new_cfa
+ + sizeof (long) - 4;
fs->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET;
fs->regs.reg[LINK_REGISTER_REGNUM].loc.offset = (long) &regs->link - new_cfa;