objtool: Fix verbose disassembly if CROSS_COMPILE isn't set
[ Upstream commit e77956e4e5c11218e60a1fe8cdbccd02476f2e56 ]
In verbose mode, when printing the disassembly of affected functions, if
CROSS_COMPILE isn't set, the objdump command string gets prefixed with
"(null)".
Somehow this worked before. Maybe some versions of glibc return an
empty string instead of NULL. Fix it regardless.
[ jpoimboe: Rewrite commit log. ]
Fixes: ca653464dd ("objtool: Add verbose option for disassembling affected functions")
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250215142321.14081-1-david.laight.linux@gmail.com
Link: https://lore.kernel.org/r/b931a4786bc0127aa4c94e8b35ed617dcbd3d3da.1743481539.git.jpoimboe@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
10856c530d
commit
22e1e4e11a
@@ -4614,6 +4614,8 @@ static int disas_funcs(const char *funcs)
|
||||
char *cmd;
|
||||
|
||||
cross_compile = getenv("CROSS_COMPILE");
|
||||
if (!cross_compile)
|
||||
cross_compile = "";
|
||||
|
||||
objdump_str = "%sobjdump -wdr %s | gawk -M -v _funcs='%s' '"
|
||||
"BEGIN { split(_funcs, funcs); }"
|
||||
|
||||
Reference in New Issue
Block a user