lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H7fRHGFVKV8HitRgmuoDPt5ODt--iSuV0EmeeUb9d5FNw@mail.gmail.com>
Date: Fri, 19 Sep 2025 09:03:04 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: Tiezhu Yang <yangtiezhu@...ngson.cn>, Peter Zijlstra <peterz@...radead.org>, 
	loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/3] objtool/LoongArch: Fix fall through warning about efistub

On Fri, Sep 19, 2025 at 8:20 AM Josh Poimboeuf <jpoimboe@...nel.org> wrote:
>
> On Thu, Sep 18, 2025 at 09:44:24AM +0800, Tiezhu Yang wrote:
> > (1) libstub doesn't link to vmlinux.o, only link libstub with vmlinux.o
> > during the final vmlinux link.
> >
> > ----->8-----
> > diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
> > index a3a9759414f4..919c1970ce14 100644
> > --- a/arch/loongarch/Makefile
> > +++ b/arch/loongarch/Makefile
> > @@ -164,7 +164,6 @@ CHECKFLAGS += $(shell $(CC) $(KBUILD_CPPFLAGS)
> > $(KBUILD_CFLAGS) -dM -E -x c /dev
> >  endif
> >
> >  libs-y += arch/loongarch/lib/
> > -libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
> >
> >  drivers-y              += arch/loongarch/crypto/
> >
> > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> > index 51367c2bfc21..c664bfb9b15f 100755
> > --- a/scripts/link-vmlinux.sh
> > +++ b/scripts/link-vmlinux.sh
> > @@ -69,6 +69,12 @@ vmlinux_link()
> >                 libs="${KBUILD_VMLINUX_LIBS}"
> >         fi
> >
> > +       if [ "${SRCARCH}" = "loongarch" ]; then
> > +               if is_enabled CONFIG_EFI_STUB; then
> > +                       libs="${libs} drivers/firmware/efi/libstub/lib.a"
> > +               fi
> > +       fi
>
> Right, though I think it would need to be something more generic so that
> other arches can have "post-objtool libs" as well.
I don't like this solution, but if ARM64, RISC-V and LoongArch are
changed together, I can accept.
And please remember to ensure ZBOOT on EFISTUB still works.

Huacai

>
> For example, arch/loongarch/Makefile could have
>
>   KBUILD_VMLINUX_LIBS_PRELINK += $(objtree)/drivers/firmware/efi/libstub/lib.a
>
> which can be exported by the top-level Makefile:
>
>   export KBUILD_VMLINUX_LIBS_PRELINK
>
> and then used by scripts/link-vmlinux.sh (untested):
>
>   ${ld} ${ldflags} -o ${output} \
>         ${wl}--whole-archive ${objs} ${wl}--no-whole-archive \
>         ${wl}--start-group ${libs} ${KBUILD_VMLINUX_LIBS_PRELINK} ${wl}--end-group \
>         ${kallsymso} ${btf_vmlinux_bin_o} ${arch_vmlinux_o} ${ldlibs}
>
> --
> Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ