Skip to content

Commit 180a359

Browse files
Rickard x Anderssoncodewalkerster
authored andcommitted
gcov: add support for checksum field
commit e96b95c 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/[email protected] Fixes: 977ef30 ("gcov: support GCC 12.1 and newer compilers") Signed-off-by: Rickard x Andersson <[email protected]> Reviewed-by: Peter Oberparleiter <[email protected]> Tested-by: Peter Oberparleiter <[email protected]> Reviewed-by: Martin Liska <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a430ccb commit 180a359

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/gcov/gcc_4_7.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ struct gcov_fn_info {
8484
* @version: gcov version magic indicating the gcc version used for compilation
8585
* @next: list head for a singly-linked list
8686
* @stamp: uniquifying time stamp
87+
* @checksum: unique object checksum
8788
* @filename: name of the associated gcov data file
8889
* @merge: merge functions (null for unused counter type)
8990
* @n_functions: number of instrumented functions
@@ -96,6 +97,10 @@ struct gcov_info {
9697
unsigned int version;
9798
struct gcov_info *next;
9899
unsigned int stamp;
100+
/* Since GCC 12.1 a checksum field is added. */
101+
#if (__GNUC__ >= 12)
102+
unsigned int checksum;
103+
#endif
99104
const char *filename;
100105
void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int);
101106
unsigned int n_functions;

0 commit comments

Comments
 (0)