Skip to content

Commit

Permalink
MIPS: Add DWARF unwinding to assembly
Browse files Browse the repository at this point in the history
This will allow kdump dumps to work correclty with MIPS and
future DWARF unwinding of the stack to give accurate tracebacks.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/16990/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Corey Minyard authored and Ralf Baechle committed Sep 6, 2017
1 parent 9fef686 commit 866b6a8
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 117 deletions.
4 changes: 4 additions & 0 deletions arch/mips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ ifdef CONFIG_64BIT
bootvars-y += ADDR_BITS=64
endif

# This is required to get dwarf unwinding tables into .debug_frame
# instead of .eh_frame so we don't discard them.
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables

LDFLAGS += -m $(ld-emul)

ifdef CONFIG_MIPS
Expand Down
3 changes: 3 additions & 0 deletions arch/mips/include/asm/asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
.type symbol, @function; \
.ent symbol, 0; \
symbol: .frame sp, 0, ra; \
.cfi_startproc; \
.insn

/*
Expand All @@ -66,12 +67,14 @@ symbol: .frame sp, 0, ra; \
.type symbol, @function; \
.ent symbol, 0; \
symbol: .frame sp, framesize, rpc; \
.cfi_startproc; \
.insn

/*
* END - mark end of function
*/
#define END(function) \
.cfi_endproc; \
.end function; \
.size function, .-function

Expand Down
Loading

0 comments on commit 866b6a8

Please sign in to comment.