summaryrefslogtreecommitdiff
path: root/tools/u_boot_pylib/gitutil.py
diff options
context:
space:
mode:
authorJustin Swartz <justin.swartz@risingedge.co.za>2025-07-22 15:57:17 +0200
committerTom Rini <trini@konsulko.com>2025-07-29 16:48:10 -0600
commitbb04b7bcf66e5d00a7abdf5c9a76026aa120e0df (patch)
tree774a79c3d0e6f2d0e19abb1fe730f18713577876 /tools/u_boot_pylib/gitutil.py
parenta8f20bb6650df56d2600cda2c66f9349df9e49c8 (diff)
tools: mips-relocs: replace format string introducers
The statement that prints the ELF object type value assumes that "%lx" (long unsigned int, hexadecimal) is suitable for printing a uint64_t typed value. While this may seem to work for some machines, ie. amd64, it isn't ideal on a 32-bit system, such as x86 where uint64_t is likely to be equivalent to a long long unsigned int, as indicated by: ../tools/mips-relocs.c:275:34: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=] 275 | printf("type 0x%lx\n", ehdr_field(e_type)); | ~~^ | | | long unsigned int | %llx As the ehdr_field function-like macro expands to a uint64_t value, it is better to use the PRIx64 macro in place of "%lx" to ensure that the correct format string introducer is specified for the actual type hiding behind uint64_t. A similar issue is also present in the report of .rel section overflow, where "%lx" is used to print a few size_t typed values, and would be better served by "%zx" instead. Signed-off-by: Justin Swartz <justin.swartz@risingedge.co.za> Fixes: 963014641117 ("MIPS: make size of relocation table fixed but configurable") Fixes: 703ec9ddf965 ("MIPS: Stop building position independent code") Cc: Paul Burton <paulburton@kernel.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'tools/u_boot_pylib/gitutil.py')
0 files changed, 0 insertions, 0 deletions