aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/include/asm/dwarf.h4
-rw-r--r--arch/sh/kernel/dwarf.c14
2 files changed, 17 insertions, 1 deletions
diff --git a/arch/sh/include/asm/dwarf.h b/arch/sh/include/asm/dwarf.h
index 60b180728d8d..d3d3837c5e1b 100644
--- a/arch/sh/include/asm/dwarf.h
+++ b/arch/sh/include/asm/dwarf.h
@@ -340,6 +340,10 @@ struct dwarf_stack {
340#define DW_CFA_lo_user 0x1c 340#define DW_CFA_lo_user 0x1c
341#define DW_CFA_hi_user 0x3f 341#define DW_CFA_hi_user 0x3f
342 342
343/* GNU extension opcodes */
344#define DW_CFA_GNU_args_size 0x2e
345#define DW_CFA_GNU_negative_offset_extended 0x2f
346
343/* 347/*
344 * Some call frame instructions encode their operands in the opcode. We 348 * Some call frame instructions encode their operands in the opcode. We
345 * need some helper functions to extract both the opcode and operands 349 * need some helper functions to extract both the opcode and operands
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c
index 44e674ed2871..5fd6e604816d 100644
--- a/arch/sh/kernel/dwarf.c
+++ b/arch/sh/kernel/dwarf.c
@@ -429,7 +429,6 @@ static int dwarf_cfa_execute_insns(unsigned char *insn_start,
429 count = dwarf_read_uleb128(current_insn, 429 count = dwarf_read_uleb128(current_insn,
430 &frame->cfa_register); 430 &frame->cfa_register);
431 current_insn += count; 431 current_insn += count;
432 frame->cfa_offset = 0;
433 frame->flags |= DWARF_FRAME_CFA_REG_OFFSET; 432 frame->flags |= DWARF_FRAME_CFA_REG_OFFSET;
434 break; 433 break;
435 case DW_CFA_def_cfa_offset: 434 case DW_CFA_def_cfa_offset:
@@ -465,6 +464,19 @@ static int dwarf_cfa_execute_insns(unsigned char *insn_start,
465 frame->regs[reg].flags |= DWARF_REG_OFFSET; 464 frame->regs[reg].flags |= DWARF_REG_OFFSET;
466 frame->regs[reg].addr = offset; 465 frame->regs[reg].addr = offset;
467 break; 466 break;
467 case DW_CFA_GNU_args_size:
468 count = dwarf_read_uleb128(current_insn, &offset);
469 current_insn += count;
470 break;
471 case DW_CFA_GNU_negative_offset_extended:
472 count = dwarf_read_uleb128(current_insn, &reg);
473 current_insn += count;
474 count = dwarf_read_uleb128(current_insn, &offset);
475 offset *= cie->data_alignment_factor;
476 dwarf_frame_alloc_regs(frame, reg);
477 frame->regs[reg].flags |= DWARF_REG_OFFSET;
478 frame->regs[reg].addr = -offset;
479 break;
468 default: 480 default:
469 pr_debug("unhandled DWARF instruction 0x%x\n", insn); 481 pr_debug("unhandled DWARF instruction 0x%x\n", insn);
470 break; 482 break;