From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Kiper Subject: Re: [PATCH v2 02/23] x86/boot: copy only text section from *.lnk file to *.bin file Date: Wed, 22 Jul 2015 15:31:36 +0200 Message-ID: <20150722133136.GL3479@olila.local.net-space.pl> 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> 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 1ZHu7g-00054H-6p for xen-devel@lists.xenproject.org; Wed, 22 Jul 2015 13:31:48 +0000 Content-Disposition: inline In-Reply-To: <55AF6A230200007800093DE1@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: andrew.cooper3@citrix.com, keir@xen.org, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org 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 [ 4] .comment PROGBITS 00000000 000898 00001c 01 MS 0 0 1 [ 5] .debug_aranges PROGBITS 00000000 0008b4 000020 00 0 0 1 [ 6] .debug_info PROGBITS 00000000 0008d4 000c2c 00 0 0 1 [ 7] .debug_abbrev PROGBITS 00000000 001500 000303 00 0 0 1 [ 8] .debug_line PROGBITS 00000000 001803 000180 00 0 0 1 [ 9] .debug_str PROGBITS 00000000 001983 000236 01 MS 0 0 1 [10] .debug_loc PROGBITS 00000000 001bb9 0007b8 00 0 0 1 [11] .debug_ranges PROGBITS 00000000 002371 000030 00 0 0 1 [12] .shstrtab STRTAB 00000000 0023a1 000096 00 0 0 1 [13] .symtab SYMTAB 00000000 002690 000290 10 14 36 4 [14] .strtab STRTAB 00000000 002920 000162 00 0 0 1 [...] It is generated using ld from binutils 2.22. I was thinking that -static ld option would remove .got.plt but it did not. Daniel