summaryrefslogtreecommitdiff
path: root/tools/objtool/include
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-03-08 18:30:16 +0300
committerPeter Zijlstra <peterz@infradead.org>2022-03-15 12:32:32 +0300
commit5cff2086b01526b8c7deacc86473ffbab0cddfa9 (patch)
treea6d2b86a790cefbdc706ee1e3fcf2a353cd89a43 /tools/objtool/include
parent537da1ed54658e916141e50923a7f5b20c728856 (diff)
downloadlinux-5cff2086b01526b8c7deacc86473ffbab0cddfa9.tar.xz
objtool: Have WARN_FUNC fall back to sym+off
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> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lore.kernel.org/r/20220308154317.461283840@infradead.org
Diffstat (limited to 'tools/objtool/include')
-rw-r--r--tools/objtool/include/objtool/warn.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h
index d99c4675e4a5..802cfda0a6f6 100644
--- a/tools/objtool/include/objtool/warn.h
+++ b/tools/objtool/include/objtool/warn.h
@@ -22,6 +22,8 @@ static inline char *offstr(struct section *sec, unsigned long offset)
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;