From: Peter Zijlstra Date: Tue, 8 Mar 2022 15:30:16 +0000 (+0100) Subject: objtool: Have WARN_FUNC fall back to sym+off X-Git-Tag: v6.1-rc5~1704^2~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cff2086b01526b8c7deacc86473ffbab0cddfa9;p=platform%2Fkernel%2Flinux-starfive.git 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) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.461283840@infradead.org --- diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h index d99c467..802cfda 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;