summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRickard x Andersson <rickaran@axis.com>2022-12-20 11:23:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 09:26:35 +0100
commited8d556f31bf5c68587a681e2470fbce88ecf4f0 (patch)
tree7afea3a0cd9822238af319b2e909f7bef0c387f9 /kernel
parentdb6073c0e40fdbf7bfad8e065ee2d14927a98b28 (diff)
downloadlinux-stable-ed8d556f31bf5c68587a681e2470fbce88ecf4f0.tar.gz
linux-stable-ed8d556f31bf5c68587a681e2470fbce88ecf4f0.tar.bz2
linux-stable-ed8d556f31bf5c68587a681e2470fbce88ecf4f0.zip
gcov: add support for checksum field
commit e96b95c2b7a63a454b6498e2df67aac14d046d13 upstream. In GCC version 12.1 a checksum field was added. This patch fixes a kernel crash occurring during boot when using gcov-kernel with GCC version 12.2. The crash occurred on a system running on i.MX6SX. Link: https://lkml.kernel.org/r/20221220102318.3418501-1-rickaran@axis.com Fixes: 977ef30a7d88 ("gcov: support GCC 12.1 and newer compilers") Signed-off-by: Rickard x Andersson <rickaran@axis.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Tested-by: Peter Oberparleiter <oberpar@linux.ibm.com> Reviewed-by: Martin Liska <mliska@suse.cz> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/gcov/gcc_4_7.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
index bb6ccf456e2d..1c2bd1f23536 100644
--- a/kernel/gcov/gcc_4_7.c
+++ b/kernel/gcov/gcc_4_7.c
@@ -85,6 +85,7 @@ struct gcov_fn_info {
* @version: gcov version magic indicating the gcc version used for compilation
* @next: list head for a singly-linked list
* @stamp: uniquifying time stamp
+ * @checksum: unique object checksum
* @filename: name of the associated gcov data file
* @merge: merge functions (null for unused counter type)
* @n_functions: number of instrumented functions
@@ -97,6 +98,10 @@ struct gcov_info {
unsigned int version;
struct gcov_info *next;
unsigned int stamp;
+ /* Since GCC 12.1 a checksum field is added. */
+#if (__GNUC__ >= 12)
+ unsigned int checksum;
+#endif
const char *filename;
void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int);
unsigned int n_functions;