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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNARahN2xefEBb4EprpiA6B5-7Hakc1cC9_o+FieXr=a_pA@mail.gmail.com>
Date:   Tue, 18 Oct 2022 18:12:54 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Jiri Slaby <jirislaby@...nel.org>
Cc:     linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arch@...r.kernel.org,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nathan Chancellor <nathan@...nel.org>,
        Martin Liška <mliska@...e.cz>
Subject: Re: [PATCH v3 7/7] kbuild: remove head-y syntax

On Tue, Oct 18, 2022 at 5:16 PM Jiri Slaby <jirislaby@...nel.org> wrote:
>
> Hi,
>
> On 24. 09. 22, 20:19, Masahiro Yamada wrote:
> > Kbuild puts the objects listed in head-y at the head of vmlinux.
> > Conventionally, we do this for head*.S, which contains the kernel entry
> > point.
> >
> > A counter approach is to control the section order by the linker script.
> > Actually, the code marked as __HEAD goes into the ".head.text" section,
> > which is placed before the normal ".text" section.
> >
> > I do not know if both of them are needed. From the build system
> > perspective, head-y is not mandatory. If you can achieve the proper code
> > placement by the linker script only, it would be cleaner.
> >
> > I collected the current head-y objects into head-object-list.txt. It is
> > a whitelist. My hope is it will be reduced in the long run.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ...
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1149,10 +1149,10 @@ quiet_cmd_ar_vmlinux.a = AR      $@
> >         cmd_ar_vmlinux.a = \
> >       rm -f $@; \
> >       $(AR) cDPrST $@ $(KBUILD_VMLINUX_OBJS); \
> > -     $(AR) mPiT $$($(AR) t $@ | head -n1) $@ $(head-y)
> > +     $(AR) mPiT $$($(AR) t $@ | head -n1) $@ $$($(AR) t $@ | grep -F --file=$(srctree)/scripts/head-object-list.txt)
>
> With AR=gcc-ar, the "| head -n1" results in:
> /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ar
> terminated with signal 13 [Broken pipe]
>
> I found out only with gcc-lto. But maybe we should make it silent in any
> case? I'm not sure how. This looks ugly (and needs the whole output to
> be piped):
> gcc-ar t vmlinux.a | ( head -n1; cat >/dev/null )
>
> Note the result appears to be correct, it's only that gcc-ar complains
> after printing out the very first line.


Indeed, I see the same message.


sed does not show such an error, though.


masahiro@zoe:~/ref/linux$ gcc-ar t vmlinux.a | head -n1
arch/x86/kernel/head_64.o
/usr/bin/ar terminated with signal 13 [Broken pipe]


masahiro@zoe:~/ref/linux$ gcc-ar t vmlinux.a | sed -n 1p
arch/x86/kernel/head_64.o







-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ