Skip to content

Commit e96b95c

Browse files
Rickard x Anderssonakpm00
authored andcommitted
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: 977ef30 ("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>
1 parent c5651b3 commit e96b95c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

kernel/gcov/gcc_4_7.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct gcov_fn_info {
8282
* @version: gcov version magic indicating the gcc version used for compilation
8383
* @next: list head for a singly-linked list
8484
* @stamp: uniquifying time stamp
85+
* @checksum: unique object checksum
8586
* @filename: name of the associated gcov data file
8687
* @merge: merge functions (null for unused counter type)
8788
* @n_functions: number of instrumented functions
@@ -94,6 +95,10 @@ struct gcov_info {
9495
unsigned int version;
9596
struct gcov_info *next;
9697
unsigned int stamp;
98+
/* Since GCC 12.1 a checksum field is added. */
99+
#if (__GNUC__ >= 12)
100+
unsigned int checksum;
101+
#endif
97102
const char *filename;
98103
void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int);
99104
unsigned int n_functions;

0 commit comments

Comments
 (0)