* [PATCH 1/1] objdump: Fix disassembly if CROSS_COMPILE not set
@ 2025-02-15 14:23 David Laight
2025-02-20 22:11 ` Josh Poimboeuf
0 siblings, 1 reply; 3+ messages in thread
From: David Laight @ 2025-02-15 14:23 UTC (permalink / raw)
To: Josh Poimboeuf, linux-kernel; +Cc: David Laight, Miroslav Benes, Peter Zijlstra
If CROSS_COMPILE isn't set and -v specified the code tries to run
system("(null)objdump ....")
which really doesn't work very well.
Fix by changing NULL to "".
Fixes: ca653464dd097 ("objtool: Add verbose option for disassembling affected functions")
Signed-off-by: David Laight <david.laight.linux@gmail.com>
---
tools/objtool/check.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 753dbc4f8198..c1b771e772fd 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4506,6 +4506,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); }"
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] objdump: Fix disassembly if CROSS_COMPILE not set
2025-02-15 14:23 [PATCH 1/1] objdump: Fix disassembly if CROSS_COMPILE not set David Laight
@ 2025-02-20 22:11 ` Josh Poimboeuf
2025-02-20 22:12 ` Josh Poimboeuf
0 siblings, 1 reply; 3+ messages in thread
From: Josh Poimboeuf @ 2025-02-20 22:11 UTC (permalink / raw)
To: David Laight; +Cc: linux-kernel, Miroslav Benes, Peter Zijlstra
On Sat, Feb 15, 2025 at 02:23:21PM +0000, David Laight wrote:
> If CROSS_COMPILE isn't set and -v specified the code tries to run
> system("(null)objdump ....")
> which really doesn't work very well.
> Fix by changing NULL to "".
>
> Fixes: ca653464dd097 ("objtool: Add verbose option for disassembling affected functions")
> Signed-off-by: David Laight <david.laight.linux@gmail.com>
> ---
> tools/objtool/check.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 753dbc4f8198..c1b771e772fd 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -4506,6 +4506,8 @@ static int disas_funcs(const char *funcs)
> char *cmd;
>
> cross_compile = getenv("CROSS_COMPILE");
> + if (!cross_compile)
> + cross_compile = "";
Makes sense, I'm not sure how this works for me already? Regardless:
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Peter, can you take this one?
--
Josh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] objdump: Fix disassembly if CROSS_COMPILE not set
2025-02-20 22:11 ` Josh Poimboeuf
@ 2025-02-20 22:12 ` Josh Poimboeuf
0 siblings, 0 replies; 3+ messages in thread
From: Josh Poimboeuf @ 2025-02-20 22:12 UTC (permalink / raw)
To: David Laight; +Cc: linux-kernel, Miroslav Benes, Peter Zijlstra
On Thu, Feb 20, 2025 at 02:11:59PM -0800, Josh Poimboeuf wrote:
> On Sat, Feb 15, 2025 at 02:23:21PM +0000, David Laight wrote:
> > If CROSS_COMPILE isn't set and -v specified the code tries to run
> > system("(null)objdump ....")
> > which really doesn't work very well.
> > Fix by changing NULL to "".
> >
> > Fixes: ca653464dd097 ("objtool: Add verbose option for disassembling affected functions")
> > Signed-off-by: David Laight <david.laight.linux@gmail.com>
> > ---
> > tools/objtool/check.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> > index 753dbc4f8198..c1b771e772fd 100644
> > --- a/tools/objtool/check.c
> > +++ b/tools/objtool/check.c
> > @@ -4506,6 +4506,8 @@ static int disas_funcs(const char *funcs)
> > char *cmd;
> >
> > cross_compile = getenv("CROSS_COMPILE");
> > + if (!cross_compile)
> > + cross_compile = "";
>
> Makes sense, I'm not sure how this works for me already? Regardless:
>
> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
>
> Peter, can you take this one?
With s/objdump/objtool/ in subject :-)
--
Josh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-20 22:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-15 14:23 [PATCH 1/1] objdump: Fix disassembly if CROSS_COMPILE not set David Laight
2025-02-20 22:11 ` Josh Poimboeuf
2025-02-20 22:12 ` Josh Poimboeuf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox