diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-07-11 06:56:58 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-07-11 06:56:58 -0400 |
commit | 473d1cf4ee623b043790838bcf77e77958840bf2 (patch) | |
tree | e1e582134ac96dbb21bd26c6c3ba5bba341e5e50 | |
parent | f686d8c11c61143b9705ed38d8cd26b0643902a4 (diff) |
sh: Decouple mcount from ftrace.
This adds a general CONFIG_MCOUNT in order to permit mcount generation
without ftrace support. This is primarily for allowing platforms to
enable aggressive stack overflow checking without having to enable ftrace
support. Based on the sparc64 implementation.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/Kconfig.debug | 5 | ||||
-rw-r--r-- | arch/sh/Makefile | 4 | ||||
-rw-r--r-- | arch/sh/boot/compressed/Makefile | 2 | ||||
-rw-r--r-- | arch/sh/kernel/sh_ksyms_32.c | 2 | ||||
-rw-r--r-- | arch/sh/lib/Makefile | 3 |
5 files changed, 12 insertions, 4 deletions
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug index 52a132c24aab..75b5f4e06670 100644 --- a/arch/sh/Kconfig.debug +++ b/arch/sh/Kconfig.debug | |||
@@ -134,4 +134,9 @@ config STACK_DEBUG | |||
134 | call and will therefore incur a major performance hit. Most | 134 | call and will therefore incur a major performance hit. Most |
135 | users should say N. | 135 | users should say N. |
136 | 136 | ||
137 | config MCOUNT | ||
138 | def_bool y | ||
139 | depends on SUPERH32 | ||
140 | depends on STACK_DEBUG || FUNCTION_TRACER | ||
141 | |||
137 | endmenu | 142 | endmenu |
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 75d049b03f7e..52c34bf56962 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -186,6 +186,10 @@ KBUILD_CFLAGS += -pipe $(cflags-y) | |||
186 | KBUILD_CPPFLAGS += $(cflags-y) | 186 | KBUILD_CPPFLAGS += $(cflags-y) |
187 | KBUILD_AFLAGS += $(cflags-y) | 187 | KBUILD_AFLAGS += $(cflags-y) |
188 | 188 | ||
189 | ifeq ($(CONFIG_MCOUNT),y) | ||
190 | KBUILD_CFLAGS += -pg | ||
191 | endif | ||
192 | |||
189 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) | 193 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) |
190 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) | 194 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) |
191 | 195 | ||
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index 9531bf1b7c2f..3af239cb9b0d 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile | |||
@@ -23,7 +23,7 @@ IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ | |||
23 | 23 | ||
24 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | 24 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
25 | 25 | ||
26 | ifeq ($(CONFIG_FUNCTION_TRACER),y) | 26 | ifeq ($(CONFIG_MCOUNT),y) |
27 | ORIG_CFLAGS := $(KBUILD_CFLAGS) | 27 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
28 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) | 28 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
29 | endif | 29 | endif |
diff --git a/arch/sh/kernel/sh_ksyms_32.c b/arch/sh/kernel/sh_ksyms_32.c index fcc5de31f83b..5b81116046c1 100644 --- a/arch/sh/kernel/sh_ksyms_32.c +++ b/arch/sh/kernel/sh_ksyms_32.c | |||
@@ -106,7 +106,7 @@ EXPORT_SYMBOL(flush_dcache_page); | |||
106 | EXPORT_SYMBOL(clear_user_page); | 106 | EXPORT_SYMBOL(clear_user_page); |
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | #ifdef CONFIG_FUNCTION_TRACER | 109 | #ifdef CONFIG_MCOUNT |
110 | EXPORT_SYMBOL(mcount); | 110 | EXPORT_SYMBOL(mcount); |
111 | #endif | 111 | #endif |
112 | EXPORT_SYMBOL(csum_partial); | 112 | EXPORT_SYMBOL(csum_partial); |
diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index 19328d90a2d1..c2b28d8b2dd1 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile | |||
@@ -24,8 +24,7 @@ memcpy-y := memcpy.o | |||
24 | memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o | 24 | memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o |
25 | 25 | ||
26 | lib-$(CONFIG_MMU) += copy_page.o clear_page.o | 26 | lib-$(CONFIG_MMU) += copy_page.o clear_page.o |
27 | lib-$(CONFIG_FUNCTION_TRACER) += mcount.o | 27 | lib-$(CONFIG_MCOUNT) += mcount.o |
28 | lib-$(CONFIG_FUNCTION_GRAPH_TRACER) += mcount.o | ||
29 | lib-y += $(memcpy-y) $(udivsi3-y) | 28 | lib-y += $(memcpy-y) $(udivsi3-y) |
30 | 29 | ||
31 | EXTRA_CFLAGS += -Werror | 30 | EXTRA_CFLAGS += -Werror |