[PATCH V2 15/41] objtool: Allow .entry.text function using CLD instruction

From: Lai Jiangshan
Date: Sun Sep 26 2021 - 11:10:30 EST


From: Lai Jiangshan <laijs@xxxxxxxxxxxxxxxxx>

The whole error_entry() will be implemented in C which has a CLD
instruction.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxxxxx>
---
tools/objtool/check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 84e59a97bab6..2c775317b864 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3103,7 +3103,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
break;

case INSN_CLD:
- if (!state.df && func) {
+ if (!state.df && func && strcmp(sec->name, ".entry.text")) {
WARN_FUNC("redundant CLD", sec, insn->offset);
return 1;
}
--
2.19.1.6.gb485710b