linux/scripts/genksyms
Masahiro Yamada a56fece7f3 genksyms: use uint32_t instead of unsigned long for calculating CRC
Currently, 'unsigned long' is used for intermediate variables when
calculating CRCs.

The size of 'long' differs depending on the architecture: it is 32 bits
on 32-bit architectures and 64 bits on 64-bit architectures.

The CRC values generated by genksyms represent the compatibility of
exported symbols. Therefore, reproducibility is important. In other
words, we need to ensure that the output is the same when the kernel
source is identical, regardless of whether genksyms is running on a
32-bit or 64-bit build machine.

Fortunately, the output from genksyms is not affected by the build
machine's architecture because only the lower 32 bits of the
'unsigned long' variables are used.

To make it even clearer that the CRC calculation is independent of
the build machine's architecture, this commit explicitly uses the
fixed-width type, uint32_t.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-01-10 23:01:22 +09:00
..
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
genksyms.c genksyms: use uint32_t instead of unsigned long for calculating CRC 2025-01-10 23:01:22 +09:00
genksyms.h genksyms: use generic macros for hash table implementation 2025-01-10 23:01:22 +09:00
keywords.c genksyms: Ignore module scoped _Static_assert() 2020-12-21 13:57:08 +09:00
lex.l genksyms: remove useless case DOTS 2021-02-16 12:01:45 +09:00
Makefile kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
parse.y genksyms: fix memory leak when the same symbol is read from *.symref file 2025-01-10 23:01:22 +09:00