Commit e96b95c2 authored by Rickard x Andersson's avatar Rickard x Andersson Committed by Andrew Morton

gcov: add support for checksum field

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: 977ef30a ("gcov: support GCC 12.1 and newer compilers")
Signed-off-by: default avatarRickard x Andersson <rickaran@axis.com>
Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
Tested-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
Reviewed-by: default avatarMartin Liska <mliska@suse.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent c5651b31
...@@ -82,6 +82,7 @@ struct gcov_fn_info { ...@@ -82,6 +82,7 @@ struct gcov_fn_info {
* @version: gcov version magic indicating the gcc version used for compilation * @version: gcov version magic indicating the gcc version used for compilation
* @next: list head for a singly-linked list * @next: list head for a singly-linked list
* @stamp: uniquifying time stamp * @stamp: uniquifying time stamp
* @checksum: unique object checksum
* @filename: name of the associated gcov data file * @filename: name of the associated gcov data file
* @merge: merge functions (null for unused counter type) * @merge: merge functions (null for unused counter type)
* @n_functions: number of instrumented functions * @n_functions: number of instrumented functions
...@@ -94,6 +95,10 @@ struct gcov_info { ...@@ -94,6 +95,10 @@ struct gcov_info {
unsigned int version; unsigned int version;
struct gcov_info *next; struct gcov_info *next;
unsigned int stamp; unsigned int stamp;
/* Since GCC 12.1 a checksum field is added. */
#if (__GNUC__ >= 12)
unsigned int checksum;
#endif
const char *filename; const char *filename;
void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int); void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int);
unsigned int n_functions; unsigned int n_functions;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment