Commit 2374a88a by Alan Modra Committed by Alan Modra

linux-unwind.h (frob_update_context <__powerpc64__>): Leave r2 REG_UNSAVED if…

linux-unwind.h (frob_update_context <__powerpc64__>): Leave r2 REG_UNSAVED if stopped on the instruction that saves r2 in a plt call stub.

	* config/rs6000/linux-unwind.h (frob_update_context <__powerpc64__>):
	Leave r2 REG_UNSAVED if stopped on the instruction that saves r2
	in a plt call stub.  Do restore r2 if stopped on bctrl.

From-SVN: r176861
parent d8fa1b73
2011-07-28 Alan Modra <amodra@gmail.com>
* config/rs6000/linux-unwind.h (frob_update_context <__powerpc64__>):
Leave r2 REG_UNSAVED if stopped on the instruction that saves r2
in a plt call stub. Do restore r2 if stopped on bctrl.
2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config.host (i[3456x]86-*-netware*): Remove.
......
......@@ -346,10 +346,28 @@ frob_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs ATT
figure out if it was saved. The big problem here is that the
code that does the save/restore is generated by the linker, so
we have no good way to determine at compile time what to do. */
unsigned int *insn
= (unsigned int *) _Unwind_GetGR (context, R_LR);
if (insn && *insn == 0xE8410028)
_Unwind_SetGRPtr (context, 2, context->cfa + 40);
if (pc[0] == 0xF8410028
|| ((pc[0] & 0xFFFF0000) == 0x3D820000
&& pc[1] == 0xF8410028))
{
/* We are in a plt call stub or r2 adjusting long branch stub,
before r2 has been saved. Keep REG_UNSAVED. */
}
else if (pc[0] == 0x4E800421
&& pc[1] == 0xE8410028)
{
/* We are at the bctrl instruction in a call via function
pointer. gcc always emits the load of the new r2 just
before the bctrl. */
_Unwind_SetGRPtr (context, 2, context->cfa + 40);
}
else
{
unsigned int *insn
= (unsigned int *) _Unwind_GetGR (context, R_LR);
if (insn && *insn == 0xE8410028)
_Unwind_SetGRPtr (context, 2, context->cfa + 40);
}
}
#endif
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment