mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
objtool: Default ignore INT3 for unreachable
commit 1ffbe4e935
upstream.
Ignore all INT3 instructions for unreachable code warnings, similar to NOP.
This allows using INT3 for various paddings instead of NOPs.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220308154317.343312938@infradead.org
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e3907d5c81
commit
dc8bf07914
1 changed files with 5 additions and 7 deletions
|
@ -2965,9 +2965,8 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
|
|||
switch (insn->type) {
|
||||
|
||||
case INSN_RETURN:
|
||||
if (next_insn && next_insn->type == INSN_TRAP) {
|
||||
next_insn->ignore = true;
|
||||
} else if (sls && !insn->retpoline_safe) {
|
||||
if (sls && !insn->retpoline_safe &&
|
||||
next_insn && next_insn->type != INSN_TRAP) {
|
||||
WARN_FUNC("missing int3 after ret",
|
||||
insn->sec, insn->offset);
|
||||
}
|
||||
|
@ -3014,9 +3013,8 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
|
|||
break;
|
||||
|
||||
case INSN_JUMP_DYNAMIC:
|
||||
if (next_insn && next_insn->type == INSN_TRAP) {
|
||||
next_insn->ignore = true;
|
||||
} else if (sls && !insn->retpoline_safe) {
|
||||
if (sls && !insn->retpoline_safe &&
|
||||
next_insn && next_insn->type != INSN_TRAP) {
|
||||
WARN_FUNC("missing int3 after indirect jump",
|
||||
insn->sec, insn->offset);
|
||||
}
|
||||
|
@ -3187,7 +3185,7 @@ static bool ignore_unreachable_insn(struct objtool_file *file, struct instructio
|
|||
int i;
|
||||
struct instruction *prev_insn;
|
||||
|
||||
if (insn->ignore || insn->type == INSN_NOP)
|
||||
if (insn->ignore || insn->type == INSN_NOP || insn->type == INSN_TRAP)
|
||||
return true;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue