Skip to content

Commit

Permalink
objtool: Warn about unknown annotation types
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20241128094312.611961175@infradead.org
  • Loading branch information
Peter Zijlstra committed Dec 2, 2024
1 parent 87116ae commit e7e0eb5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/objtool/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -2335,6 +2335,10 @@ static int __annotate_ifc(struct objtool_file *file, int type, struct instructio
static int __annotate_late(struct objtool_file *file, int type, struct instruction *insn)
{
switch (type) {
case ANNOTYPE_NOENDBR:
/* early */
break;

case ANNOTYPE_RETPOLINE_SAFE:
if (insn->type != INSN_JUMP_DYNAMIC &&
insn->type != INSN_CALL_DYNAMIC &&
Expand All @@ -2359,11 +2363,20 @@ static int __annotate_late(struct objtool_file *file, int type, struct instructi
insn->unret = 1;
break;

case ANNOTYPE_IGNORE_ALTS:
/* early */
break;

case ANNOTYPE_INTRA_FUNCTION_CALL:
/* ifc */
break;

case ANNOTYPE_REACHABLE:
insn->dead_end = false;
break;

default:
WARN_INSN(insn, "Unknown annotation type: %d", type);
break;
}

Expand Down

0 comments on commit e7e0eb5

Please sign in to comment.