[PATCH v3 34/39] objtool: Have WARN_FUNC fall back to sym+off

Peter Zijlstra
2022-03-03T11:33:39Z

Currently WARN_FUNC() either prints func+off and failing that prints
sec+off, add an intermediate sym+off. This is useful when playing
around with entry code.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
tools/objtool/include/objtool/warn.h | 2 ++
1 file changed, 2 insertions(+)

--- a/tools/objtool/include/objtool/warn.h
+++ b/tools/objtool/include/objtool/warn.h
@@ -22,6 +22,8 @@ static inline char *offstr(struct sectio
unsigned long name_off;

func = find_func_containing(sec, offset);
+ if (!func)
+ func = find_symbol_containing(sec, offset);
if (func) {
name = func->name;
name_off = offset - func->offset;