Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The `--arch` option is inaccessible on non-x86 architectures because the `klp` subcommand is conditionally compiled only for x86. --
commit bd45d7b713ebb8e72f88be16df165f29efd9fc96 Author: Joe Lawrence <[email protected]> objtool/klp: add --arch option to display target architecture This commit adds an --arch option to the klp diff subcommand to print the target architecture objtool was compiled for. This allows scripts to verify compatibility before processing object files. > diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c > --- a/tools/objtool/klp-diff.c > +++ b/tools/objtool/klp-diff.c [ ... ] > @@ -44,6 +44,7 @@ static const char * const klp_diff_usage[] = { > > static const struct option klp_diff_options[] = { > OPT_GROUP("Options:"), > + OPT_BOOLEAN('a', "arch", &show_arch, "display target architecture"), > OPT_BOOLEAN('d', "debug", &debug, "enable all debug output"), Since the klp subcommand is conditionally compiled and only enabled for x86 architectures, will this option be accessible on other architectures? According to the objtool Makefile, ARCH_HAS_KLP is strictly set to y only when SRCARCH is x86. For all other architectures, BUILD_KLP is disabled. This means that on non-x86 architectures, invoking objtool klp diff --arch will fall back to the weak stub, returning an "objtool: klp not implemented" error instead of printing the architecture. Since the architecture is a global property of the binary, would it make more sense to expose this via a global flag like objtool --arch instead of restricting it to the klp subcommand? -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=3
