[PATCH v1 0/3] Fix objtool warnings if LTO is enabled for LoongArch (Part 2)

Tiezhu Yang posted 3 patches 1 month ago
There is a newer version of this series
arch/loongarch/kernel/Makefile | 2 --
arch/loongarch/kernel/head.S   | 6 ++----
tools/objtool/check.c          | 8 ++++++++
3 files changed, 10 insertions(+), 6 deletions(-)
[PATCH v1 0/3] Fix objtool warnings if LTO is enabled for LoongArch (Part 2)
Posted by Tiezhu Yang 1 month ago
The previous patches [1] [2] are to fix most of the warnings (total 3030):

  sibling call from callable instruction with modified stack frame

This series is a follow up to fix 2 kinds of warnings (total 24), it only
touches the objtool and LoongArch related code:

  falls through to next function
  unreachable instruction

With this series, there is only 1 kind of warning (total 3), it does not
only touch the objtool and LoongArch related code:

  missing __noreturn in .c/.h or NORETURN() in noreturns.h

In order to silence the above warnings, it needs to change the related
code to give the functions __noreturn attribute, and have a NORETURN()
annotation in tools/objtool/noreturns.h. IMO, it will touch all of the
archs and the generic code, so this needs much more work to avoid the
side effect or regression, once it is done I will send out the patch.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a47bc954cf0e [1]
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5dfea6644d20 [2]

Tiezhu Yang (3):
  objtool/LoongArch: Fix fall through warning about efi_boot_kernel()
  objtool/LoongArch: Fix unreachable instruction warnings about EFISTUB
  LoongArch: Fix unreachable instruction warnings about entry functions

 arch/loongarch/kernel/Makefile | 2 --
 arch/loongarch/kernel/head.S   | 6 ++----
 tools/objtool/check.c          | 8 ++++++++
 3 files changed, 10 insertions(+), 6 deletions(-)

-- 
2.42.0
Re: [PATCH v1 0/3] Fix objtool warnings if LTO is enabled for LoongArch (Part 2)
Posted by Huacai Chen 1 month ago
On Mon, Sep 1, 2025 at 3:22 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> The previous patches [1] [2] are to fix most of the warnings (total 3030):
>
>   sibling call from callable instruction with modified stack frame
>
> This series is a follow up to fix 2 kinds of warnings (total 24), it only
> touches the objtool and LoongArch related code:
>
>   falls through to next function
>   unreachable instruction
This series seems the best solution from my point of view. So if no
one has objections, I will take it.

Huacai

>
> With this series, there is only 1 kind of warning (total 3), it does not
> only touch the objtool and LoongArch related code:
>
>   missing __noreturn in .c/.h or NORETURN() in noreturns.h
>
> In order to silence the above warnings, it needs to change the related
> code to give the functions __noreturn attribute, and have a NORETURN()
> annotation in tools/objtool/noreturns.h. IMO, it will touch all of the
> archs and the generic code, so this needs much more work to avoid the
> side effect or regression, once it is done I will send out the patch.
>
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a47bc954cf0e [1]
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5dfea6644d20 [2]
>
> Tiezhu Yang (3):
>   objtool/LoongArch: Fix fall through warning about efi_boot_kernel()
>   objtool/LoongArch: Fix unreachable instruction warnings about EFISTUB
>   LoongArch: Fix unreachable instruction warnings about entry functions
>
>  arch/loongarch/kernel/Makefile | 2 --
>  arch/loongarch/kernel/head.S   | 6 ++----
>  tools/objtool/check.c          | 8 ++++++++
>  3 files changed, 10 insertions(+), 6 deletions(-)
>
> --
> 2.42.0
>