From patchwork Wed Feb 24 18:52:45 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: 8411221 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F3CAC0553 for ; Wed, 24 Feb 2016 18:55:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7618820279 for ; Wed, 24 Feb 2016 18:55:28 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D95120265 for ; Wed, 24 Feb 2016 18:55:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYeYZ-0001CA-Dd; Wed, 24 Feb 2016 18:53:03 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYeYX-0001Bm-9E for xen-devel@lists.xen.org; Wed, 24 Feb 2016 18:53:01 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id C5/D8-02994-50CFDC65; Wed, 24 Feb 2016 18:52:53 +0000 X-Env-Sender: konrad@char.us.oracle.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1456339978!24743305!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8449 invoked from network); 24 Feb 2016 18:52:59 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-12.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 24 Feb 2016 18:52:59 -0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1OIqnNG016635 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2016 18:52:49 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1OIqmJ8010151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 24 Feb 2016 18:52:48 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1OIqlxA016972; Wed, 24 Feb 2016 18:52:47 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 24 Feb 2016 10:52:47 -0800 Received: by char.us.oracle.com (Postfix, from userid 1000) id 50A7C6A4BF5; Wed, 24 Feb 2016 13:52:45 -0500 (EST) Date: Wed, 24 Feb 2016 13:52:45 -0500 From: Konrad Rzeszutek Wilk To: Andrew Cooper Message-ID: <20160224185245.GA18149@char.us.oracle.com> References: <1455300361-13092-1-git-send-email-konrad.wilk@oracle.com> <1455300361-13092-14-git-send-email-konrad.wilk@oracle.com> <56C381E9.7030002@citrix.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <56C381E9.7030002@citrix.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: userv0022.oracle.com [156.151.31.74] Cc: Wei Liu , Ian Campbell , jinsong.liu@alibaba-inc.com, Stefano Stabellini , Ian Jackson , xen-devel@lists.xen.org, mpohlack@amazon.de, ross.lagerwall@citrix.com, Stefano Stabellini , Jan Beulich , xen-devel@lists.xenproject.org, Daniel De Graaf , Keir Fraser , sasha.levin@citrix.com Subject: Re: [Xen-devel] [PATCH v3 13/23] XENVER_build_id: Provide ld-embedded build-ids (v10) X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org 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 > > diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S > > index f501a2f..5cf180f 100644 > > --- a/xen/arch/arm/xen.lds.S > > +++ b/xen/arch/arm/xen.lds.S > > @@ -22,6 +22,9 @@ OUTPUT_ARCH(FORMAT) > > PHDRS > > { > > text PT_LOAD /* XXX should be AT ( XEN_PHYS_START ) */ ; > > +#if defined(BUILD_ID) > > + note PT_NOTE ; > > +#endif > > } > > SECTIONS > > { > > @@ -53,6 +56,16 @@ SECTIONS > > _erodata = .; /* End of read-only data */ > > } :text > > > > +#if defined(BUILD_ID) > > + .note : { > > + __note_gnu_build_id_start = .; > > + *(.note.gnu.build-id) > > + __note_gnu_build_id_end = .; > > + *(.note) > > + *(.note.*) > > + } :text > > +#endif > > This data really should be contained inside rodata. I get (I replace :text with :rodata) and got: ld: section `.note' assigned to non-existent phdr `rodata' Which makes sense as there are only two PHDRS. Where you suggesting that the .note should be part of the .rodata section? Jan wanted this to be in its own section (.note). Are you suggesting to add another one PHDR? (If so, then mkelf32 has to be modified, and for EFI I think it will have to have some #ifdef machinery to make it work). This is what I have right now in the tree. diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 9fde1db..ee16d22 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) && !defined(EFI) + note PT_NOTE ; +#endif } SECTIONS { @@ -65,8 +68,28 @@ SECTIONS *(.rodata) *(.rodata.*) +#if defined(BUILD_ID) && defined(EFI) + __note_gnu_build_id_start = .; + *(.note.gnu.build-id) + __note_gnu_build_id_end = .; +#endif } :text +#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 : { + __note_gnu_build_id_start = .; + *(.note.gnu.build-id) + __note_gnu_build_id_end = .; + *(.note) + *(.note.*) + } :note :text +#endif + . = ALIGN(SMP_CACHE_BYTES); .data.read_mostly : { /* Exception table */