From: "Jan Beulich" Subject: Re: [PATCH v2 02/23] x86/boot: copy only text section from *.lnk file to *.bin file Date: Wed, 22 Jul 2015 08:07:49 -0600 Message-ID: <55AFBFD50200007800094185@prv-mh.provo.novell.com> References: <1437402558-7313-1-git-send-email-daniel.kiper@oracle.com> <1437402558-7313-3-git-send-email-daniel.kiper@oracle.com> <55AE2E6B02000078000938BD@prv-mh.provo.novell.com> <20150721172355.GJ3479@olila.local.net-space.pl> <55AF6A230200007800093DE1@prv-mh.provo.novell.com> <20150722133136.GL3479@olila.local.net-space.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZHugd-0000ko-8c for xen-devel@lists.xenproject.org; Wed, 22 Jul 2015 14:07:55 +0000 In-Reply-To: <20150722133136.GL3479@olila.local.net-space.pl> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Daniel Kiper Cc: andrew.cooper3@citrix.com, keir@xen.org, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 22.07.15 at 15:31, wrote: > On Wed, Jul 22, 2015 at 02:02:11AM -0600, Jan Beulich wrote: >> >>> On 21.07.15 at 19:23, wrote: >> > First of all ld generates .got.plt section and objcopy copy it to binary >> > file. >> > It is not needed because we do not link our stuff here with shared >> > libraries. >> > So, we can use -R objcopy option to remove it (if you do not like -j .text). >> > This way we could save 15 bytes (at least on my machines). >> >> So I checked and did find no .got.plt at all on a machine using >> binutils 2.25 and an empty one on a machine using an older >> version. So I'm curious what you're seeing present in that >> table (without any of your patches applied). > > Here it is: > > [...] > > Section Headers: > [Nr] Name Type Addr Off Size ES Flg Lk Inf Al > [ 0] NULL 00000000 000000 000000 00 0 0 0 > [ 1] .text PROGBITS 00000000 000080 000705 00 WAX 0 0 16 > [ 2] .eh_frame PROGBITS 00000708 000788 000104 00 A 0 0 4 > [ 3] .got.plt PROGBITS 0000080c 00088c 00000c 04 WA 0 0 4 But how do I know what is in there, i.e. which symbols are causing this non-zero size? Because that's what we want to deal with instead of arbitrarily dropping (or picking) sections. Jan