File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -312,12 +312,18 @@ int gcov_store_output(void)
312312 if (rc != 0 )
313313 return rc ;
314314
315+ #if (__GNUC__ >= 12 )
316+ /* Checksum */
317+ rc = gcov_write_u32 (fd , 0 );
318+ if (rc != 0 )
319+ return rc ;
320+ #endif
315321 for (fi_idx = 0 ; fi_idx < info -> n_functions ; fi_idx ++ ) {
316322 fi_ptr = info -> functions [fi_idx ];
317323 rc = gcov_write_u32 (fd , GCOV_TAG_FUNCTION );
318324 if (rc != 0 )
319325 return rc ;
320- rc = gcov_write_u32 (fd , GCOV_TAG_FUNCTION_LENGTH );
326+ rc = gcov_write_u32 (fd , GCOV_TAG_FUNCTION_LENGTH * GCOV_UNIT_SIZE );
321327 if (rc != 0 )
322328 return rc ;
323329 rc = gcov_write_u32 (fd , fi_ptr -> ident );
Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ typedef uint64_t gcov_type;
2525
2626#define GCOV_TAG_FUNCTION_LENGTH 3
2727
28+ #if (__GNUC__ >= 12 )
29+ #define GCOV_UNIT_SIZE 4
30+ #else
31+ #define GCOV_UNIT_SIZE 1
32+ #endif
33+
2834struct gcov_ctr_info {
2935 unsigned int num ;
3036 gcov_type * values ;
@@ -42,6 +48,9 @@ struct gcov_info {
4248 unsigned int version ;
4349 struct gcov_info * next ;
4450 unsigned int stamp ;
51+ #if (__GNUC__ >= 12 )
52+ unsigned int checksum ;
53+ #endif
4554 const char * filename ;
4655 void (* merge [GCOV_COUNTERS ])(gcov_type * , unsigned int );
4756 unsigned int n_functions ;
You can’t perform that action at this time.
0 commit comments