aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/dwarf.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-10-25 21:48:18 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-10-25 21:48:18 -0400
commit6253195b671b98a4e5da5d39c2df9f8f257bcea1 (patch)
tree3b7ca1d8ef5d9c50a77abf1d1cf5b2b5aa243284 /arch/sh/kernel/dwarf.c
parent15893fb565921507da80e500d85bb2575989bb57 (diff)
parent60339fad5c68c9c533cd14e67194ff8f727c41d9 (diff)
Merge branch 'sh/stable-updates'
Conflicts: arch/sh/kernel/dwarf.c
Diffstat (limited to 'arch/sh/kernel/dwarf.c')
-rw-r--r--arch/sh/kernel/dwarf.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c
index 4d8c7bd149df..6c9d0c10f2be 100644
--- a/arch/sh/kernel/dwarf.c
+++ b/arch/sh/kernel/dwarf.c
@@ -21,6 +21,7 @@
21#include <linux/mempool.h> 21#include <linux/mempool.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/elf.h> 23#include <linux/elf.h>
24#include <linux/ftrace.h>
24#include <asm/dwarf.h> 25#include <asm/dwarf.h>
25#include <asm/unwinder.h> 26#include <asm/unwinder.h>
26#include <asm/sections.h> 27#include <asm/sections.h>
@@ -569,6 +570,27 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc,
569 if (!pc && !prev) 570 if (!pc && !prev)
570 pc = (unsigned long)current_text_addr(); 571 pc = (unsigned long)current_text_addr();
571 572
573#ifdef CONFIG_FUNCTION_GRAPH_TRACER
574 /*
575 * If our stack has been patched by the function graph tracer
576 * then we might see the address of return_to_handler() where we
577 * expected to find the real return address.
578 */
579 if (pc == (unsigned long)&return_to_handler) {
580 int index = current->curr_ret_stack;
581
582 /*
583 * We currently have no way of tracking how many
584 * return_to_handler()'s we've seen. If there is more
585 * than one patched return address on our stack,
586 * complain loudly.
587 */
588 WARN_ON(index > 0);
589
590 pc = current->ret_stack[index].ret;
591 }
592#endif
593
572 frame = mempool_alloc(dwarf_frame_pool, GFP_ATOMIC); 594 frame = mempool_alloc(dwarf_frame_pool, GFP_ATOMIC);
573 if (!frame) { 595 if (!frame) {
574 printk(KERN_ERR "Unable to allocate a dwarf frame\n"); 596 printk(KERN_ERR "Unable to allocate a dwarf frame\n");