Commit 26bea104 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Peter Zijlstra
Browse files

objtool: fix compilation failure with the x32 toolchain



When using the x32 toolchain, compilation fails because the printf
specifier "%lx" (long), doesn't match the type of the "checksum" variable
(long long). Fix this by changing the printf specifier to "%llx" and
casting "checksum" to unsigned long long.

Fixes: a3493b33 ("objtool/klp: Add --debug-checksum=<funcs> to show per-instruction checksums")

Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/a1158c99-fe0e-a218-4b5b-ffac212489f6@redhat.com
parent 0f61b186
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -152,8 +152,8 @@ static inline void unindent(int *unused) { indent--; }
	if (unlikely(insn->sym && insn->sym->pfunc &&			\
		     insn->sym->pfunc->debug_checksum)) {		\
		char *insn_off = offstr(insn->sec, insn->offset);	\
		__dbg("checksum: %s %s %016lx",				\
		      func->name, insn_off, checksum);			\
		__dbg("checksum: %s %s %016llx",			\
		      func->name, insn_off, (unsigned long long)checksum);\
		free(insn_off);						\
	}								\
})