Skip to content

Commit a8ff29f

Browse files
committed
livepatch/klp-build: Require Clang assembler >= 20
Some special sections specify their ELF section entsize, for example: .pushsection section, "M", @progbits, 8 The entsize (8 in this example) is needed by objtool klp-diff for extracting individual entries. Clang assembler versions older than 20 silently ignore the above construct and set entsize to 0, resulting in the following error: .discard.annotate_data: missing special section entsize or annotations Add a klp-build check to prevent the use of Clang assembler versions prior to 20. Fixes: 24ebfcd ("livepatch/klp-build: Introduce klp-build script for generating livepatch modules") Reported-by: Song Liu <song@kernel.org> Acked-by: Song Liu <song@kernel.org> Link: https://patch.msgid.link/957fd52e375d0e2cfa3ac729160da995084a7f5e.1769562556.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
1 parent 78c268f commit a8ff29f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/livepatch/klp-build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ validate_config() {
249249
[[ -v CONFIG_GCC_PLUGIN_RANDSTRUCT ]] && \
250250
die "kernel option 'CONFIG_GCC_PLUGIN_RANDSTRUCT' not supported"
251251

252+
[[ -v CONFIG_AS_IS_LLVM ]] && \
253+
[[ "$CONFIG_AS_VERSION" -lt 200000 ]] && \
254+
die "Clang assembler version < 20 not supported"
255+
252256
return 0
253257
}
254258

0 commit comments

Comments
 (0)