Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: x86/sm4 - Fix invalid section entry size

This fixes the following warning:

vmlinux.o: warning: objtool: elf_update: invalid section entry size

The size of the rodata section is 164 bytes, directly using the
entry_size of 164 bytes will cause errors in some versions of the
gcc compiler, while using 16 bytes directly will cause errors in
the clang compiler. This patch correct it by filling the size of
rodata to a 16-byte boundary.

Fixes: a7ee22ee1445 ("crypto: x86/sm4 - add AES-NI/AVX/x86_64 implementation")
Fixes: 5b2efa2bb865 ("crypto: x86/sm4 - add AES-NI/AVX2/x86_64 implementation")
Reported-by: Peter Zijlstra <peterz@infradead.org>
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Tested-by: Heyuan Shi <heyuan@linux.alibaba.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Tianjia Zhang and committed by
Herbert Xu
f8690a4b 0e14ef38

+10 -2
+5 -1
arch/x86/crypto/sm4-aesni-avx-asm_64.S
··· 78 78 vpxor tmp0, x, x; 79 79 80 80 81 - .section .rodata.cst164, "aM", @progbits, 164 81 + .section .rodata.cst16, "aM", @progbits, 16 82 82 .align 16 83 83 84 84 /* ··· 132 132 /* 4-bit mask */ 133 133 .L0f0f0f0f: 134 134 .long 0x0f0f0f0f 135 + 136 + /* 12 bytes, only for padding */ 137 + .Lpadding_deadbeef: 138 + .long 0xdeadbeef, 0xdeadbeef, 0xdeadbeef 135 139 136 140 137 141 .text
+5 -1
arch/x86/crypto/sm4-aesni-avx2-asm_64.S
··· 93 93 vpxor tmp0, x, x; 94 94 95 95 96 - .section .rodata.cst164, "aM", @progbits, 164 96 + .section .rodata.cst16, "aM", @progbits, 16 97 97 .align 16 98 98 99 99 /* ··· 147 147 /* 4-bit mask */ 148 148 .L0f0f0f0f: 149 149 .long 0x0f0f0f0f 150 + 151 + /* 12 bytes, only for padding */ 152 + .Lpadding_deadbeef: 153 + .long 0xdeadbeef, 0xdeadbeef, 0xdeadbeef 150 154 151 155 .text 152 156 .align 16