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]
Date:   Tue, 18 Oct 2022 10:16:20 +0200
From:   Jiri Slaby <jirislaby@...nel.org>
To:     Masahiro Yamada <masahiroy@...nel.org>,
        linux-kbuild@...r.kernel.org
Cc:     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

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.

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ