Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Zws0r-00019O-83 for mharc-grub-devel@gnu.org; Thu, 12 Nov 2015 08:34:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zws0o-00016Z-DM for grub-devel@gnu.org; Thu, 12 Nov 2015 08:34:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zws0l-0001KE-7w for grub-devel@gnu.org; Thu, 12 Nov 2015 08:34:02 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:38912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zws0l-0001Hh-1Y for grub-devel@gnu.org; Thu, 12 Nov 2015 08:33:59 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tACDXttX022140 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 Nov 2015 13:33:55 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id tACDXtxo004762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 12 Nov 2015 13:33:55 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id tACDXtLn013383; Thu, 12 Nov 2015 13:33:55 GMT Received: from olila.local.net-space.pl (/10.175.184.90) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 12 Nov 2015 05:33:54 -0800 Date: Thu, 12 Nov 2015 14:33:50 +0100 From: Daniel Kiper To: "Vladimir =?utf-8?Q?'=CF=86-coder=2Fphcoder'?= Serbinenko" Subject: Re: [PATCH v2 5/6] multiboot2: Add support for relocatable images Message-ID: <20151112133350.GX26902@olila.local.net-space.pl> References: <1437402954-7375-1-git-send-email-daniel.kiper@oracle.com> <1437402954-7375-6-git-send-email-daniel.kiper@oracle.com> <5640FD43.7060301@gmail.com> <20151110145229.GT26902@olila.local.net-space.pl> <20151112131555.GW26902@olila.local.net-space.pl> <5644937D.7010500@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5644937D.7010500@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by userp1040.oracle.com id tACDXttX022140 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: The development of GRUB 2 , "xen-devel@lists.xen.org" X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 13:34:03 -0000 On Thu, Nov 12, 2015 at 02:26:21PM +0100, Vladimir '=CF=86-coder/phcoder'= Serbinenko wrote: > On 12.11.2015 14:15, Daniel Kiper wrote: > > On Tue, Nov 10, 2015 at 04:23:46PM +0100, Vladimir 'phcoder' Serbinen= ko wrote: > >> Le 10 nov. 2015 3:52 PM, "Daniel Kiper" a = =C3=A9crit : > >>> On Mon, Nov 09, 2015 at 09:08:35PM +0100, Vladimir '=CF=86-coder/ph= coder' > >> Serbinenko wrote: > >>>> On 20.07.2015 16:35, Daniel Kiper wrote: > >>>>> Signed-off-by: Daniel Kiper > >>>> What is handling the actual relocation? > >>> > >>> In Xen we get image offset from GRUB2 and using this value we calcu= late > >>> relative addresses. We are using %fs for it. > >>> > >>>> Why doesn't this patch include support for ELF relocations? > >>> > >>> This is another option. We considered it too. However, in our case > >>> relative addressing looks simpler then ELF relocations. > >> How is it simpler than to have a fully relocated binary when you sta= rt? > > > > Xen ELF file does not have relocations. > > > >> How do you pass the offset? > > > > Via MULTIBOOT_TAG_TYPE_BASE_ADDR tag. > > > >> Does xen have any relocation entries? > > > > No. > > > Can we then settle on using your interface but saying that bootloader > has to execute all ELF relocations? Since you don't have them, you > wouldn't be affected by the change but it would allow easy creation of > relocatable binaries. Feel free in the first patch just to have a check > for absence of relocation entries. x86-64 has only about 5 relocations > we care about so should be easy to implement. We can reuse code in dl.c. Granted! Daniel