+#if __FDPIC__
+/* VFP is not restored, but this is sufficient to allow unwinding. */
+static _Unwind_Reason_Code
+__gnu_personality_sigframe_fdpic (_Unwind_State state,
+ _Unwind_Control_Block *ucbp,
+ _Unwind_Context *context)
+{
+ unsigned int sp;
+ unsigned int pc;
+ unsigned int funcdesc;
+ unsigned int handler;
+ unsigned int first_handler_instruction;
+ int i;
+
+ _Unwind_VRS_Get (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, &sp);
+ _Unwind_VRS_Get (context, _UVRSC_CORE, R_PC, _UVRSD_UINT32, &pc);
+
+ funcdesc = *(unsigned int *)((pc & ~1) + FDPIC_FUNCDESC_OFFSET);
+ handler = *(unsigned int *)(funcdesc);
+ first_handler_instruction = *(unsigned int *)(handler & ~1);
+
+ /* Adjust SP to point to the start of registers according to
+ signal type. */
+ if (first_handler_instruction == ARM_SET_R7_RT_SIGRETURN
+ || first_handler_instruction == THUMB2_SET_R7_RT_SIGRETURN)
+ sp += ARM_NEW_RT_SIGFRAME_UCONTEXT
+ + ARM_UCONTEXT_SIGCONTEXT
+ + ARM_SIGCONTEXT_R0;
+ else
+ sp += ARM_UCONTEXT_SIGCONTEXT
+ + ARM_SIGCONTEXT_R0;
+ /* Restore regs saved on stack by the kernel. */
+ for (i = 0; i < 16; i++)
+ _Unwind_VRS_Set (context, _UVRSC_CORE, i, _UVRSD_UINT32, sp + 4 * i);
+
+ return _URC_CONTINUE_UNWIND;
+}
+#endif
+