Skip to content

Commit 966a0ac

Browse files
samitolvanenwilldeacon
authored andcommitted
arm64/alternatives: move length validation inside the subsection
Commit f7b93d4 ("arm64/alternatives: use subsections for replacement sequences") breaks LLVM's integrated assembler, because due to its one-pass design, it cannot compute instruction sequence lengths before the layout for the subsection has been finalized. This change fixes the build by moving the .org directives inside the subsection, so they are processed after the subsection layout is known. Fixes: f7b93d4 ("arm64/alternatives: use subsections for replacement sequences") Signed-off-by: Sami Tolvanen <[email protected]> Link: ClangBuiltLinux#1078 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 7b7891c commit 966a0ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/include/asm/alternative.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
7777
"663:\n\t" \
7878
newinstr "\n" \
7979
"664:\n\t" \
80-
".previous\n\t" \
8180
".org . - (664b-663b) + (662b-661b)\n\t" \
82-
".org . - (662b-661b) + (664b-663b)\n" \
81+
".org . - (662b-661b) + (664b-663b)\n\t" \
82+
".previous\n" \
8383
".endif\n"
8484

8585
#define __ALTERNATIVE_CFG_CB(oldinstr, feature, cfg_enabled, cb) \

0 commit comments

Comments
 (0)