diff options
author | Mark Brown <broonie@kernel.org> | 2022-11-25 19:16:05 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-11-25 19:16:05 +0000 |
commit | 5cd4d3886780bf9a846eada29a2aefe8bfcac027 (patch) | |
tree | ea5cc9b11657912a1371932ad467a7a622e8010c /kernel/gcov/gcc_4_7.c | |
parent | ef3232e3dbd172fa17190fa8a852a3180a73bbdc (diff) | |
parent | f0c4d9fc9cc9462659728d168387191387e903cc (diff) | |
download | linux-5cd4d3886780bf9a846eada29a2aefe8bfcac027.tar.gz linux-5cd4d3886780bf9a846eada29a2aefe8bfcac027.tar.bz2 linux-5cd4d3886780bf9a846eada29a2aefe8bfcac027.zip |
Merge tag 'v6.1-rc4' into spi-6.2
Linux 6.1-rc4 which should get my CI working on RPi3s again.
Diffstat (limited to 'kernel/gcov/gcc_4_7.c')
-rw-r--r-- | kernel/gcov/gcc_4_7.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c index 460c12b7dfea..7971e989e425 100644 --- a/kernel/gcov/gcc_4_7.c +++ b/kernel/gcov/gcc_4_7.c @@ -30,6 +30,13 @@ #define GCOV_TAG_FUNCTION_LENGTH 3 +/* Since GCC 12.1 sizes are in BYTES and not in WORDS (4B). */ +#if (__GNUC__ >= 12) +#define GCOV_UNIT_SIZE 4 +#else +#define GCOV_UNIT_SIZE 1 +#endif + static struct gcov_info *gcov_info_head; /** @@ -383,12 +390,18 @@ size_t convert_to_gcda(char *buffer, struct gcov_info *info) pos += store_gcov_u32(buffer, pos, info->version); pos += store_gcov_u32(buffer, pos, info->stamp); +#if (__GNUC__ >= 12) + /* Use zero as checksum of the compilation unit. */ + pos += store_gcov_u32(buffer, pos, 0); +#endif + for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { fi_ptr = info->functions[fi_idx]; /* Function record. */ pos += store_gcov_u32(buffer, pos, GCOV_TAG_FUNCTION); - pos += store_gcov_u32(buffer, pos, GCOV_TAG_FUNCTION_LENGTH); + pos += store_gcov_u32(buffer, pos, + GCOV_TAG_FUNCTION_LENGTH * GCOV_UNIT_SIZE); pos += store_gcov_u32(buffer, pos, fi_ptr->ident); pos += store_gcov_u32(buffer, pos, fi_ptr->lineno_checksum); pos += store_gcov_u32(buffer, pos, fi_ptr->cfg_checksum); @@ -402,7 +415,8 @@ size_t convert_to_gcda(char *buffer, struct gcov_info *info) /* Counter record. */ pos += store_gcov_u32(buffer, pos, GCOV_TAG_FOR_COUNTER(ct_idx)); - pos += store_gcov_u32(buffer, pos, ci_ptr->num * 2); + pos += store_gcov_u32(buffer, pos, + ci_ptr->num * 2 * GCOV_UNIT_SIZE); for (cv_idx = 0; cv_idx < ci_ptr->num; cv_idx++) { pos += store_gcov_u64(buffer, pos, |