From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2311CC3DA7A for ; Sun, 25 Dec 2022 16:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zwXgr3QEwuRxe+/c7cncL5FatcB7bzk/x+rnMnU9kgA=; b=q2vkWovRx2IXXrgr+sWuMX2zNE 1aH6tR8BUMALNc96+vncmqEEpgGBzsvJHC4czutzEf2rgYkvrDgg9DEx9PLj9kOOf/0vkyP6Dzqjq EP+/a4lGV8QtymMwFG+Q+FoU5d6xCTGOsohBQrK7zmovbbn/t0lDlrI8rPBcvpQOkEupxxsaLqkh1 3CcTyW88pl5f42iu51hh1eSZQkU3KcYoDE0iwG21p/WRkCSGuq0gRnyhwv0tzGBwP4S3r/hPkpez4 9/nlQiycq30WCyv4SQK1roQazOWMQshSZxzCdT8ftVUESmBtHb/V2SDrakZbiS6Lvdz9BD7sVcK51 QCJqFe8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p9UIT-00DLoq-Ji; Sun, 25 Dec 2022 16:56:25 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p9SlZ-00CRRJ-OK; Sun, 25 Dec 2022 15:18:23 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 03328B802C8; Sun, 25 Dec 2022 15:18:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D797C433F0; Sun, 25 Dec 2022 15:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671981498; bh=VpGs+wgQvn4nopc1zVna92m+pXcpav9pdxWW3SwSjoc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Jh7FT5QwpZXqUGxdeuVAKyjWHlRu4LXncDmnDxCbaDPyX1b37ve16iwxcm7vaxFiD 2jc0JH45sRXbFdmROBBxj+pCyoOAQRiNPkFEFY8jH9W16YK46aMVjwHe9qd3v0iVUW 8D1hwAzIyjeCHNXmjqbolb9Lh5XviXOdDAH2dTfN+ppfQ08hxsRah8bHKRh7kvI5ac imH0UGSJF4Y6C9VqJw3Bj7rDa+bcddaoyA9tILTNYWBzPG1Uwp+W5tskgsOoyH10IQ 4w0lpgyOR6j9PO7nSVYwX8qDCbL91D7rPzX936LOBKdFGa2Q/2ANoAKDoNbiwyABSI lSSEiYyaK8mhQ== Date: Sun, 25 Dec 2022 15:18:12 +0000 From: Conor Dooley To: Masahiro Yamada Cc: linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , Thorsten Leemhuis , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Dennis Gilmore , Albert Ou , Arnd Bergmann , Jisheng Zhang , Nicolas Schier , Palmer Dabbelt , Paul Walmsley Subject: Re: [PATCH] arch: fix broken BuildID for arm64 and riscv Message-ID: References: <20221224192751.810363-1-masahiroy@kernel.org> MIME-Version: 1.0 In-Reply-To: <20221224192751.810363-1-masahiroy@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221225_071822_310751_04A9D052 X-CRM114-Status: GOOD ( 27.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1267585556870947869==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1267585556870947869== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="K+NAhlStwZgY8Rt3" Content-Disposition: inline --K+NAhlStwZgY8Rt3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 25, 2022 at 04:27:51AM +0900, Masahiro Yamada wrote: > Dennis Gilmore reports that the BuildID is missing in the arm64 vmlinux > since commit 994b7ac1697b ("arm64: remove special treatment for the > link order of head.o"). >=20 > The issue is that the type of .notes section, which contains the BuildID, > changed from NOTES to PROGBITS. >=20 > Ard Biesheuvel figured out that whichever object gets linked first gets > to decide the type of a section, and the PROGBITS type is the result of > the compiler emitting .note.GNU-stack as PROGBITS rather than NOTE. >=20 > While Ard provided a fix for arm64, I want to fix this globally because > the same issue is happening on riscv since commit 2348e6bf4421 ("riscv: > remove special treatment for the link order of head.o"). This problem > will happen in general for other architectures if they start to drop > unneeded entries from scripts/head-object-list.txt. >=20 > Discard .note.GNU-stack in include/asm-generic/vmlinux.lds.h. >=20 > riscv needs to change its linker script so that DISCARDS comes before > the .notes section. Hey Mashiro, No idea why I decided to look at patchwork today, but this seems to break the build on RISC-V, there's a whole load of the following in the output: `.LPFE4' referenced in section `__patchable_function_entries' of kernel/tra= ce/trace_selftest_dynamic.o: defined in discarded section `.text.exit' of k= ernel/trace/trace_selftest_dynamic.o I assume that's what's doing it, but given the day that's in it - I haven't looked into this any further, nor gone and fished the logs out of the builder. Thanks, Conor. >=20 > Link: https://lore.kernel.org/lkml/CAABkxwuQoz1CTbyb57n0ZX65eSYiTonFCU8-L= CQc=3D74D=3DxE=3DrA@mail.gmail.com/ > Fixes: 994b7ac1697b ("arm64: remove special treatment for the link order = of head.o") > Fixes: 2348e6bf4421 ("riscv: remove special treatment for the link order = of head.o") > Reported-by: Dennis Gilmore > Suggested-by: Ard Biesheuvel > Signed-off-by: Masahiro Yamada > --- >=20 > arch/riscv/kernel/vmlinux.lds.S | 4 ++-- > include/asm-generic/vmlinux.lds.h | 1 + > 2 files changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.= lds.S > index 4e6c88aa4d87..1865a258e560 100644 > --- a/arch/riscv/kernel/vmlinux.lds.S > +++ b/arch/riscv/kernel/vmlinux.lds.S > @@ -31,6 +31,8 @@ PECOFF_FILE_ALIGNMENT =3D 0x200; > =20 > SECTIONS > { > + DISCARDS > + > /* Beginning of code and text segment */ > . =3D LOAD_OFFSET; > _start =3D .; > @@ -141,7 +143,5 @@ SECTIONS > STABS_DEBUG > DWARF_DEBUG > ELF_DETAILS > - > - DISCARDS > } > #endif /* CONFIG_XIP_KERNEL */ > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmli= nux.lds.h > index a94219e9916f..2993b790fe98 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -1007,6 +1007,7 @@ > *(.modinfo) \ > /* ld.bfd warns about .gnu.version* even when not emitted */ \ > *(.gnu.version*) \ > + *(.note.GNU-stack) /* emitted as PROGBITS */ > =20 > #define DISCARDS \ > /DISCARD/ : { \ > --=20 > 2.34.1 >=20 --K+NAhlStwZgY8Rt3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCY6hprwAKCRB4tDGHoIJi 0l9RAQDXyhrQnr6kGR3PoaIXcvTa5dsQBWOMb61JO0FkgzjwYAEAkDzn+fYdakxz 5UB/bAYVBrV22oXa0H/xak2PwjZ+AQA= =xIjn -----END PGP SIGNATURE----- --K+NAhlStwZgY8Rt3-- --===============1267585556870947869== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============1267585556870947869==--