Live Patching
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Joe Lawrence" <joe.lawrence@redhat.com>, live-patching@vger.kernel.org
Cc: "Yafang Shao" <laoar.shao@gmail.com>,
	"Song Liu" <song@kernel.org>, "Petr Mladek" <pmladek@suse.com>,
	"Josh Poimboeuf" <jpoimboe@kernel.org>,
	"Miroslav Benes" <mbenes@suse.cz>
Subject: Re: [RFC PATCH v2 4/7] objtool: add target architecture to usage
Date: Wed, 26 Aug 2026 19:57:51 +0000	[thread overview]
Message-ID: <20260826195751.CDA291F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260826195000.455905-5-joe.lawrence@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Unintended macro expansion of architecture names during stringification results in an incorrect objtool usage string on certain architectures.
--

commit d81c5c3b288ffe16035a8655c9eb901dce1a358a
Author: Joe Lawrence <joe.lawrence@redhat.com>

objtool: add target architecture to usage
    
Display the target architecture in the objtool usage string so that
users can identify which arch variant of objtool they are running.

> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
> index a4484fd22a96d..c73c80af5ef3d 100644
> --- a/tools/objtool/Makefile
> +++ b/tools/objtool/Makefile
> @@ -61,7 +61,8 @@ INCLUDES := -I$(srctree)/tools/include \
>  	    -I$(srctree)/tools/lib
>  
>  OBJTOOL_CFLAGS  := -std=gnu11 -fomit-frame-pointer -O2 -g $(WARNINGS)	\
> -		   $(INCLUDES) $(LIBELF_FLAGS) $(LIBXXHASH_CFLAGS) $(HOSTCFLAGS)
> +		   $(INCLUDES) $(LIBELF_FLAGS) $(LIBXXHASH_CFLAGS) $(HOSTCFLAGS) \
> +		   -DOBJTOOL_TARGET_ARCH=$(SRCARCH)

[Severity: Low]
Can passing the architecture name unquoted here cause a regression due to
compiler macro expansion?

For example, on architectures where the target name matches a predefined
compiler macro (like powerpc or sparc), OBJTOOL_TARGET_ARCH becomes an alias
to that predefined macro, which the preprocessor might then expand to a value
like 1.

[ ... ]

> diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
> index 75b11dc85010e..64651d90986fd 100644
> --- a/tools/objtool/builtin-check.c
> +++ b/tools/objtool/builtin-check.c

[ ... ]

> @@ -23,7 +24,7 @@ const char *objname;
>  struct opts opts;
>  
>  static const char * const check_usage[] = {
> -	"objtool <actions> [<options>] file.o",
> +	"objtool <actions> [<options>] file-" __stringify(OBJTOOL_TARGET_ARCH) ".o",

[Severity: Low]
Will this usage of __stringify() introduce a regression where the help string
is incorrect on certain architectures?

The __stringify() macro evaluates and expands its argument before converting it
to a string. If OBJTOOL_TARGET_ARCH evaluates to 1 due to predefined macros
as noted above, the resulting string will be "file-1.o" instead of
"file-powerpc.o".

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260826195000.455905-1-joe.lawrence@redhat.com?part=4

  reply	other threads:[~2026-08-26 19:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 19:49 [RFC PATCH v2 0/7] klp-build: OOT module support Joe Lawrence
2026-08-26 19:49 ` [RFC PATCH v2 1/7] objtool/klp: simplify read_exports file handling Joe Lawrence
2026-08-26 23:31   ` Song Liu
2026-08-26 19:49 ` [RFC PATCH v2 2/7] objtool/klp: add --symvers option to klp diff Joe Lawrence
2026-08-26 23:31   ` Song Liu
2026-08-26 19:49 ` [RFC PATCH v2 3/7] objtool/klp: allow special section entry size overrides Joe Lawrence
2026-08-27 19:17   ` Josh Poimboeuf
2026-08-26 19:49 ` [RFC PATCH v2 4/7] objtool: add target architecture to usage Joe Lawrence
2026-08-26 19:57   ` sashiko-bot [this message]
2026-08-27 19:23   ` Josh Poimboeuf
2026-08-26 19:49 ` [RFC PATCH v2 5/7] livepatch/klp-build: add basic out-of-tree module support Joe Lawrence
2026-08-26 20:00   ` sashiko-bot
2026-08-27 21:21   ` Josh Poimboeuf
2026-08-26 19:49 ` [RFC PATCH v2 6/7] livepatch/klp-build: add pre-built object support for advanced OOT workflows Joe Lawrence
2026-08-26 20:01   ` sashiko-bot
2026-08-27 21:45   ` Josh Poimboeuf
2026-08-26 19:50 ` [RFC PATCH v2 7/7] livepatch/klp-build: add validation for user-supplied OOT objects Joe Lawrence

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260826195751.CDA291F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=laoar.shao@gmail.com \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=song@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox