From patchwork Fri Apr 8 17:06:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 8784971 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 790EA9F36E for ; Fri, 8 Apr 2016 17:10:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 844B7202EC for ; Fri, 8 Apr 2016 17:10:32 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62F9E201B4 for ; Fri, 8 Apr 2016 17:10:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoZsJ-0005bF-1E; Fri, 08 Apr 2016 17:07:15 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoZsI-0005b3-4C for xen-devel@lists.xenproject.org; Fri, 08 Apr 2016 17:07:14 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id AB/16-07120-145E7075; Fri, 08 Apr 2016 17:07:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDIsWRWlGSWpSXmKPExsXSO6nOVdfxKXu 4wZu/LBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a/PbvZCz6IVPxYINDAuEWgi5GLQ0ignUni x6/VTBDOZ0aJJ1/2MkI4Gxgl1n29zQzhdDNKbOv9xNrFyAnkFEk033nICGKzCKhIzLi7hb2Lk YODTcBE4s0qR5CwiICyRO+v3ywgNrPAGSaJZ7M9QGxhAVeJlVsmMoHYvALmEs1PT7BAzD/NJN E94QlUQlDi5MwnUM1aEjf+vWQCmc8sIC2x/B8HSJhTwF7iwNP3YGFRoBNeHawHCUsIGEv0zep jmcAoNAvJoFlIBs1CGLSAkXkVo3pxalFZapGusV5SUWZ6RkluYmaOrqGBmV5uanFxYnpqTmJS sV5yfu4mRmAoMwDBDsaOf06HGCU5mJREebc9ZA8X4kvKT6nMSCzOiC8qzUktPsQow8GhJMGr/ gQoJ1iUmp5akZaZA4wqmLQEB4+SCG8qSJq3uCAxtzgzHSJ1ilFRSpzXFSQhAJLIKM2Da4NF8i VGWSlhXkagQ4R4ClKLcjNLUOVfMYpzMCoJ88qDTOHJzCuBm/4KaDET0OIL/Gwgi0sSEVJSDYw Tljd9TZ3Qos15/uS1DdfzV1/3Yn4sWW2l3NlkobqrLUflb2tKbNfyV0Hvfmh9s2lyXVaiILzn kU/HxtV5PH3VHlsTnitN1eR/fklwiu41g3q23eJfZwZkNqXXGqo2i4lmbjjZE3Yi7sPbAyrVJ k9456ttmr1h+cIZiZ4f0xjtFsjr7fKrYFBiKc5INNRiLipOBACCodlt3wIAAA== X-Env-Sender: konrad@char.us.oracle.com X-Msg-Ref: server-9.tower-21.messagelabs.com!1460135231!8268766!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29937 invoked from network); 8 Apr 2016 17:07:12 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-9.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 8 Apr 2016 17:07:12 -0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u38H6Xud027706 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Apr 2016 17:06:33 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u38H6Wh3008368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Apr 2016 17:06:32 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u38H6Vjo011546; Fri, 8 Apr 2016 17:06:31 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 08 Apr 2016 10:06:31 -0700 Received: by char.us.oracle.com (Postfix, from userid 1000) id 0560D6A00E8; Fri, 8 Apr 2016 13:06:29 -0400 (EDT) Date: Fri, 8 Apr 2016 13:06:29 -0400 From: Konrad Rzeszutek Wilk To: Jan Beulich Message-ID: <20160408170629.GY15411@char.us.oracle.com> References: <1458849640-22588-1-git-send-email-konrad.wilk@oracle.com> <1458849640-22588-20-git-send-email-konrad.wilk@oracle.com> <57027E4002000078000E2AF1@prv-mh.provo.novell.com> <20160408001825.GA16873@localhost.localdomain> <20160408015244.GB31173@localhost.localdomain> <5707DBD402000078000E60F9@prv-mh.provo.novell.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5707DBD402000078000E60F9@prv-mh.provo.novell.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Cc: Keir Fraser , ross.lagerwall@citrix.com, andrew.cooper3@citrix.com, mpohlack@amazon.de, Julien Grall , Stefano Stabellini , sasha.levin@oracle.com, xen-devel@lists.xenproject.org Subject: Re: [Xen-devel] [PATCH v5 19/28] build_id: Provide ld-embedded build-ids X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Apr 08, 2016 at 09:27:00AM -0600, Jan Beulich wrote: > >>> On 08.04.16 at 03:52, wrote: > > On Thu, Apr 07, 2016 at 08:18:27PM -0400, Konrad Rzeszutek Wilk wrote: > >> > > >> > > + $(OBJCOPY) -I binary -O elf64-x86-64 -B i386:x86-64 \ > >> > > + --rename-section=.data=.note.gnu.build-id -S $@.bin $@ > >> > > >> > Since you put the notes into .rodata anyway, why name the > >> > section .note.*? Just name it .rodata.*, avoiding to mislead > >> > others who also think that a section's name has much of a > >> > meaning. > >> > >> Way back last year: > >> http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg01264.html > >> > >> which is where the .note came about. I can put it all in .rodata > >> and not have it for normal ELF builds if you would like. > > > > .rodata.notes for both ELF and EFI looks to have done the trick. > > Now it is just the matter of testing it. > > Why also for ELF? In ELF, these are ordinary notes, so imo > belong into .note or .note.*. As opposed to COFF/PE, where > the idea of notes doesn't exist. The xen.lds.S will only have one #ifdef: Instead of multiple ones. But coming back to you: "Since you put the notes into .rodata anyway, why name the section .note" Perhaps you mean - why name the section .note.gnu_build-id ? So that when xen.efi is linked with this build_id.o (in v5, now called notes.o in v6) it can encapsulate __note_gnu_build_id_start and __note_gnu_build_id_end around it. I could change for EFI builds the xen.lds.S to be: *(.rodata.*) +#if defined(BUILD_ID) && defined(EFI) +/* + * No mechanism to put an PT_NOTE in the EFI file - so put + * it in .data section. + */ + . = ALIGN(4); + + __note_gnu_build_id_start = .; + *(.rodata.note.gnu.build-id) + __note_gnu_build_id_end = .; + *(.note) + *(.note.*) +#endif But then it differes from the change for !EFI (Which would be naturally called .note.gnu.build-id). diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 5eb825e..3b4fd15 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -31,6 +31,9 @@ OUTPUT_ARCH(i386:x86-64) PHDRS { text PT_LOAD ; +#if defined(BUILD_ID) + note PT_NOTE ; +#endif } SECTIONS { @@ -96,8 +99,18 @@ SECTIONS *(.lockprofile.data) __lock_profile_end = .; #endif - _erodata = .; } :text +#if defined(BUILD_ID) + .rodata.note : { + . = ALIGN(4); + __note_gnu_build_id_start = .; + *(.note.gnu.build-id) + __note_gnu_build_id_end = .; + *(.note) + *(.note.*) + } :note :text +#endif + _erodata = .; #ifdef EFI . = ALIGN(MB(2));