[PATCH v4 15/28] objtool: Do not validate IBT for .return_sites and .call_sites

Alexandre Chartre posted 28 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH v4 15/28] objtool: Do not validate IBT for .return_sites and .call_sites
Posted by Alexandre Chartre 2 months, 3 weeks ago
The .return_sites and .call_sites sections reference text addresses,
but not with the intent to indirect branch to them, so they don't
need to be validated for IBT.

This is useful when running objtool on object files which already
have .return_sites or .call_sites sections, for example to re-run
objtool after it has reported an error or a warning.

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
---
 tools/objtool/check.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 9321486e6265e..646cb7fe61b02 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4627,6 +4627,8 @@ static int validate_ibt(struct objtool_file *file)
 		    !strcmp(sec->name, ".llvm.call-graph-profile")	||
 		    !strcmp(sec->name, ".llvm_bb_addr_map")		||
 		    !strcmp(sec->name, "__tracepoints")			||
+		    !strcmp(sec->name, ".return_sites")			||
+		    !strcmp(sec->name, ".call_sites")			||
 		    strstr(sec->name, "__patchable_function_entries"))
 			continue;
 
-- 
2.43.5