Skip to content

Commit a0bd462

Browse files
committed
x86/crc: add ANNOTATE_NOENDBR to suppress objtool warnings
The assembly functions generated by crc-pclmul-template.S are called only via static_call, so they do not need to begin with an endbr instruction. But objtool still warns about a missing endbr by default. Add ANNOTATE_NOENDBR to suppress these warnings: vmlinux.o: warning: objtool: crc32_x86_init+0x1c0: relocation to !ENDBR: crc32_lsb_vpclmul_avx10_256+0x0 vmlinux.o: warning: objtool: crc64_x86_init+0x183: relocation to !ENDBR: crc64_msb_vpclmul_avx10_256+0x0 vmlinux.o: warning: objtool: crc_t10dif_x86_init+0x183: relocation to !ENDBR: crc16_msb_vpclmul_avx10_256+0x0 vmlinux.o: warning: objtool: __SCK__crc32_lsb_pclmul+0x0: data relocation to !ENDBR: crc32_lsb_pclmul_sse+0x0 vmlinux.o: warning: objtool: __SCK__crc64_lsb_pclmul+0x0: data relocation to !ENDBR: crc64_lsb_pclmul_sse+0x0 vmlinux.o: warning: objtool: __SCK__crc64_msb_pclmul+0x0: data relocation to !ENDBR: crc64_msb_pclmul_sse+0x0 vmlinux.o: warning: objtool: __SCK__crc16_msb_pclmul+0x0: data relocation to !ENDBR: crc16_msb_pclmul_sse+0x0 Fixes: 8d2d3e7 ("x86/crc: add "template" for [V]PCLMULQDQ based CRC functions") Reported-by: Stephen Rothwell <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Suggested-by: Peter Zijlstra <[email protected]> Acked-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent cf1ea3a commit a0bd462

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/lib/crc-pclmul-template.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Author: Eric Biggers <[email protected]>
88

99
#include <linux/linkage.h>
10+
#include <linux/objtool.h>
1011

1112
// Offsets within the generated constants table
1213
.set OFFSETOF_BSWAP_MASK, -5*16 // msb-first CRCs only
@@ -272,6 +273,10 @@
272273
.set CONSTS_YMM, %ymm7
273274
.set CONSTS_XMM, %xmm7
274275

276+
// Use ANNOTATE_NOENDBR to suppress an objtool warning, since the
277+
// functions generated by this macro are called only by static_call.
278+
ANNOTATE_NOENDBR
279+
275280
#ifdef __i386__
276281
push CONSTS_PTR
277282
mov 8(%esp), CONSTS_PTR

0 commit comments

Comments
 (0)