]> Git Repo - linux.git/commitdiff
gcov: add support for checksum field
authorRickard x Andersson <[email protected]>
Tue, 20 Dec 2022 10:23:18 +0000 (11:23 +0100)
committerAndrew Morton <[email protected]>
Wed, 21 Dec 2022 22:31:52 +0000 (14:31 -0800)
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: 977ef30a7d88 ("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]>
kernel/gcov/gcc_4_7.c

index 7971e989e425b0b9764f9b4d96f9f5d0a1852b2b..74a4ef1da9ad77a985bb038f8da98cf32cf21df8 100644 (file)
@@ -82,6 +82,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
@@ -94,6 +95,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;
This page took 0.056777 seconds and 4 git commands to generate.