public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: herbert@gondor.apana.org.au, tianjia.zhang@linux.alibaba.com,
	linux-kernel@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@redhat.com>
Cc: x86@kernel.org
Subject: [RFC] crypto/sm4: Fix objtool/libelf warning
Date: Thu, 7 Oct 2021 22:22:04 +0200	[thread overview]
Message-ID: <20211007202204.GT174703@worktop.programming.kicks-ass.net> (raw)

Hi,

objtool is yielding the obscure libelf warning:

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

Which I tracked down to section:

  [3023] .rodata.cst164    PROGBITS        0000000000000000 1ab501e0 000154 a4  AM  0   0 16

Which has a section size of 0x154 (340) and an entry size of 0xa4 (164).
An obvious mis-match.

From there, git-grep quickly yields:

  arch/x86/crypto/sm4-aesni-avx-asm_64.S:.section .rodata.cst164, "aM", @progbits, 164
  arch/x86/crypto/sm4-aesni-avx2-asm_64.S:.section        .rodata.cst164, "aM", @progbits, 164

So those files create this .rodata section with an explicit entry size,
but then don't respect it themselves. Removing the entry size makes the
warning go away, but I can't tell if that's right or not, given there is
zero clue as to why that entry size was specified to begin with.

Please explain...

---
diff --git a/arch/x86/crypto/sm4-aesni-avx-asm_64.S b/arch/x86/crypto/sm4-aesni-avx-asm_64.S
index 18d2f5199194..d089cccf4db7 100644
--- a/arch/x86/crypto/sm4-aesni-avx-asm_64.S
+++ b/arch/x86/crypto/sm4-aesni-avx-asm_64.S
@@ -78,7 +78,7 @@
 	vpxor tmp0, x, x;
 
 
-.section	.rodata.cst164, "aM", @progbits, 164
+.section	.rodata.cst164, "aM", @progbits
 .align 16
 
 /*
diff --git a/arch/x86/crypto/sm4-aesni-avx2-asm_64.S b/arch/x86/crypto/sm4-aesni-avx2-asm_64.S
index d2ffd7f76ee2..a0f7541c2246 100644
--- a/arch/x86/crypto/sm4-aesni-avx2-asm_64.S
+++ b/arch/x86/crypto/sm4-aesni-avx2-asm_64.S
@@ -93,7 +93,7 @@
 	vpxor tmp0, x, x;
 
 
-.section	.rodata.cst164, "aM", @progbits, 164
+.section	.rodata.cst164, "aM", @progbits
 .align 16
 
 /*

             reply	other threads:[~2021-10-07 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 20:22 Peter Zijlstra [this message]
2021-10-14 10:29 ` [RFC] crypto/sm4: Fix objtool/libelf warning Tianjia Zhang
2021-10-14 14:56   ` Peter Zijlstra
2021-10-15  3:12     ` Tianjia Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211007202204.GT174703@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tianjia.zhang@linux.alibaba.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox