[PATCH 11/14] objtool: Allow empty alternatives

Josh Poimboeuf posted 14 patches 1 month ago
There is a newer version of this series
[PATCH 11/14] objtool: Allow empty alternatives
Posted by Josh Poimboeuf 1 month ago
arm64 can have empty alternatives, which are effectively no-ops.  Ignore
them.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 tools/objtool/check.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 23cde2de66b9..036adbd67488 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1994,10 +1994,8 @@ static int add_special_section_alts(struct objtool_file *file)
 		}
 
 		if (special_alt->group) {
-			if (!special_alt->orig_len) {
-				ERROR_INSN(orig_insn, "empty alternative entry");
+			if (!special_alt->orig_len)
 				continue;
-			}
 
 			if (handle_group_alt(file, special_alt, orig_insn, &new_insn))
 				return -1;
-- 
2.53.0
Re: [PATCH 11/14] objtool: Allow empty alternatives
Posted by Song Liu 4 weeks, 1 day ago
On Wed, Mar 4, 2026 at 7:31 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> arm64 can have empty alternatives, which are effectively no-ops.  Ignore
> them.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>