Re: [PATCH v2 07/11] objtool: Include weak functions in global_noreturns check

From: Miroslav Benes
Date: Fri Apr 14 2023 - 10:32:43 EST


On Wed, 12 Apr 2023, Josh Poimboeuf wrote:

> If a global function doesn't return, and its prototype has the
> __noreturn attribute, its weak counterpart must also not return so that
> it matches the prototype and meets call site expectations.
>
> To properly follow the compiled control flow at the call sites, change
> the global_noreturns check to include both global and weak functions.
>
> On the other hand, if a weak function isn't in global_noreturns, assume
> the prototype doesn't have __noreturn. Even if the weak function
> doesn't return, call sites treat it like a returnable function.
>
> Fixes the following warning:
>
> kernel/sched/build_policy.o: warning: objtool: do_idle() falls through to next function play_idle_precise()
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Link: https://lore.kernel.org/oe-kbuild-all/202304090346.erhqxnlt-lkp@xxxxxxxxx/
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>

Reviewed-by: Miroslav Benes <mbenes@xxxxxxx>

The rest of the patch set looks good to me too.

M