aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/dwarf.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c
index e6f427cff5ba..577302f31e6a 100644
--- a/arch/sh/kernel/dwarf.c
+++ b/arch/sh/kernel/dwarf.c
@@ -452,6 +452,8 @@ static int dwarf_cfa_execute_insns(unsigned char *insn_start,
452 case DW_CFA_undefined: 452 case DW_CFA_undefined:
453 count = dwarf_read_uleb128(current_insn, &reg); 453 count = dwarf_read_uleb128(current_insn, &reg);
454 current_insn += count; 454 current_insn += count;
455 regp = dwarf_frame_alloc_reg(frame, reg);
456 regp->flags |= DWARF_UNDEFINED;
455 break; 457 break;
456 case DW_CFA_def_cfa: 458 case DW_CFA_def_cfa:
457 count = dwarf_read_uleb128(current_insn, 459 count = dwarf_read_uleb128(current_insn,
@@ -629,9 +631,16 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc,
629 UNWINDER_BUG(); 631 UNWINDER_BUG();
630 } 632 }
631 633
632 /* If we haven't seen the return address reg, we're screwed. */
633 reg = dwarf_frame_reg(frame, DWARF_ARCH_RA_REG); 634 reg = dwarf_frame_reg(frame, DWARF_ARCH_RA_REG);
634 UNWINDER_BUG_ON(!reg); 635
636 /*
637 * If we haven't seen the return address register or the return
638 * address column is undefined then we must assume that this is
639 * the end of the callstack.
640 */
641 if (!reg || reg->flags == DWARF_UNDEFINED)
642 goto bail;
643
635 UNWINDER_BUG_ON(reg->flags != DWARF_REG_OFFSET); 644 UNWINDER_BUG_ON(reg->flags != DWARF_REG_OFFSET);
636 645
637 addr = frame->cfa + reg->addr; 646 addr = frame->cfa + reg->addr;