[PATCH 0/2] Fix objtool warnings if LTO is enabled for LoongArch

Tiezhu Yang posted 2 patches 1 month, 3 weeks ago
arch/loongarch/Makefile                |  6 ++++++
tools/objtool/arch/loongarch/special.c | 23 +++++++++++++++++++++++
2 files changed, 29 insertions(+)
[PATCH 0/2] Fix objtool warnings if LTO is enabled for LoongArch
Posted by Tiezhu Yang 1 month, 3 weeks ago
The patch #1 should be a preparation for patch #2, that is to say,
the patch #2 is dependent on the patch #1, otherwise there is build
error if LTO is enabled after only applying patch #2.

With this series, most of warnings have been silenced, only remains
the following warning by now, it needs more analysis:

  vmlinux.o: warning: objtool: __efistub_efi_boot_kernel() falls through
  to next function __efistub_exit_boot_func()

How to reproduce:

  $ make ARCH=loongarch LLVM=1 clean defconfig
  $ scripts/config -d LTO_NONE -e LTO_CLANG_THIN
  $ make ARCH=loongarch LLVM=1 olddefconfig all

Tiezhu Yang (2):
  objtool/LoongArch: Get table size correctly if LTO is enabled
  LoongArch: Pass annotate-tablejump option if LTO is enabled

 arch/loongarch/Makefile                |  6 ++++++
 tools/objtool/arch/loongarch/special.c | 23 +++++++++++++++++++++++
 2 files changed, 29 insertions(+)

-- 
2.42.0
Re: [PATCH 0/2] Fix objtool warnings if LTO is enabled for LoongArch
Posted by Nathan Chancellor 1 month, 2 weeks ago
On Tue, Aug 12, 2025 at 09:27:14PM +0800, Tiezhu Yang wrote:
> The patch #1 should be a preparation for patch #2, that is to say,
> the patch #2 is dependent on the patch #1, otherwise there is build
> error if LTO is enabled after only applying patch #2.

Thanks, these two patches do indeed resolve most of the warnings that I
see.

Tested-by: Nathan Chancellor <nathan@kernel.org>

> With this series, most of warnings have been silenced, only remains
> the following warning by now, it needs more analysis:
> 
>   vmlinux.o: warning: objtool: __efistub_efi_boot_kernel() falls through
>   to next function __efistub_exit_boot_func()

Yes, I do see this one too. Odd, as efi_boot_kernel() ends in a
__noreturn function...

Cheers,
Nathan
Re: [PATCH 0/2] Fix objtool warnings if LTO is enabled for LoongArch
Posted by Huacai Chen 1 month, 2 weeks ago
On Fri, Aug 15, 2025 at 7:01 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Tue, Aug 12, 2025 at 09:27:14PM +0800, Tiezhu Yang wrote:
> > The patch #1 should be a preparation for patch #2, that is to say,
> > the patch #2 is dependent on the patch #1, otherwise there is build
> > error if LTO is enabled after only applying patch #2.
>
> Thanks, these two patches do indeed resolve most of the warnings that I
> see.
>
> Tested-by: Nathan Chancellor <nathan@kernel.org>
>
> > With this series, most of warnings have been silenced, only remains
> > the following warning by now, it needs more analysis:
> >
> >   vmlinux.o: warning: objtool: __efistub_efi_boot_kernel() falls through
> >   to next function __efistub_exit_boot_func()
>
> Yes, I do see this one too. Odd, as efi_boot_kernel() ends in a
> __noreturn function...
But this one only exists for LTO?

Huacai

>
> Cheers,
> Nathan
Re: [PATCH 0/2] Fix objtool warnings if LTO is enabled for LoongArch
Posted by Tiezhu Yang 1 month, 2 weeks ago
On 2025/8/16 下午10:59, Huacai Chen wrote:
> On Fri, Aug 15, 2025 at 7:01 AM Nathan Chancellor <nathan@kernel.org> wrote:
>>
>> On Tue, Aug 12, 2025 at 09:27:14PM +0800, Tiezhu Yang wrote:
>>> The patch #1 should be a preparation for patch #2, that is to say,
>>> the patch #2 is dependent on the patch #1, otherwise there is build
>>> error if LTO is enabled after only applying patch #2.
>>
>> Thanks, these two patches do indeed resolve most of the warnings that I
>> see.
>>
>> Tested-by: Nathan Chancellor <nathan@kernel.org>
>>
>>> With this series, most of warnings have been silenced, only remains
>>> the following warning by now, it needs more analysis:
>>>
>>>    vmlinux.o: warning: objtool: __efistub_efi_boot_kernel() falls through
>>>    to next function __efistub_exit_boot_func()
>>
>> Yes, I do see this one too. Odd, as efi_boot_kernel() ends in a
>> __noreturn function...
> But this one only exists for LTO?

Yes, this is true.

I have fixed this warning and the other new warnings locally,
will do more testing before sending patches.

Thanks,
Tiezhu