Re: [tip: objtool/core] objtool/klp: Add --debug option to show cloning decisions
From: Josh Poimboeuf
Date: Fri Oct 31 2025 - 12:11:47 EST
On Fri, Oct 31, 2025 at 03:21:00PM +0100, Borislav Petkov wrote:
> On Fri, Oct 31, 2025 at 10:09:44AM -0400, Nathan Chancellor wrote:
> > Yeah, that looks good to me and matches the workaround that Peter did in
> > include/linux/compiler-clang.h. If cleanup is going to be used more in
> > objtool, it might be worth taking that approach there too like:
> >
> > #ifdef __clang__
> > #define __cleanup(func) __maybe_unused __attribute__((__cleanup__(func)))
> > #else
> > #define __cleanup(func) __attribute__((__cleanup__(func)))
> > #endif
>
> LGTM.
>
> I'll wait for the objool-er folks to lemme know what they want before
> I productize it.
>
> Thx Nathan!
How about __maybe_unused unconditionally without the #ifdef damage?
--
Josh