Skip to content

Commit 866b6a8

Browse files
cminyardralfbaechle
authored andcommitted
MIPS: Add DWARF unwinding to assembly
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>
1 parent 9fef686 commit 866b6a8

File tree

6 files changed

+151
-117
lines changed

6 files changed

+151
-117
lines changed

arch/mips/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ ifdef CONFIG_64BIT
299299
bootvars-y += ADDR_BITS=64
300300
endif
301301

302+
# This is required to get dwarf unwinding tables into .debug_frame
303+
# instead of .eh_frame so we don't discard them.
304+
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
305+
302306
LDFLAGS += -m $(ld-emul)
303307

304308
ifdef CONFIG_MIPS

arch/mips/include/asm/asm.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
.type symbol, @function; \
5656
.ent symbol, 0; \
5757
symbol: .frame sp, 0, ra; \
58+
.cfi_startproc; \
5859
.insn
5960

6061
/*
@@ -66,12 +67,14 @@ symbol: .frame sp, 0, ra; \
6667
.type symbol, @function; \
6768
.ent symbol, 0; \
6869
symbol: .frame sp, framesize, rpc; \
70+
.cfi_startproc; \
6971
.insn
7072

7173
/*
7274
* END - mark end of function
7375
*/
7476
#define END(function) \
77+
.cfi_endproc; \
7578
.end function; \
7679
.size function, .-function
7780

0 commit comments

Comments
 (0)