ChangeSet 1.2231.1.112, 2005/03/28 19:47:41-08:00, [EMAIL PROTECTED]
[PATCH] uml: real fix for __gcov_init symbols
Correctly export __gcov_init for cases where it's needed, by adding a
weak
definition for the case when GCC does not define this symbol and
letting it
being overriden by the real definition when GCC defines it (recent
ones).
Can't be implemented as a test on GCC version because SuSE has a
crippled GCC,
declared as 3.3.4 but having a lot of backported features.
Also, since gcc 3.4.3 requires profiling options even during linking,
add
profiling options to final link stage.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
CC: Anton Altaparmakov <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
Makefile-skas | 10 ++++++----
kernel/gmon_syms.c | 20 ++++++++++++++------
2 files changed, 20 insertions(+), 10 deletions(-)
diff -Nru a/arch/um/Makefile-skas b/arch/um/Makefile-skas
--- a/arch/um/Makefile-skas 2005-03-28 21:31:06 -08:00
+++ b/arch/um/Makefile-skas 2005-03-28 21:31:06 -08:00
@@ -3,10 +3,12 @@
# Licensed under the GPL
#
-PROFILE += -pg
+GPROF_OPT += -pg
+GCOV_OPT += -fprofile-arcs -ftest-coverage
-CFLAGS-$(CONFIG_GCOV) += -fprofile-arcs -ftest-coverage
-CFLAGS-$(CONFIG_GPROF) += $(PROFILE)
-LINK-$(CONFIG_GPROF) += $(PROFILE)
+CFLAGS-$(CONFIG_GCOV) += $(GCOV_OPT)
+CFLAGS-$(CONFIG_GPROF) += $(GPROF_OPT)
+LINK-$(CONFIG_GCOV) += $(GCOV_OPT)
+LINK-$(CONFIG_GPROF) += $(GPROF_OPT)
GEN_HEADERS += $(ARCH_DIR)/include/skas_ptregs.h
diff -Nru a/arch/um/kernel/gmon_syms.c b/arch/um/kernel/gmon_syms.c
--- a/arch/um/kernel/gmon_syms.c 2005-03-28 21:31:06 -08:00
+++ b/arch/um/kernel/gmon_syms.c 2005-03-28 21:31:06 -08:00
@@ -5,14 +5,22 @@
#include "linux/module.h"
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) || \
- (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
-extern void __gcov_init(void *);
-EXPORT_SYMBOL(__gcov_init);
-#else
extern void __bb_init_func(void *);
EXPORT_SYMBOL(__bb_init_func);
-#endif
+
+/* This is defined (and referred to in profiling stub code) only by some GCC
+ * versions in libgcov.
+ *
+ * Since SuSE backported the fix, we cannot handle it depending on GCC version.
+ * So, unconditinally export it. But also give it a weak declaration, which
will
+ * be overriden by any other one.
+ */
+
+extern void __gcov_init(void *) __attribute__((weak));
+EXPORT_SYMBOL(__gcov_init);
+
+extern void __gcov_merge_add(void *) __attribute__((weak));
+EXPORT_SYMBOL(__gcov_merge_add);
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html